@jsdev_ninja/core 0.18.0 → 0.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core.cjs +1 -1
- package/dist/core.cjs.map +1 -1
- package/dist/core.es.js +292 -277
- package/dist/core.es.js.map +1 -1
- package/dist/core.umd.js +1 -1
- package/dist/core.umd.js.map +1 -1
- package/dist/lib/entities/Order.d.ts +25 -0
- package/dist/lib/entities/Order.d.ts.map +1 -1
- package/dist/lib/entities/Organization.d.ts +67 -0
- package/dist/lib/entities/Organization.d.ts.map +1 -1
- package/dist/lib/entities/Organization.js +16 -0
- package/dist/lib/entities/OrganizationBalance.d.ts +2 -2
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -1893,14 +1893,29 @@ export declare const OrderSchema: z.ZodObject<{
|
|
|
1893
1893
|
number: z.ZodString;
|
|
1894
1894
|
name: z.ZodString;
|
|
1895
1895
|
id: z.ZodString;
|
|
1896
|
+
payTerms: z.ZodOptional<z.ZodEnum<["credit", "net15", "net30", "net60", "net90"]>>;
|
|
1897
|
+
creditLimit: z.ZodOptional<z.ZodNumber>;
|
|
1898
|
+
isPrimary: z.ZodOptional<z.ZodBoolean>;
|
|
1899
|
+
restricted: z.ZodOptional<z.ZodBoolean>;
|
|
1900
|
+
allowedCategories: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
1896
1901
|
}, "strip", z.ZodTypeAny, {
|
|
1897
1902
|
number: string;
|
|
1898
1903
|
id: string;
|
|
1899
1904
|
name: string;
|
|
1905
|
+
payTerms?: "credit" | "net15" | "net30" | "net60" | "net90" | undefined;
|
|
1906
|
+
creditLimit?: number | undefined;
|
|
1907
|
+
isPrimary?: boolean | undefined;
|
|
1908
|
+
restricted?: boolean | undefined;
|
|
1909
|
+
allowedCategories?: string[] | undefined;
|
|
1900
1910
|
}, {
|
|
1901
1911
|
number: string;
|
|
1902
1912
|
id: string;
|
|
1903
1913
|
name: string;
|
|
1914
|
+
payTerms?: "credit" | "net15" | "net30" | "net60" | "net90" | undefined;
|
|
1915
|
+
creditLimit?: number | undefined;
|
|
1916
|
+
isPrimary?: boolean | undefined;
|
|
1917
|
+
restricted?: boolean | undefined;
|
|
1918
|
+
allowedCategories?: string[] | undefined;
|
|
1904
1919
|
}>>;
|
|
1905
1920
|
deliveryNote: z.ZodOptional<z.ZodObject<{
|
|
1906
1921
|
id: z.ZodString;
|
|
@@ -2697,6 +2712,11 @@ export declare const OrderSchema: z.ZodObject<{
|
|
|
2697
2712
|
number: string;
|
|
2698
2713
|
id: string;
|
|
2699
2714
|
name: string;
|
|
2715
|
+
payTerms?: "credit" | "net15" | "net30" | "net60" | "net90" | undefined;
|
|
2716
|
+
creditLimit?: number | undefined;
|
|
2717
|
+
isPrimary?: boolean | undefined;
|
|
2718
|
+
restricted?: boolean | undefined;
|
|
2719
|
+
allowedCategories?: string[] | undefined;
|
|
2700
2720
|
} | undefined;
|
|
2701
2721
|
deliveryNote?: {
|
|
2702
2722
|
number: string;
|
|
@@ -3105,6 +3125,11 @@ export declare const OrderSchema: z.ZodObject<{
|
|
|
3105
3125
|
number: string;
|
|
3106
3126
|
id: string;
|
|
3107
3127
|
name: string;
|
|
3128
|
+
payTerms?: "credit" | "net15" | "net30" | "net60" | "net90" | undefined;
|
|
3129
|
+
creditLimit?: number | undefined;
|
|
3130
|
+
isPrimary?: boolean | undefined;
|
|
3131
|
+
restricted?: boolean | undefined;
|
|
3132
|
+
allowedCategories?: string[] | undefined;
|
|
3108
3133
|
} | undefined;
|
|
3109
3134
|
deliveryNote?: {
|
|
3110
3135
|
number: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Order.d.ts","sourceRoot":"","sources":["../../../lib/entities/Order.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAkBxB,eAAO,MAAM,WAAW
|
|
1
|
+
{"version":3,"file":"Order.d.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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAKF,CAAC;AAEH,MAAM,MAAM,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC"}
|
|
@@ -1,16 +1,33 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
+
export declare const PaymentTermsSchema: z.ZodEnum<["credit", "net15", "net30", "net60", "net90"]>;
|
|
3
|
+
export type TPaymentTerms = z.infer<typeof PaymentTermsSchema>;
|
|
2
4
|
export declare const BillingAccountSchema: z.ZodObject<{
|
|
3
5
|
number: z.ZodString;
|
|
4
6
|
name: z.ZodString;
|
|
5
7
|
id: z.ZodString;
|
|
8
|
+
payTerms: z.ZodOptional<z.ZodEnum<["credit", "net15", "net30", "net60", "net90"]>>;
|
|
9
|
+
creditLimit: z.ZodOptional<z.ZodNumber>;
|
|
10
|
+
isPrimary: z.ZodOptional<z.ZodBoolean>;
|
|
11
|
+
restricted: z.ZodOptional<z.ZodBoolean>;
|
|
12
|
+
allowedCategories: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
6
13
|
}, "strip", z.ZodTypeAny, {
|
|
7
14
|
number: string;
|
|
8
15
|
id: string;
|
|
9
16
|
name: string;
|
|
17
|
+
payTerms?: "credit" | "net15" | "net30" | "net60" | "net90" | undefined;
|
|
18
|
+
creditLimit?: number | undefined;
|
|
19
|
+
isPrimary?: boolean | undefined;
|
|
20
|
+
restricted?: boolean | undefined;
|
|
21
|
+
allowedCategories?: string[] | undefined;
|
|
10
22
|
}, {
|
|
11
23
|
number: string;
|
|
12
24
|
id: string;
|
|
13
25
|
name: string;
|
|
26
|
+
payTerms?: "credit" | "net15" | "net30" | "net60" | "net90" | undefined;
|
|
27
|
+
creditLimit?: number | undefined;
|
|
28
|
+
isPrimary?: boolean | undefined;
|
|
29
|
+
restricted?: boolean | undefined;
|
|
30
|
+
allowedCategories?: string[] | undefined;
|
|
14
31
|
}>;
|
|
15
32
|
export declare const OrganizationSchema: z.ZodObject<{
|
|
16
33
|
id: z.ZodString;
|
|
@@ -21,14 +38,29 @@ export declare const OrganizationSchema: z.ZodObject<{
|
|
|
21
38
|
number: z.ZodString;
|
|
22
39
|
name: z.ZodString;
|
|
23
40
|
id: z.ZodString;
|
|
41
|
+
payTerms: z.ZodOptional<z.ZodEnum<["credit", "net15", "net30", "net60", "net90"]>>;
|
|
42
|
+
creditLimit: z.ZodOptional<z.ZodNumber>;
|
|
43
|
+
isPrimary: z.ZodOptional<z.ZodBoolean>;
|
|
44
|
+
restricted: z.ZodOptional<z.ZodBoolean>;
|
|
45
|
+
allowedCategories: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
24
46
|
}, "strip", z.ZodTypeAny, {
|
|
25
47
|
number: string;
|
|
26
48
|
id: string;
|
|
27
49
|
name: string;
|
|
50
|
+
payTerms?: "credit" | "net15" | "net30" | "net60" | "net90" | undefined;
|
|
51
|
+
creditLimit?: number | undefined;
|
|
52
|
+
isPrimary?: boolean | undefined;
|
|
53
|
+
restricted?: boolean | undefined;
|
|
54
|
+
allowedCategories?: string[] | undefined;
|
|
28
55
|
}, {
|
|
29
56
|
number: string;
|
|
30
57
|
id: string;
|
|
31
58
|
name: string;
|
|
59
|
+
payTerms?: "credit" | "net15" | "net30" | "net60" | "net90" | undefined;
|
|
60
|
+
creditLimit?: number | undefined;
|
|
61
|
+
isPrimary?: boolean | undefined;
|
|
62
|
+
restricted?: boolean | undefined;
|
|
63
|
+
allowedCategories?: string[] | undefined;
|
|
32
64
|
}>, "many">;
|
|
33
65
|
paymentType: z.ZodEnum<["external", "j5", "none"]>;
|
|
34
66
|
companyNumber: z.ZodOptional<z.ZodString>;
|
|
@@ -73,6 +105,11 @@ export declare const OrganizationSchema: z.ZodObject<{
|
|
|
73
105
|
number: string;
|
|
74
106
|
id: string;
|
|
75
107
|
name: string;
|
|
108
|
+
payTerms?: "credit" | "net15" | "net30" | "net60" | "net90" | undefined;
|
|
109
|
+
creditLimit?: number | undefined;
|
|
110
|
+
isPrimary?: boolean | undefined;
|
|
111
|
+
restricted?: boolean | undefined;
|
|
112
|
+
allowedCategories?: string[] | undefined;
|
|
76
113
|
}[];
|
|
77
114
|
email?: string | undefined;
|
|
78
115
|
address?: {
|
|
@@ -100,6 +137,11 @@ export declare const OrganizationSchema: z.ZodObject<{
|
|
|
100
137
|
number: string;
|
|
101
138
|
id: string;
|
|
102
139
|
name: string;
|
|
140
|
+
payTerms?: "credit" | "net15" | "net30" | "net60" | "net90" | undefined;
|
|
141
|
+
creditLimit?: number | undefined;
|
|
142
|
+
isPrimary?: boolean | undefined;
|
|
143
|
+
restricted?: boolean | undefined;
|
|
144
|
+
allowedCategories?: string[] | undefined;
|
|
103
145
|
}[];
|
|
104
146
|
email?: string | undefined;
|
|
105
147
|
address?: {
|
|
@@ -129,14 +171,29 @@ export declare const NewOrganizationSchema: z.ZodObject<Omit<{
|
|
|
129
171
|
number: z.ZodString;
|
|
130
172
|
name: z.ZodString;
|
|
131
173
|
id: z.ZodString;
|
|
174
|
+
payTerms: z.ZodOptional<z.ZodEnum<["credit", "net15", "net30", "net60", "net90"]>>;
|
|
175
|
+
creditLimit: z.ZodOptional<z.ZodNumber>;
|
|
176
|
+
isPrimary: z.ZodOptional<z.ZodBoolean>;
|
|
177
|
+
restricted: z.ZodOptional<z.ZodBoolean>;
|
|
178
|
+
allowedCategories: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
132
179
|
}, "strip", z.ZodTypeAny, {
|
|
133
180
|
number: string;
|
|
134
181
|
id: string;
|
|
135
182
|
name: string;
|
|
183
|
+
payTerms?: "credit" | "net15" | "net30" | "net60" | "net90" | undefined;
|
|
184
|
+
creditLimit?: number | undefined;
|
|
185
|
+
isPrimary?: boolean | undefined;
|
|
186
|
+
restricted?: boolean | undefined;
|
|
187
|
+
allowedCategories?: string[] | undefined;
|
|
136
188
|
}, {
|
|
137
189
|
number: string;
|
|
138
190
|
id: string;
|
|
139
191
|
name: string;
|
|
192
|
+
payTerms?: "credit" | "net15" | "net30" | "net60" | "net90" | undefined;
|
|
193
|
+
creditLimit?: number | undefined;
|
|
194
|
+
isPrimary?: boolean | undefined;
|
|
195
|
+
restricted?: boolean | undefined;
|
|
196
|
+
allowedCategories?: string[] | undefined;
|
|
140
197
|
}>, "many">;
|
|
141
198
|
paymentType: z.ZodEnum<["external", "j5", "none"]>;
|
|
142
199
|
companyNumber: z.ZodOptional<z.ZodString>;
|
|
@@ -180,6 +237,11 @@ export declare const NewOrganizationSchema: z.ZodObject<Omit<{
|
|
|
180
237
|
number: string;
|
|
181
238
|
id: string;
|
|
182
239
|
name: string;
|
|
240
|
+
payTerms?: "credit" | "net15" | "net30" | "net60" | "net90" | undefined;
|
|
241
|
+
creditLimit?: number | undefined;
|
|
242
|
+
isPrimary?: boolean | undefined;
|
|
243
|
+
restricted?: boolean | undefined;
|
|
244
|
+
allowedCategories?: string[] | undefined;
|
|
183
245
|
}[];
|
|
184
246
|
email?: string | undefined;
|
|
185
247
|
address?: {
|
|
@@ -206,6 +268,11 @@ export declare const NewOrganizationSchema: z.ZodObject<Omit<{
|
|
|
206
268
|
number: string;
|
|
207
269
|
id: string;
|
|
208
270
|
name: string;
|
|
271
|
+
payTerms?: "credit" | "net15" | "net30" | "net60" | "net90" | undefined;
|
|
272
|
+
creditLimit?: number | undefined;
|
|
273
|
+
isPrimary?: boolean | undefined;
|
|
274
|
+
restricted?: boolean | undefined;
|
|
275
|
+
allowedCategories?: string[] | undefined;
|
|
209
276
|
}[];
|
|
210
277
|
email?: string | undefined;
|
|
211
278
|
address?: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Organization.d.ts","sourceRoot":"","sources":["../../../lib/entities/Organization.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"Organization.d.ts","sourceRoot":"","sources":["../../../lib/entities/Organization.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,eAAO,MAAM,kBAAkB,2DAM7B,CAAC;AACH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAE/D,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;EAY/B,CAAC;AAGH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAe7B,CAAC;AAEH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAwC,CAAC;AAE3E,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AACnE,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AACrE,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC"}
|
|
@@ -1,10 +1,26 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { PaymentTypeSchema } from "./Payment";
|
|
3
3
|
import { AddressSchema } from "./Address";
|
|
4
|
+
// Payment terms are an ADMIN-ONLY billing attribute — never exposed to the customer.
|
|
5
|
+
export const PaymentTermsSchema = z.enum([
|
|
6
|
+
"credit",
|
|
7
|
+
"net15",
|
|
8
|
+
"net30",
|
|
9
|
+
"net60",
|
|
10
|
+
"net90",
|
|
11
|
+
]);
|
|
4
12
|
export const BillingAccountSchema = z.object({
|
|
5
13
|
number: z.string(),
|
|
6
14
|
name: z.string(),
|
|
7
15
|
id: z.string(),
|
|
16
|
+
// Optional, admin-managed billing config (see company-edit-like-demo plan, Phase 2)
|
|
17
|
+
payTerms: PaymentTermsSchema.optional(),
|
|
18
|
+
creditLimit: z.number().optional(),
|
|
19
|
+
isPrimary: z.boolean().optional(),
|
|
20
|
+
// Optional category restriction — when `restricted`, the account is limited to
|
|
21
|
+
// `allowedCategories` (category ids). Order-time enforcement is a separate concern.
|
|
22
|
+
restricted: z.boolean().optional(),
|
|
23
|
+
allowedCategories: z.array(z.string()).optional(),
|
|
8
24
|
});
|
|
9
25
|
// client organization for clients
|
|
10
26
|
export const OrganizationSchema = z.object({
|
|
@@ -118,9 +118,9 @@ export declare const OrganizationBalanceRollupSchema: z.ZodObject<{
|
|
|
118
118
|
storeId: string;
|
|
119
119
|
currency: "ILS";
|
|
120
120
|
organizationId: string;
|
|
121
|
+
credit: number;
|
|
121
122
|
updatedAt: number;
|
|
122
123
|
owed: number;
|
|
123
|
-
credit: number;
|
|
124
124
|
totalAccrued: number;
|
|
125
125
|
totalSettled: number;
|
|
126
126
|
}, {
|
|
@@ -128,9 +128,9 @@ export declare const OrganizationBalanceRollupSchema: z.ZodObject<{
|
|
|
128
128
|
storeId: string;
|
|
129
129
|
currency: "ILS";
|
|
130
130
|
organizationId: string;
|
|
131
|
+
credit: number;
|
|
131
132
|
updatedAt: number;
|
|
132
133
|
owed: number;
|
|
133
|
-
credit: number;
|
|
134
134
|
totalAccrued: number;
|
|
135
135
|
totalSettled: number;
|
|
136
136
|
}>;
|