@deboxsoft/accounting-api
Advanced tools
Comparing version 0.1.0-alpha.42 to 0.1.0-alpha.43
@@ -9,5 +9,5 @@ 'use strict'; | ||
const accountSchema = sh.object({ | ||
code: sh.string(), | ||
name: sh.string(), | ||
type: sh.string(), | ||
code: sh.string().nonempty(), | ||
name: sh.string().nonempty(), | ||
type: sh.string().nonempty(), | ||
active: sh.boolean().optional(), | ||
@@ -21,6 +21,6 @@ isParent: sh.boolean().optional(), | ||
date: sh.union([sh.string(), sh.date()]), | ||
noJournal: sh.string(), | ||
noTransaction: sh.string(), | ||
noJournal: sh.string().nonempty(), | ||
noTransaction: sh.string().nonempty(), | ||
type: sh.string(), | ||
total: sh.number(), | ||
total: sh.number().min(1), | ||
accounts: sh.array(sh.object({ | ||
@@ -33,7 +33,7 @@ accountId: sh.string(), | ||
const divisionSchema = sh.object({ | ||
code: sh.string(), | ||
name: sh.string() | ||
code: sh.string().nonempty(), | ||
name: sh.string().nonempty() | ||
}); | ||
const companySchema = sh.object({ | ||
name: sh.string(), | ||
name: sh.string().nonempty(), | ||
address: sh.string(), | ||
@@ -45,6 +45,6 @@ divisions: sh.array(divisionSchema) | ||
const bankReconciliationSchema = sh.object({ | ||
accountBank: sh.string(), | ||
accountBank: sh.string().nonempty(), | ||
bank: bankSchema, | ||
accountId: sh.string(), | ||
nameAccountBank: sh.string(), | ||
accountId: sh.string().nonempty(), | ||
nameAccountBank: sh.string().nonempty(), | ||
balance: sh.number(), | ||
@@ -54,3 +54,3 @@ date: sh.union([sh.date(), sh.string()]) | ||
const bankStatementSchema = sh.object({ | ||
date: sh.union([sh.date(), sh.string()]), | ||
date: sh.union([sh.date(), sh.string().nonempty()]), | ||
description: sh.string(), | ||
@@ -64,4 +64,4 @@ in: sh.number(), | ||
const inventorySchema = sh.object({ | ||
name: sh.string(), | ||
code: sh.string(), | ||
name: sh.string().nonempty(), | ||
code: sh.string().nonempty(), | ||
quantity: sh.number().min(1) | ||
@@ -73,3 +73,2 @@ }); | ||
date: sh.date(), | ||
inventoryId: sh.string(), | ||
count: sh.number().min(1), | ||
@@ -82,3 +81,3 @@ type: stockTransferType | ||
date: sh.union([sh.date(), sh.string()]), | ||
accountId: sh.string(), | ||
accountId: sh.string().nonempty(), | ||
isCredit: sh.boolean().optional(), | ||
@@ -85,0 +84,0 @@ amount: sh.number() |
33
index.js
@@ -5,5 +5,5 @@ import { object, string, boolean, union, date, number, array, enum as enum$1 } from '@deboxsoft/zod'; | ||
const accountSchema = object({ | ||
code: string(), | ||
name: string(), | ||
type: string(), | ||
code: string().nonempty(), | ||
name: string().nonempty(), | ||
type: string().nonempty(), | ||
active: boolean().optional(), | ||
@@ -17,6 +17,6 @@ isParent: boolean().optional(), | ||
date: union([string(), date()]), | ||
noJournal: string(), | ||
noTransaction: string(), | ||
noJournal: string().nonempty(), | ||
noTransaction: string().nonempty(), | ||
type: string(), | ||
total: number(), | ||
total: number().min(1), | ||
accounts: array(object({ | ||
@@ -29,7 +29,7 @@ accountId: string(), | ||
const divisionSchema = object({ | ||
code: string(), | ||
name: string() | ||
code: string().nonempty(), | ||
name: string().nonempty() | ||
}); | ||
const companySchema = object({ | ||
name: string(), | ||
name: string().nonempty(), | ||
address: string(), | ||
@@ -41,6 +41,6 @@ divisions: array(divisionSchema) | ||
const bankReconciliationSchema = object({ | ||
accountBank: string(), | ||
accountBank: string().nonempty(), | ||
bank: bankSchema, | ||
accountId: string(), | ||
nameAccountBank: string(), | ||
accountId: string().nonempty(), | ||
nameAccountBank: string().nonempty(), | ||
balance: number(), | ||
@@ -50,3 +50,3 @@ date: union([date(), string()]) | ||
const bankStatementSchema = object({ | ||
date: union([date(), string()]), | ||
date: union([date(), string().nonempty()]), | ||
description: string(), | ||
@@ -60,4 +60,4 @@ in: number(), | ||
const inventorySchema = object({ | ||
name: string(), | ||
code: string(), | ||
name: string().nonempty(), | ||
code: string().nonempty(), | ||
quantity: number().min(1) | ||
@@ -69,3 +69,2 @@ }); | ||
date: date(), | ||
inventoryId: string(), | ||
count: number().min(1), | ||
@@ -78,3 +77,3 @@ type: stockTransferType | ||
date: union([date(), string()]), | ||
accountId: string(), | ||
accountId: string().nonempty(), | ||
isCredit: boolean().optional(), | ||
@@ -81,0 +80,0 @@ amount: number() |
{ | ||
"name": "@deboxsoft/accounting-api", | ||
"version": "0.1.0-alpha.42", | ||
"version": "0.1.0-alpha.43", | ||
"license": "SEE LICENSE IN LICENSE.md", | ||
@@ -43,3 +43,3 @@ "repository": { | ||
"devDependencies": { | ||
"@deboxsoft/zod": "^3.0.0-4", | ||
"@deboxsoft/zod": "^3.0.0-0", | ||
"@sucrase/jest-plugin": "^2.0.0", | ||
@@ -46,0 +46,0 @@ "@testing-library/jest-dom": "^5.11.9", |
@@ -1,2 +0,1 @@ | ||
import { TypeOf } from "@deboxsoft/zod"; | ||
export declare const accountSchema: import("@deboxsoft/zod/lib").ZodObject<{ | ||
@@ -27,2 +26,2 @@ code: import("@deboxsoft/zod/lib").ZodString; | ||
}>; | ||
export declare type AccountSchema = TypeOf<typeof accountSchema>; | ||
export declare type AccountSchema = typeof accountSchema; |
@@ -6,3 +6,2 @@ import * as sh from "@deboxsoft/zod"; | ||
date: sh.ZodDate; | ||
inventoryId: sh.ZodString; | ||
count: sh.ZodNumber; | ||
@@ -13,3 +12,2 @@ type: sh.ZodEnum<["IN", "OUT"]>; | ||
type: "IN" | "OUT"; | ||
inventoryId: string; | ||
count: number; | ||
@@ -19,4 +17,3 @@ }, { | ||
type: "IN" | "OUT"; | ||
inventoryId: string; | ||
count: number; | ||
}>; |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
33945
854