@jsdev_ninja/core 0.18.0 → 0.20.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.
@@ -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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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C,OAAO,WAAW,CAAC,CAAC"}
@@ -1,17 +1,54 @@
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
  }>;
32
+ export declare const BranchSchema: z.ZodObject<{
33
+ id: z.ZodString;
34
+ label: z.ZodString;
35
+ address: z.ZodOptional<z.ZodString>;
36
+ phone: z.ZodOptional<z.ZodString>;
37
+ isPrimary: z.ZodOptional<z.ZodBoolean>;
38
+ }, "strip", z.ZodTypeAny, {
39
+ id: string;
40
+ label: string;
41
+ address?: string | undefined;
42
+ phone?: string | undefined;
43
+ isPrimary?: boolean | undefined;
44
+ }, {
45
+ id: string;
46
+ label: string;
47
+ address?: string | undefined;
48
+ phone?: string | undefined;
49
+ isPrimary?: boolean | undefined;
50
+ }>;
51
+ export type TBranch = z.infer<typeof BranchSchema>;
15
52
  export declare const OrganizationSchema: z.ZodObject<{
16
53
  id: z.ZodString;
17
54
  name: z.ZodString;
@@ -21,14 +58,29 @@ export declare const OrganizationSchema: z.ZodObject<{
21
58
  number: z.ZodString;
22
59
  name: z.ZodString;
23
60
  id: z.ZodString;
61
+ payTerms: z.ZodOptional<z.ZodEnum<["credit", "net15", "net30", "net60", "net90"]>>;
62
+ creditLimit: z.ZodOptional<z.ZodNumber>;
63
+ isPrimary: z.ZodOptional<z.ZodBoolean>;
64
+ restricted: z.ZodOptional<z.ZodBoolean>;
65
+ allowedCategories: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
24
66
  }, "strip", z.ZodTypeAny, {
25
67
  number: string;
26
68
  id: string;
27
69
  name: string;
70
+ payTerms?: "credit" | "net15" | "net30" | "net60" | "net90" | undefined;
71
+ creditLimit?: number | undefined;
72
+ isPrimary?: boolean | undefined;
73
+ restricted?: boolean | undefined;
74
+ allowedCategories?: string[] | undefined;
28
75
  }, {
29
76
  number: string;
30
77
  id: string;
31
78
  name: string;
79
+ payTerms?: "credit" | "net15" | "net30" | "net60" | "net90" | undefined;
80
+ creditLimit?: number | undefined;
81
+ isPrimary?: boolean | undefined;
82
+ restricted?: boolean | undefined;
83
+ allowedCategories?: string[] | undefined;
32
84
  }>, "many">;
33
85
  paymentType: z.ZodEnum<["external", "j5", "none"]>;
34
86
  companyNumber: z.ZodOptional<z.ZodString>;
@@ -65,6 +117,25 @@ export declare const OrganizationSchema: z.ZodObject<{
65
117
  email: z.ZodOptional<z.ZodString>;
66
118
  notes: z.ZodOptional<z.ZodString>;
67
119
  freeShipping: z.ZodOptional<z.ZodBoolean>;
120
+ branches: z.ZodOptional<z.ZodArray<z.ZodObject<{
121
+ id: z.ZodString;
122
+ label: z.ZodString;
123
+ address: z.ZodOptional<z.ZodString>;
124
+ phone: z.ZodOptional<z.ZodString>;
125
+ isPrimary: z.ZodOptional<z.ZodBoolean>;
126
+ }, "strip", z.ZodTypeAny, {
127
+ id: string;
128
+ label: string;
129
+ address?: string | undefined;
130
+ phone?: string | undefined;
131
+ isPrimary?: boolean | undefined;
132
+ }, {
133
+ id: string;
134
+ label: string;
135
+ address?: string | undefined;
136
+ phone?: string | undefined;
137
+ isPrimary?: boolean | undefined;
138
+ }>, "many">>;
68
139
  }, "strip", z.ZodTypeAny, {
69
140
  id: string;
70
141
  name: string;
@@ -73,6 +144,11 @@ export declare const OrganizationSchema: z.ZodObject<{
73
144
  number: string;
74
145
  id: string;
75
146
  name: string;
147
+ payTerms?: "credit" | "net15" | "net30" | "net60" | "net90" | undefined;
148
+ creditLimit?: number | undefined;
149
+ isPrimary?: boolean | undefined;
150
+ restricted?: boolean | undefined;
151
+ allowedCategories?: string[] | undefined;
76
152
  }[];
77
153
  email?: string | undefined;
78
154
  address?: {
@@ -92,6 +168,13 @@ export declare const OrganizationSchema: z.ZodObject<{
92
168
  groupId?: string | undefined;
93
169
  notes?: string | undefined;
94
170
  freeShipping?: boolean | undefined;
171
+ branches?: {
172
+ id: string;
173
+ label: string;
174
+ address?: string | undefined;
175
+ phone?: string | undefined;
176
+ isPrimary?: boolean | undefined;
177
+ }[] | undefined;
95
178
  }, {
96
179
  id: string;
97
180
  name: string;
@@ -100,6 +183,11 @@ export declare const OrganizationSchema: z.ZodObject<{
100
183
  number: string;
101
184
  id: string;
102
185
  name: string;
186
+ payTerms?: "credit" | "net15" | "net30" | "net60" | "net90" | undefined;
187
+ creditLimit?: number | undefined;
188
+ isPrimary?: boolean | undefined;
189
+ restricted?: boolean | undefined;
190
+ allowedCategories?: string[] | undefined;
103
191
  }[];
104
192
  email?: string | undefined;
105
193
  address?: {
@@ -119,6 +207,13 @@ export declare const OrganizationSchema: z.ZodObject<{
119
207
  groupId?: string | undefined;
120
208
  notes?: string | undefined;
121
209
  freeShipping?: boolean | undefined;
210
+ branches?: {
211
+ id: string;
212
+ label: string;
213
+ address?: string | undefined;
214
+ phone?: string | undefined;
215
+ isPrimary?: boolean | undefined;
216
+ }[] | undefined;
122
217
  }>;
123
218
  export declare const NewOrganizationSchema: z.ZodObject<Omit<{
124
219
  id: z.ZodString;
@@ -129,14 +224,29 @@ export declare const NewOrganizationSchema: z.ZodObject<Omit<{
129
224
  number: z.ZodString;
130
225
  name: z.ZodString;
131
226
  id: z.ZodString;
227
+ payTerms: z.ZodOptional<z.ZodEnum<["credit", "net15", "net30", "net60", "net90"]>>;
228
+ creditLimit: z.ZodOptional<z.ZodNumber>;
229
+ isPrimary: z.ZodOptional<z.ZodBoolean>;
230
+ restricted: z.ZodOptional<z.ZodBoolean>;
231
+ allowedCategories: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
132
232
  }, "strip", z.ZodTypeAny, {
133
233
  number: string;
134
234
  id: string;
135
235
  name: string;
236
+ payTerms?: "credit" | "net15" | "net30" | "net60" | "net90" | undefined;
237
+ creditLimit?: number | undefined;
238
+ isPrimary?: boolean | undefined;
239
+ restricted?: boolean | undefined;
240
+ allowedCategories?: string[] | undefined;
136
241
  }, {
137
242
  number: string;
138
243
  id: string;
139
244
  name: string;
245
+ payTerms?: "credit" | "net15" | "net30" | "net60" | "net90" | undefined;
246
+ creditLimit?: number | undefined;
247
+ isPrimary?: boolean | undefined;
248
+ restricted?: boolean | undefined;
249
+ allowedCategories?: string[] | undefined;
140
250
  }>, "many">;
141
251
  paymentType: z.ZodEnum<["external", "j5", "none"]>;
142
252
  companyNumber: z.ZodOptional<z.ZodString>;
@@ -173,6 +283,25 @@ export declare const NewOrganizationSchema: z.ZodObject<Omit<{
173
283
  email: z.ZodOptional<z.ZodString>;
174
284
  notes: z.ZodOptional<z.ZodString>;
175
285
  freeShipping: z.ZodOptional<z.ZodBoolean>;
286
+ branches: z.ZodOptional<z.ZodArray<z.ZodObject<{
287
+ id: z.ZodString;
288
+ label: z.ZodString;
289
+ address: z.ZodOptional<z.ZodString>;
290
+ phone: z.ZodOptional<z.ZodString>;
291
+ isPrimary: z.ZodOptional<z.ZodBoolean>;
292
+ }, "strip", z.ZodTypeAny, {
293
+ id: string;
294
+ label: string;
295
+ address?: string | undefined;
296
+ phone?: string | undefined;
297
+ isPrimary?: boolean | undefined;
298
+ }, {
299
+ id: string;
300
+ label: string;
301
+ address?: string | undefined;
302
+ phone?: string | undefined;
303
+ isPrimary?: boolean | undefined;
304
+ }>, "many">>;
176
305
  }, "id">, "strip", z.ZodTypeAny, {
177
306
  name: string;
178
307
  paymentType: "none" | "external" | "j5";
@@ -180,6 +309,11 @@ export declare const NewOrganizationSchema: z.ZodObject<Omit<{
180
309
  number: string;
181
310
  id: string;
182
311
  name: string;
312
+ payTerms?: "credit" | "net15" | "net30" | "net60" | "net90" | undefined;
313
+ creditLimit?: number | undefined;
314
+ isPrimary?: boolean | undefined;
315
+ restricted?: boolean | undefined;
316
+ allowedCategories?: string[] | undefined;
183
317
  }[];
184
318
  email?: string | undefined;
185
319
  address?: {
@@ -199,6 +333,13 @@ export declare const NewOrganizationSchema: z.ZodObject<Omit<{
199
333
  groupId?: string | undefined;
200
334
  notes?: string | undefined;
201
335
  freeShipping?: boolean | undefined;
336
+ branches?: {
337
+ id: string;
338
+ label: string;
339
+ address?: string | undefined;
340
+ phone?: string | undefined;
341
+ isPrimary?: boolean | undefined;
342
+ }[] | undefined;
202
343
  }, {
203
344
  name: string;
204
345
  paymentType: "none" | "external" | "j5";
@@ -206,6 +347,11 @@ export declare const NewOrganizationSchema: z.ZodObject<Omit<{
206
347
  number: string;
207
348
  id: string;
208
349
  name: string;
350
+ payTerms?: "credit" | "net15" | "net30" | "net60" | "net90" | undefined;
351
+ creditLimit?: number | undefined;
352
+ isPrimary?: boolean | undefined;
353
+ restricted?: boolean | undefined;
354
+ allowedCategories?: string[] | undefined;
209
355
  }[];
210
356
  email?: string | undefined;
211
357
  address?: {
@@ -225,6 +371,13 @@ export declare const NewOrganizationSchema: z.ZodObject<Omit<{
225
371
  groupId?: string | undefined;
226
372
  notes?: string | undefined;
227
373
  freeShipping?: boolean | undefined;
374
+ branches?: {
375
+ id: string;
376
+ label: string;
377
+ address?: string | undefined;
378
+ phone?: string | undefined;
379
+ isPrimary?: boolean | undefined;
380
+ }[] | undefined;
228
381
  }>;
229
382
  export type TBillingAccount = z.infer<typeof BillingAccountSchema>;
230
383
  export type TNewOrganization = z.infer<typeof NewOrganizationSchema>;
@@ -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;AAIxB,eAAO,MAAM,oBAAoB;;;;;;;;;;;;EAI/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
+ {"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,YAAY;;;;;;;;;;;;;;;;;;EAMvB,CAAC;AACH,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;AAGnD,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgB7B,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,34 @@
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(),
24
+ });
25
+ // A physical branch / office of the organization (admin-managed, optional).
26
+ export const BranchSchema = z.object({
27
+ id: z.string(),
28
+ label: z.string(),
29
+ address: z.string().optional(),
30
+ phone: z.string().optional(),
31
+ isPrimary: z.boolean().optional(),
8
32
  });
9
33
  // client organization for clients
10
34
  export const OrganizationSchema = z.object({
@@ -22,5 +46,6 @@ export const OrganizationSchema = z.object({
22
46
  email: z.string().optional(),
23
47
  notes: z.string().optional(),
24
48
  freeShipping: z.boolean().optional(),
49
+ branches: z.array(BranchSchema).optional(),
25
50
  });
26
51
  export const NewOrganizationSchema = OrganizationSchema.omit({ id: true });
@@ -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
  }>;