@jsdev_ninja/core 0.15.1 → 0.15.3
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 +57 -39
- 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 +40 -0
- package/dist/lib/entities/Order.d.ts.map +1 -1
- package/dist/lib/entities/Order.js +13 -0
- package/dist/lib/entities/SupplierInvoice.d.ts +6 -0
- package/dist/lib/entities/SupplierInvoice.d.ts.map +1 -1
- package/dist/lib/entities/SupplierInvoice.js +4 -0
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -1860,6 +1860,26 @@ export declare const OrderSchema: z.ZodObject<{
|
|
|
1860
1860
|
emailOnInvoice: z.ZodOptional<z.ZodString>;
|
|
1861
1861
|
phoneNumberOnInvoice: z.ZodOptional<z.ZodString>;
|
|
1862
1862
|
clientComment: z.ZodOptional<z.ZodString>;
|
|
1863
|
+
companyName: z.ZodOptional<z.ZodString>;
|
|
1864
|
+
companyNumber: z.ZodOptional<z.ZodString>;
|
|
1865
|
+
contact: z.ZodOptional<z.ZodObject<{
|
|
1866
|
+
fullName: z.ZodOptional<z.ZodString>;
|
|
1867
|
+
role: z.ZodOptional<z.ZodString>;
|
|
1868
|
+
phone: z.ZodOptional<z.ZodString>;
|
|
1869
|
+
email: z.ZodOptional<z.ZodString>;
|
|
1870
|
+
}, "strip", z.ZodTypeAny, {
|
|
1871
|
+
email?: string | undefined;
|
|
1872
|
+
phone?: string | undefined;
|
|
1873
|
+
fullName?: string | undefined;
|
|
1874
|
+
role?: string | undefined;
|
|
1875
|
+
}, {
|
|
1876
|
+
email?: string | undefined;
|
|
1877
|
+
phone?: string | undefined;
|
|
1878
|
+
fullName?: string | undefined;
|
|
1879
|
+
role?: string | undefined;
|
|
1880
|
+
}>>;
|
|
1881
|
+
poNumber: z.ZodOptional<z.ZodString>;
|
|
1882
|
+
outOfStockPolicy: z.ZodOptional<z.ZodEnum<["substitute", "remove"]>>;
|
|
1863
1883
|
organizationId: z.ZodOptional<z.ZodString>;
|
|
1864
1884
|
billingAccount: z.ZodOptional<z.ZodObject<{
|
|
1865
1885
|
number: z.ZodString;
|
|
@@ -2498,6 +2518,7 @@ export declare const OrderSchema: z.ZodObject<{
|
|
|
2498
2518
|
deliveryPrice?: number | undefined;
|
|
2499
2519
|
};
|
|
2500
2520
|
deliveryDate: number;
|
|
2521
|
+
companyName?: string | undefined;
|
|
2501
2522
|
address?: {
|
|
2502
2523
|
country?: string | undefined;
|
|
2503
2524
|
city?: string | undefined;
|
|
@@ -2510,6 +2531,7 @@ export declare const OrderSchema: z.ZodObject<{
|
|
|
2510
2531
|
paymentType?: "none" | "external" | "j5" | undefined;
|
|
2511
2532
|
organizationId?: string | undefined;
|
|
2512
2533
|
nameOnInvoice?: string | undefined;
|
|
2534
|
+
companyNumber?: string | undefined;
|
|
2513
2535
|
createdBy?: "user" | "admin" | undefined;
|
|
2514
2536
|
storeOptions?: {
|
|
2515
2537
|
deliveryPrice?: number | undefined;
|
|
@@ -2548,6 +2570,14 @@ export declare const OrderSchema: z.ZodObject<{
|
|
|
2548
2570
|
emailOnInvoice?: string | undefined;
|
|
2549
2571
|
phoneNumberOnInvoice?: string | undefined;
|
|
2550
2572
|
clientComment?: string | undefined;
|
|
2573
|
+
contact?: {
|
|
2574
|
+
email?: string | undefined;
|
|
2575
|
+
phone?: string | undefined;
|
|
2576
|
+
fullName?: string | undefined;
|
|
2577
|
+
role?: string | undefined;
|
|
2578
|
+
} | undefined;
|
|
2579
|
+
poNumber?: string | undefined;
|
|
2580
|
+
outOfStockPolicy?: "substitute" | "remove" | undefined;
|
|
2551
2581
|
billingAccount?: {
|
|
2552
2582
|
number: string;
|
|
2553
2583
|
id: string;
|
|
@@ -2869,6 +2899,7 @@ export declare const OrderSchema: z.ZodObject<{
|
|
|
2869
2899
|
deliveryPrice?: number | undefined;
|
|
2870
2900
|
};
|
|
2871
2901
|
deliveryDate: number;
|
|
2902
|
+
companyName?: string | undefined;
|
|
2872
2903
|
address?: {
|
|
2873
2904
|
country?: string | undefined;
|
|
2874
2905
|
city?: string | undefined;
|
|
@@ -2881,6 +2912,7 @@ export declare const OrderSchema: z.ZodObject<{
|
|
|
2881
2912
|
paymentType?: "none" | "external" | "j5" | undefined;
|
|
2882
2913
|
organizationId?: string | undefined;
|
|
2883
2914
|
nameOnInvoice?: string | undefined;
|
|
2915
|
+
companyNumber?: string | undefined;
|
|
2884
2916
|
createdBy?: "user" | "admin" | undefined;
|
|
2885
2917
|
storeOptions?: {
|
|
2886
2918
|
deliveryPrice?: number | undefined;
|
|
@@ -2919,6 +2951,14 @@ export declare const OrderSchema: z.ZodObject<{
|
|
|
2919
2951
|
emailOnInvoice?: string | undefined;
|
|
2920
2952
|
phoneNumberOnInvoice?: string | undefined;
|
|
2921
2953
|
clientComment?: string | undefined;
|
|
2954
|
+
contact?: {
|
|
2955
|
+
email?: string | undefined;
|
|
2956
|
+
phone?: string | undefined;
|
|
2957
|
+
fullName?: string | undefined;
|
|
2958
|
+
role?: string | undefined;
|
|
2959
|
+
} | undefined;
|
|
2960
|
+
poNumber?: string | undefined;
|
|
2961
|
+
outOfStockPolicy?: "substitute" | "remove" | undefined;
|
|
2922
2962
|
billingAccount?: {
|
|
2923
2963
|
number: string;
|
|
2924
2964
|
id: 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.ts","sourceRoot":"","sources":["../../../lib/entities/Order.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,K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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkEtB,CAAC;AAEH,MAAM,MAAM,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC"}
|
|
@@ -57,6 +57,19 @@ export const OrderSchema = z.object({
|
|
|
57
57
|
emailOnInvoice: z.string().email().optional(),
|
|
58
58
|
phoneNumberOnInvoice: z.string().optional(),
|
|
59
59
|
clientComment: z.string().optional(),
|
|
60
|
+
// --- B2B buyer details (optional, additive — back-compat) ---
|
|
61
|
+
companyName: z.string().optional(),
|
|
62
|
+
companyNumber: z.string().optional(), // ח.פ / עוסק מורשה (aligns with Organization.companyNumber)
|
|
63
|
+
contact: z
|
|
64
|
+
.object({
|
|
65
|
+
fullName: z.string().optional(),
|
|
66
|
+
role: z.string().optional(), // תפקיד
|
|
67
|
+
phone: z.string().optional(),
|
|
68
|
+
email: z.string().optional(),
|
|
69
|
+
})
|
|
70
|
+
.optional(),
|
|
71
|
+
poNumber: z.string().optional(), // הזמנת רכש
|
|
72
|
+
outOfStockPolicy: z.enum(["substitute", "remove"]).optional(),
|
|
60
73
|
organizationId: z.string().optional(),
|
|
61
74
|
billingAccount: BillingAccountSchema.optional(),
|
|
62
75
|
deliveryNote: DeliveryNoteSchema.optional(),
|
|
@@ -2,6 +2,7 @@ import { z } from "zod";
|
|
|
2
2
|
export declare const SupplierInvoiceSchema: z.ZodObject<{
|
|
3
3
|
type: z.ZodLiteral<"SupplierInvoice">;
|
|
4
4
|
id: z.ZodString;
|
|
5
|
+
status: z.ZodOptional<z.ZodEnum<["draft", "completed"]>>;
|
|
5
6
|
supplier: z.ZodObject<{
|
|
6
7
|
type: z.ZodLiteral<"Supplier">;
|
|
7
8
|
id: z.ZodString;
|
|
@@ -150,6 +151,7 @@ export declare const SupplierInvoiceSchema: z.ZodObject<{
|
|
|
150
151
|
oldProfitPercentage: number;
|
|
151
152
|
newProfitPercentage: number;
|
|
152
153
|
}[];
|
|
154
|
+
status?: "draft" | "completed" | undefined;
|
|
153
155
|
vat?: number | undefined;
|
|
154
156
|
total?: number | undefined;
|
|
155
157
|
totalBeforeVat?: number | undefined;
|
|
@@ -192,6 +194,7 @@ export declare const SupplierInvoiceSchema: z.ZodObject<{
|
|
|
192
194
|
oldProfitPercentage: number;
|
|
193
195
|
newProfitPercentage: number;
|
|
194
196
|
}[];
|
|
197
|
+
status?: "draft" | "completed" | undefined;
|
|
195
198
|
vat?: number | undefined;
|
|
196
199
|
total?: number | undefined;
|
|
197
200
|
totalBeforeVat?: number | undefined;
|
|
@@ -199,6 +202,7 @@ export declare const SupplierInvoiceSchema: z.ZodObject<{
|
|
|
199
202
|
export declare const NewSupplierInvoiceSchema: z.ZodObject<Omit<{
|
|
200
203
|
type: z.ZodLiteral<"SupplierInvoice">;
|
|
201
204
|
id: z.ZodString;
|
|
205
|
+
status: z.ZodOptional<z.ZodEnum<["draft", "completed"]>>;
|
|
202
206
|
supplier: z.ZodObject<{
|
|
203
207
|
type: z.ZodLiteral<"Supplier">;
|
|
204
208
|
id: z.ZodString;
|
|
@@ -346,6 +350,7 @@ export declare const NewSupplierInvoiceSchema: z.ZodObject<Omit<{
|
|
|
346
350
|
oldProfitPercentage: number;
|
|
347
351
|
newProfitPercentage: number;
|
|
348
352
|
}[];
|
|
353
|
+
status?: "draft" | "completed" | undefined;
|
|
349
354
|
vat?: number | undefined;
|
|
350
355
|
total?: number | undefined;
|
|
351
356
|
totalBeforeVat?: number | undefined;
|
|
@@ -387,6 +392,7 @@ export declare const NewSupplierInvoiceSchema: z.ZodObject<Omit<{
|
|
|
387
392
|
oldProfitPercentage: number;
|
|
388
393
|
newProfitPercentage: number;
|
|
389
394
|
}[];
|
|
395
|
+
status?: "draft" | "completed" | undefined;
|
|
390
396
|
vat?: number | undefined;
|
|
391
397
|
total?: number | undefined;
|
|
392
398
|
totalBeforeVat?: number | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SupplierInvoice.d.ts","sourceRoot":"","sources":["../../../lib/entities/SupplierInvoice.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,qBAAqB
|
|
1
|
+
{"version":3,"file":"SupplierInvoice.d.ts","sourceRoot":"","sources":["../../../lib/entities/SupplierInvoice.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA+ChC,CAAC;AAEH,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAA2C,CAAC;AAEjF,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC"}
|
|
@@ -3,6 +3,10 @@ import { SupplierSchema } from "./Supplier";
|
|
|
3
3
|
export const SupplierInvoiceSchema = z.object({
|
|
4
4
|
type: z.literal("SupplierInvoice"),
|
|
5
5
|
id: z.string(),
|
|
6
|
+
// "draft" = work-in-progress, NOT yet finalized. Product prices are only
|
|
7
|
+
// updated once the invoice is finalized ("completed"). Legacy invoices have
|
|
8
|
+
// no status and are treated as finalized.
|
|
9
|
+
status: z.enum(["draft", "completed"]).optional(),
|
|
6
10
|
supplier: SupplierSchema,
|
|
7
11
|
invoiceNumber: z.string(),
|
|
8
12
|
date: z.number(),
|