@jsdev_ninja/core 0.12.10 → 0.13.13
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.js +1 -1
- package/dist/core.cjs.js.map +1 -1
- package/dist/core.es.js +93 -78
- 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/entities/Cart.d.ts +90 -90
- package/dist/entities/Discount/engine.d.ts.map +1 -1
- package/dist/entities/Discount/engine.js +15 -10
- package/dist/entities/Order.d.ts +82 -72
- package/dist/entities/Order.d.ts.map +1 -1
- package/dist/entities/Order.js +2 -1
- package/dist/entities/Organization.d.ts +34 -0
- package/dist/entities/Organization.d.ts.map +1 -0
- package/dist/entities/Organization.js +9 -0
- package/dist/entities/Product.d.ts +42 -42
- package/dist/entities/Product.js +3 -3
- package/dist/entities/Profile.d.ts +3 -0
- package/dist/entities/Profile.d.ts.map +1 -1
- package/dist/entities/Profile.js +4 -1
- package/dist/entities/Store.d.ts +2 -2
- package/dist/entities/index.d.ts +1 -0
- package/dist/entities/index.d.ts.map +1 -1
- package/dist/entities/index.js +1 -0
- package/dist/firebase-api/index.d.ts +3 -0
- package/dist/firebase-api/index.d.ts.map +1 -1
- package/dist/firebase-api/index.js +1 -0
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/utils/index.d.ts +8 -8
- package/dist/utils/index.js +3 -3
- package/lib/entities/Discount/engine.ts +134 -125
- package/lib/entities/Order.ts +1 -0
- package/lib/entities/Organization.ts +14 -0
- package/lib/entities/Product.ts +3 -3
- package/lib/entities/Profile.ts +1 -0
- package/lib/entities/index.ts +1 -0
- package/lib/firebase-api/index.ts +1 -0
- package/package.json +1 -1
package/dist/entities/Order.d.ts
CHANGED
|
@@ -111,7 +111,7 @@ export declare const OrderSchema: z.ZodObject<{
|
|
|
111
111
|
created_at: z.ZodNumber;
|
|
112
112
|
updated_at: z.ZodNumber;
|
|
113
113
|
categoryIds: z.ZodArray<z.ZodString, "many">;
|
|
114
|
-
categoryList: z.ZodArray<z.ZodType<{
|
|
114
|
+
categoryList: z.ZodOptional<z.ZodArray<z.ZodType<{
|
|
115
115
|
id: string;
|
|
116
116
|
companyId: string;
|
|
117
117
|
storeId: string;
|
|
@@ -159,8 +159,8 @@ export declare const OrderSchema: z.ZodObject<{
|
|
|
159
159
|
parentId?: string | null | undefined;
|
|
160
160
|
tag?: string | undefined;
|
|
161
161
|
} & /*elided*/ any)[];
|
|
162
|
-
}>, "many"
|
|
163
|
-
categories: z.ZodObject<{
|
|
162
|
+
}>, "many">>;
|
|
163
|
+
categories: z.ZodOptional<z.ZodObject<{
|
|
164
164
|
lvl0: z.ZodArray<z.ZodString, "many">;
|
|
165
165
|
lvl1: z.ZodArray<z.ZodString, "many">;
|
|
166
166
|
lvl2: z.ZodArray<z.ZodString, "many">;
|
|
@@ -178,8 +178,8 @@ export declare const OrderSchema: z.ZodObject<{
|
|
|
178
178
|
lvl2: string[];
|
|
179
179
|
lvl3: string[];
|
|
180
180
|
lvl4: string[];
|
|
181
|
-
}
|
|
182
|
-
categoryNames: z.ZodArray<z.ZodString, "many"
|
|
181
|
+
}>>;
|
|
182
|
+
categoryNames: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
183
183
|
}, "strip", z.ZodTypeAny, {
|
|
184
184
|
type: "Product";
|
|
185
185
|
id: string;
|
|
@@ -230,7 +230,10 @@ export declare const OrderSchema: z.ZodObject<{
|
|
|
230
230
|
created_at: number;
|
|
231
231
|
updated_at: number;
|
|
232
232
|
categoryIds: string[];
|
|
233
|
-
|
|
233
|
+
purchasePrice?: number | undefined;
|
|
234
|
+
profitPercentage?: number | undefined;
|
|
235
|
+
isDiscountable?: boolean | undefined;
|
|
236
|
+
categoryList?: ({
|
|
234
237
|
id: string;
|
|
235
238
|
companyId: string;
|
|
236
239
|
storeId: string;
|
|
@@ -254,18 +257,15 @@ export declare const OrderSchema: z.ZodObject<{
|
|
|
254
257
|
parentId?: string | null | undefined;
|
|
255
258
|
tag?: string | undefined;
|
|
256
259
|
} & /*elided*/ any)[];
|
|
257
|
-
})[];
|
|
258
|
-
categories
|
|
260
|
+
})[] | undefined;
|
|
261
|
+
categories?: {
|
|
259
262
|
lvl0: string[];
|
|
260
263
|
lvl1: string[];
|
|
261
264
|
lvl2: string[];
|
|
262
265
|
lvl3: string[];
|
|
263
266
|
lvl4: string[];
|
|
264
|
-
};
|
|
265
|
-
categoryNames
|
|
266
|
-
purchasePrice?: number | undefined;
|
|
267
|
-
profitPercentage?: number | undefined;
|
|
268
|
-
isDiscountable?: boolean | undefined;
|
|
267
|
+
} | undefined;
|
|
268
|
+
categoryNames?: string[] | undefined;
|
|
269
269
|
}, {
|
|
270
270
|
type: "Product";
|
|
271
271
|
id: string;
|
|
@@ -316,7 +316,10 @@ export declare const OrderSchema: z.ZodObject<{
|
|
|
316
316
|
created_at: number;
|
|
317
317
|
updated_at: number;
|
|
318
318
|
categoryIds: string[];
|
|
319
|
-
|
|
319
|
+
purchasePrice?: number | undefined;
|
|
320
|
+
profitPercentage?: number | undefined;
|
|
321
|
+
isDiscountable?: boolean | undefined;
|
|
322
|
+
categoryList?: ({
|
|
320
323
|
id: string;
|
|
321
324
|
companyId: string;
|
|
322
325
|
storeId: string;
|
|
@@ -340,18 +343,15 @@ export declare const OrderSchema: z.ZodObject<{
|
|
|
340
343
|
parentId?: string | null | undefined;
|
|
341
344
|
tag?: string | undefined;
|
|
342
345
|
} & /*elided*/ any)[];
|
|
343
|
-
})[];
|
|
344
|
-
categories
|
|
346
|
+
})[] | undefined;
|
|
347
|
+
categories?: {
|
|
345
348
|
lvl0: string[];
|
|
346
349
|
lvl1: string[];
|
|
347
350
|
lvl2: string[];
|
|
348
351
|
lvl3: string[];
|
|
349
352
|
lvl4: string[];
|
|
350
|
-
};
|
|
351
|
-
categoryNames
|
|
352
|
-
purchasePrice?: number | undefined;
|
|
353
|
-
profitPercentage?: number | undefined;
|
|
354
|
-
isDiscountable?: boolean | undefined;
|
|
353
|
+
} | undefined;
|
|
354
|
+
categoryNames?: string[] | undefined;
|
|
355
355
|
}>;
|
|
356
356
|
originalPrice: z.ZodOptional<z.ZodNumber>;
|
|
357
357
|
finalPrice: z.ZodOptional<z.ZodNumber>;
|
|
@@ -408,7 +408,10 @@ export declare const OrderSchema: z.ZodObject<{
|
|
|
408
408
|
created_at: number;
|
|
409
409
|
updated_at: number;
|
|
410
410
|
categoryIds: string[];
|
|
411
|
-
|
|
411
|
+
purchasePrice?: number | undefined;
|
|
412
|
+
profitPercentage?: number | undefined;
|
|
413
|
+
isDiscountable?: boolean | undefined;
|
|
414
|
+
categoryList?: ({
|
|
412
415
|
id: string;
|
|
413
416
|
companyId: string;
|
|
414
417
|
storeId: string;
|
|
@@ -432,18 +435,15 @@ export declare const OrderSchema: z.ZodObject<{
|
|
|
432
435
|
parentId?: string | null | undefined;
|
|
433
436
|
tag?: string | undefined;
|
|
434
437
|
} & /*elided*/ any)[];
|
|
435
|
-
})[];
|
|
436
|
-
categories
|
|
438
|
+
})[] | undefined;
|
|
439
|
+
categories?: {
|
|
437
440
|
lvl0: string[];
|
|
438
441
|
lvl1: string[];
|
|
439
442
|
lvl2: string[];
|
|
440
443
|
lvl3: string[];
|
|
441
444
|
lvl4: string[];
|
|
442
|
-
};
|
|
443
|
-
categoryNames
|
|
444
|
-
purchasePrice?: number | undefined;
|
|
445
|
-
profitPercentage?: number | undefined;
|
|
446
|
-
isDiscountable?: boolean | undefined;
|
|
445
|
+
} | undefined;
|
|
446
|
+
categoryNames?: string[] | undefined;
|
|
447
447
|
};
|
|
448
448
|
amount: number;
|
|
449
449
|
originalPrice?: number | undefined;
|
|
@@ -500,7 +500,10 @@ export declare const OrderSchema: z.ZodObject<{
|
|
|
500
500
|
created_at: number;
|
|
501
501
|
updated_at: number;
|
|
502
502
|
categoryIds: string[];
|
|
503
|
-
|
|
503
|
+
purchasePrice?: number | undefined;
|
|
504
|
+
profitPercentage?: number | undefined;
|
|
505
|
+
isDiscountable?: boolean | undefined;
|
|
506
|
+
categoryList?: ({
|
|
504
507
|
id: string;
|
|
505
508
|
companyId: string;
|
|
506
509
|
storeId: string;
|
|
@@ -524,18 +527,15 @@ export declare const OrderSchema: z.ZodObject<{
|
|
|
524
527
|
parentId?: string | null | undefined;
|
|
525
528
|
tag?: string | undefined;
|
|
526
529
|
} & /*elided*/ any)[];
|
|
527
|
-
})[];
|
|
528
|
-
categories
|
|
530
|
+
})[] | undefined;
|
|
531
|
+
categories?: {
|
|
529
532
|
lvl0: string[];
|
|
530
533
|
lvl1: string[];
|
|
531
534
|
lvl2: string[];
|
|
532
535
|
lvl3: string[];
|
|
533
536
|
lvl4: string[];
|
|
534
|
-
};
|
|
535
|
-
categoryNames
|
|
536
|
-
purchasePrice?: number | undefined;
|
|
537
|
-
profitPercentage?: number | undefined;
|
|
538
|
-
isDiscountable?: boolean | undefined;
|
|
537
|
+
} | undefined;
|
|
538
|
+
categoryNames?: string[] | undefined;
|
|
539
539
|
};
|
|
540
540
|
amount: number;
|
|
541
541
|
originalPrice?: number | undefined;
|
|
@@ -545,6 +545,7 @@ export declare const OrderSchema: z.ZodObject<{
|
|
|
545
545
|
cartDiscount: z.ZodNumber;
|
|
546
546
|
cartTotal: z.ZodNumber;
|
|
547
547
|
cartVat: z.ZodNumber;
|
|
548
|
+
deliveryPrice: z.ZodOptional<z.ZodNumber>;
|
|
548
549
|
}, "strip", z.ZodTypeAny, {
|
|
549
550
|
id: string;
|
|
550
551
|
items: {
|
|
@@ -598,7 +599,10 @@ export declare const OrderSchema: z.ZodObject<{
|
|
|
598
599
|
created_at: number;
|
|
599
600
|
updated_at: number;
|
|
600
601
|
categoryIds: string[];
|
|
601
|
-
|
|
602
|
+
purchasePrice?: number | undefined;
|
|
603
|
+
profitPercentage?: number | undefined;
|
|
604
|
+
isDiscountable?: boolean | undefined;
|
|
605
|
+
categoryList?: ({
|
|
602
606
|
id: string;
|
|
603
607
|
companyId: string;
|
|
604
608
|
storeId: string;
|
|
@@ -622,18 +626,15 @@ export declare const OrderSchema: z.ZodObject<{
|
|
|
622
626
|
parentId?: string | null | undefined;
|
|
623
627
|
tag?: string | undefined;
|
|
624
628
|
} & /*elided*/ any)[];
|
|
625
|
-
})[];
|
|
626
|
-
categories
|
|
629
|
+
})[] | undefined;
|
|
630
|
+
categories?: {
|
|
627
631
|
lvl0: string[];
|
|
628
632
|
lvl1: string[];
|
|
629
633
|
lvl2: string[];
|
|
630
634
|
lvl3: string[];
|
|
631
635
|
lvl4: string[];
|
|
632
|
-
};
|
|
633
|
-
categoryNames
|
|
634
|
-
purchasePrice?: number | undefined;
|
|
635
|
-
profitPercentage?: number | undefined;
|
|
636
|
-
isDiscountable?: boolean | undefined;
|
|
636
|
+
} | undefined;
|
|
637
|
+
categoryNames?: string[] | undefined;
|
|
637
638
|
};
|
|
638
639
|
amount: number;
|
|
639
640
|
originalPrice?: number | undefined;
|
|
@@ -643,6 +644,7 @@ export declare const OrderSchema: z.ZodObject<{
|
|
|
643
644
|
cartDiscount: number;
|
|
644
645
|
cartTotal: number;
|
|
645
646
|
cartVat: number;
|
|
647
|
+
deliveryPrice?: number | undefined;
|
|
646
648
|
}, {
|
|
647
649
|
id: string;
|
|
648
650
|
items: {
|
|
@@ -696,7 +698,10 @@ export declare const OrderSchema: z.ZodObject<{
|
|
|
696
698
|
created_at: number;
|
|
697
699
|
updated_at: number;
|
|
698
700
|
categoryIds: string[];
|
|
699
|
-
|
|
701
|
+
purchasePrice?: number | undefined;
|
|
702
|
+
profitPercentage?: number | undefined;
|
|
703
|
+
isDiscountable?: boolean | undefined;
|
|
704
|
+
categoryList?: ({
|
|
700
705
|
id: string;
|
|
701
706
|
companyId: string;
|
|
702
707
|
storeId: string;
|
|
@@ -720,18 +725,15 @@ export declare const OrderSchema: z.ZodObject<{
|
|
|
720
725
|
parentId?: string | null | undefined;
|
|
721
726
|
tag?: string | undefined;
|
|
722
727
|
} & /*elided*/ any)[];
|
|
723
|
-
})[];
|
|
724
|
-
categories
|
|
728
|
+
})[] | undefined;
|
|
729
|
+
categories?: {
|
|
725
730
|
lvl0: string[];
|
|
726
731
|
lvl1: string[];
|
|
727
732
|
lvl2: string[];
|
|
728
733
|
lvl3: string[];
|
|
729
734
|
lvl4: string[];
|
|
730
|
-
};
|
|
731
|
-
categoryNames
|
|
732
|
-
purchasePrice?: number | undefined;
|
|
733
|
-
profitPercentage?: number | undefined;
|
|
734
|
-
isDiscountable?: boolean | undefined;
|
|
735
|
+
} | undefined;
|
|
736
|
+
categoryNames?: string[] | undefined;
|
|
735
737
|
};
|
|
736
738
|
amount: number;
|
|
737
739
|
originalPrice?: number | undefined;
|
|
@@ -741,11 +743,12 @@ export declare const OrderSchema: z.ZodObject<{
|
|
|
741
743
|
cartDiscount: number;
|
|
742
744
|
cartTotal: number;
|
|
743
745
|
cartVat: number;
|
|
746
|
+
deliveryPrice?: number | undefined;
|
|
744
747
|
}>;
|
|
745
748
|
originalAmount: z.ZodOptional<z.ZodNumber>;
|
|
746
749
|
actualAmount: z.ZodOptional<z.ZodNumber>;
|
|
747
750
|
date: z.ZodNumber;
|
|
748
|
-
deliveryDate: z.
|
|
751
|
+
deliveryDate: z.ZodNumber;
|
|
749
752
|
client: z.ZodObject<{
|
|
750
753
|
type: z.ZodLiteral<"Profile">;
|
|
751
754
|
id: z.ZodString;
|
|
@@ -786,6 +789,7 @@ export declare const OrderSchema: z.ZodObject<{
|
|
|
786
789
|
createdDate: z.ZodNumber;
|
|
787
790
|
lastActivityDate: z.ZodNumber;
|
|
788
791
|
paymentType: z.ZodEnum<["default", "delayed"]>;
|
|
792
|
+
organizationId: z.ZodOptional<z.ZodString>;
|
|
789
793
|
}, "strip", z.ZodTypeAny, {
|
|
790
794
|
type: "Profile";
|
|
791
795
|
id: string;
|
|
@@ -810,6 +814,7 @@ export declare const OrderSchema: z.ZodObject<{
|
|
|
810
814
|
apartmentEnterNumber: string;
|
|
811
815
|
apartmentNumber: string;
|
|
812
816
|
} | undefined;
|
|
817
|
+
organizationId?: string | undefined;
|
|
813
818
|
}, {
|
|
814
819
|
type: "Profile";
|
|
815
820
|
id: string;
|
|
@@ -834,6 +839,7 @@ export declare const OrderSchema: z.ZodObject<{
|
|
|
834
839
|
apartmentEnterNumber: string;
|
|
835
840
|
apartmentNumber: string;
|
|
836
841
|
} | undefined;
|
|
842
|
+
organizationId?: string | undefined;
|
|
837
843
|
}>;
|
|
838
844
|
nameOnInvoice: z.ZodOptional<z.ZodString>;
|
|
839
845
|
clientComment: z.ZodOptional<z.ZodString>;
|
|
@@ -899,7 +905,10 @@ export declare const OrderSchema: z.ZodObject<{
|
|
|
899
905
|
created_at: number;
|
|
900
906
|
updated_at: number;
|
|
901
907
|
categoryIds: string[];
|
|
902
|
-
|
|
908
|
+
purchasePrice?: number | undefined;
|
|
909
|
+
profitPercentage?: number | undefined;
|
|
910
|
+
isDiscountable?: boolean | undefined;
|
|
911
|
+
categoryList?: ({
|
|
903
912
|
id: string;
|
|
904
913
|
companyId: string;
|
|
905
914
|
storeId: string;
|
|
@@ -923,18 +932,15 @@ export declare const OrderSchema: z.ZodObject<{
|
|
|
923
932
|
parentId?: string | null | undefined;
|
|
924
933
|
tag?: string | undefined;
|
|
925
934
|
} & /*elided*/ any)[];
|
|
926
|
-
})[];
|
|
927
|
-
categories
|
|
935
|
+
})[] | undefined;
|
|
936
|
+
categories?: {
|
|
928
937
|
lvl0: string[];
|
|
929
938
|
lvl1: string[];
|
|
930
939
|
lvl2: string[];
|
|
931
940
|
lvl3: string[];
|
|
932
941
|
lvl4: string[];
|
|
933
|
-
};
|
|
934
|
-
categoryNames
|
|
935
|
-
purchasePrice?: number | undefined;
|
|
936
|
-
profitPercentage?: number | undefined;
|
|
937
|
-
isDiscountable?: boolean | undefined;
|
|
942
|
+
} | undefined;
|
|
943
|
+
categoryNames?: string[] | undefined;
|
|
938
944
|
};
|
|
939
945
|
amount: number;
|
|
940
946
|
originalPrice?: number | undefined;
|
|
@@ -944,7 +950,9 @@ export declare const OrderSchema: z.ZodObject<{
|
|
|
944
950
|
cartDiscount: number;
|
|
945
951
|
cartTotal: number;
|
|
946
952
|
cartVat: number;
|
|
953
|
+
deliveryPrice?: number | undefined;
|
|
947
954
|
};
|
|
955
|
+
deliveryDate: number;
|
|
948
956
|
client: {
|
|
949
957
|
type: "Profile";
|
|
950
958
|
id: string;
|
|
@@ -969,10 +977,10 @@ export declare const OrderSchema: z.ZodObject<{
|
|
|
969
977
|
apartmentEnterNumber: string;
|
|
970
978
|
apartmentNumber: string;
|
|
971
979
|
} | undefined;
|
|
980
|
+
organizationId?: string | undefined;
|
|
972
981
|
};
|
|
973
982
|
originalAmount?: number | undefined;
|
|
974
983
|
actualAmount?: number | undefined;
|
|
975
|
-
deliveryDate?: number | undefined;
|
|
976
984
|
nameOnInvoice?: string | undefined;
|
|
977
985
|
clientComment?: string | undefined;
|
|
978
986
|
}, {
|
|
@@ -1037,7 +1045,10 @@ export declare const OrderSchema: z.ZodObject<{
|
|
|
1037
1045
|
created_at: number;
|
|
1038
1046
|
updated_at: number;
|
|
1039
1047
|
categoryIds: string[];
|
|
1040
|
-
|
|
1048
|
+
purchasePrice?: number | undefined;
|
|
1049
|
+
profitPercentage?: number | undefined;
|
|
1050
|
+
isDiscountable?: boolean | undefined;
|
|
1051
|
+
categoryList?: ({
|
|
1041
1052
|
id: string;
|
|
1042
1053
|
companyId: string;
|
|
1043
1054
|
storeId: string;
|
|
@@ -1061,18 +1072,15 @@ export declare const OrderSchema: z.ZodObject<{
|
|
|
1061
1072
|
parentId?: string | null | undefined;
|
|
1062
1073
|
tag?: string | undefined;
|
|
1063
1074
|
} & /*elided*/ any)[];
|
|
1064
|
-
})[];
|
|
1065
|
-
categories
|
|
1075
|
+
})[] | undefined;
|
|
1076
|
+
categories?: {
|
|
1066
1077
|
lvl0: string[];
|
|
1067
1078
|
lvl1: string[];
|
|
1068
1079
|
lvl2: string[];
|
|
1069
1080
|
lvl3: string[];
|
|
1070
1081
|
lvl4: string[];
|
|
1071
|
-
};
|
|
1072
|
-
categoryNames
|
|
1073
|
-
purchasePrice?: number | undefined;
|
|
1074
|
-
profitPercentage?: number | undefined;
|
|
1075
|
-
isDiscountable?: boolean | undefined;
|
|
1082
|
+
} | undefined;
|
|
1083
|
+
categoryNames?: string[] | undefined;
|
|
1076
1084
|
};
|
|
1077
1085
|
amount: number;
|
|
1078
1086
|
originalPrice?: number | undefined;
|
|
@@ -1082,7 +1090,9 @@ export declare const OrderSchema: z.ZodObject<{
|
|
|
1082
1090
|
cartDiscount: number;
|
|
1083
1091
|
cartTotal: number;
|
|
1084
1092
|
cartVat: number;
|
|
1093
|
+
deliveryPrice?: number | undefined;
|
|
1085
1094
|
};
|
|
1095
|
+
deliveryDate: number;
|
|
1086
1096
|
client: {
|
|
1087
1097
|
type: "Profile";
|
|
1088
1098
|
id: string;
|
|
@@ -1107,10 +1117,10 @@ export declare const OrderSchema: z.ZodObject<{
|
|
|
1107
1117
|
apartmentEnterNumber: string;
|
|
1108
1118
|
apartmentNumber: string;
|
|
1109
1119
|
} | undefined;
|
|
1120
|
+
organizationId?: string | undefined;
|
|
1110
1121
|
};
|
|
1111
1122
|
originalAmount?: number | undefined;
|
|
1112
1123
|
actualAmount?: number | undefined;
|
|
1113
|
-
deliveryDate?: number | undefined;
|
|
1114
1124
|
nameOnInvoice?: string | undefined;
|
|
1115
1125
|
clientComment?: string | undefined;
|
|
1116
1126
|
}>;
|
|
@@ -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;
|
|
1
|
+
{"version":3,"file":"Order.d.ts","sourceRoot":"","sources":["../../lib/entities/Order.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAaxB,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgCtB,CAAC;AAEH,MAAM,MAAM,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC"}
|
package/dist/entities/Order.js
CHANGED
|
@@ -31,11 +31,12 @@ export const OrderSchema = z.object({
|
|
|
31
31
|
cartDiscount: z.number(),
|
|
32
32
|
cartTotal: z.number(),
|
|
33
33
|
cartVat: z.number(),
|
|
34
|
+
deliveryPrice: z.number().optional(),
|
|
34
35
|
}),
|
|
35
36
|
originalAmount: z.number().positive().optional(), // what client pay
|
|
36
37
|
actualAmount: z.number().positive().optional(), // what store charge
|
|
37
38
|
date: z.number(),
|
|
38
|
-
deliveryDate: z.coerce.number()
|
|
39
|
+
deliveryDate: z.coerce.number(),
|
|
39
40
|
client: ProfileSchema.required({}),
|
|
40
41
|
nameOnInvoice: z.string().optional(),
|
|
41
42
|
clientComment: z.string().optional(),
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const OrganizationSchema: z.ZodObject<{
|
|
3
|
+
id: z.ZodString;
|
|
4
|
+
name: z.ZodString;
|
|
5
|
+
discountPercentage: z.ZodOptional<z.ZodNumber>;
|
|
6
|
+
nameOnInvoice: z.ZodOptional<z.ZodString>;
|
|
7
|
+
}, "strip", z.ZodTypeAny, {
|
|
8
|
+
id: string;
|
|
9
|
+
name: string;
|
|
10
|
+
nameOnInvoice?: string | undefined;
|
|
11
|
+
discountPercentage?: number | undefined;
|
|
12
|
+
}, {
|
|
13
|
+
id: string;
|
|
14
|
+
name: string;
|
|
15
|
+
nameOnInvoice?: string | undefined;
|
|
16
|
+
discountPercentage?: number | undefined;
|
|
17
|
+
}>;
|
|
18
|
+
export declare const NewOrganizationSchema: z.ZodObject<Omit<{
|
|
19
|
+
id: z.ZodString;
|
|
20
|
+
name: z.ZodString;
|
|
21
|
+
discountPercentage: z.ZodOptional<z.ZodNumber>;
|
|
22
|
+
nameOnInvoice: z.ZodOptional<z.ZodString>;
|
|
23
|
+
}, "id">, "strip", z.ZodTypeAny, {
|
|
24
|
+
name: string;
|
|
25
|
+
nameOnInvoice?: string | undefined;
|
|
26
|
+
discountPercentage?: number | undefined;
|
|
27
|
+
}, {
|
|
28
|
+
name: string;
|
|
29
|
+
nameOnInvoice?: string | undefined;
|
|
30
|
+
discountPercentage?: number | undefined;
|
|
31
|
+
}>;
|
|
32
|
+
export type TNewOrganization = z.infer<typeof NewOrganizationSchema>;
|
|
33
|
+
export type TOrganization = z.infer<typeof OrganizationSchema>;
|
|
34
|
+
//# sourceMappingURL=Organization.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Organization.d.ts","sourceRoot":"","sources":["../../lib/entities/Organization.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;EAK7B,CAAC;AAEH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;EAAwC,CAAC;AAE3E,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"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
// client organization for clients
|
|
3
|
+
export const OrganizationSchema = z.object({
|
|
4
|
+
id: z.string(),
|
|
5
|
+
name: z.string(),
|
|
6
|
+
discountPercentage: z.number().positive().min(0).max(100).optional(),
|
|
7
|
+
nameOnInvoice: z.string().optional(),
|
|
8
|
+
});
|
|
9
|
+
export const NewOrganizationSchema = OrganizationSchema.omit({ id: true });
|
|
@@ -100,7 +100,7 @@ export declare const ProductSchema: z.ZodObject<{
|
|
|
100
100
|
created_at: z.ZodNumber;
|
|
101
101
|
updated_at: z.ZodNumber;
|
|
102
102
|
categoryIds: z.ZodArray<z.ZodString, "many">;
|
|
103
|
-
categoryList: z.ZodArray<z.ZodType<{
|
|
103
|
+
categoryList: z.ZodOptional<z.ZodArray<z.ZodType<{
|
|
104
104
|
id: string;
|
|
105
105
|
companyId: string;
|
|
106
106
|
storeId: string;
|
|
@@ -148,8 +148,8 @@ export declare const ProductSchema: z.ZodObject<{
|
|
|
148
148
|
parentId?: string | null | undefined;
|
|
149
149
|
tag?: string | undefined;
|
|
150
150
|
} & /*elided*/ any)[];
|
|
151
|
-
}>, "many"
|
|
152
|
-
categories: z.ZodObject<{
|
|
151
|
+
}>, "many">>;
|
|
152
|
+
categories: z.ZodOptional<z.ZodObject<{
|
|
153
153
|
lvl0: z.ZodArray<z.ZodString, "many">;
|
|
154
154
|
lvl1: z.ZodArray<z.ZodString, "many">;
|
|
155
155
|
lvl2: z.ZodArray<z.ZodString, "many">;
|
|
@@ -167,8 +167,8 @@ export declare const ProductSchema: z.ZodObject<{
|
|
|
167
167
|
lvl2: string[];
|
|
168
168
|
lvl3: string[];
|
|
169
169
|
lvl4: string[];
|
|
170
|
-
}
|
|
171
|
-
categoryNames: z.ZodArray<z.ZodString, "many"
|
|
170
|
+
}>>;
|
|
171
|
+
categoryNames: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
172
172
|
}, "strip", z.ZodTypeAny, {
|
|
173
173
|
type: "Product";
|
|
174
174
|
id: string;
|
|
@@ -219,7 +219,10 @@ export declare const ProductSchema: z.ZodObject<{
|
|
|
219
219
|
created_at: number;
|
|
220
220
|
updated_at: number;
|
|
221
221
|
categoryIds: string[];
|
|
222
|
-
|
|
222
|
+
purchasePrice?: number | undefined;
|
|
223
|
+
profitPercentage?: number | undefined;
|
|
224
|
+
isDiscountable?: boolean | undefined;
|
|
225
|
+
categoryList?: ({
|
|
223
226
|
id: string;
|
|
224
227
|
companyId: string;
|
|
225
228
|
storeId: string;
|
|
@@ -243,18 +246,15 @@ export declare const ProductSchema: z.ZodObject<{
|
|
|
243
246
|
parentId?: string | null | undefined;
|
|
244
247
|
tag?: string | undefined;
|
|
245
248
|
} & /*elided*/ any)[];
|
|
246
|
-
})[];
|
|
247
|
-
categories
|
|
249
|
+
})[] | undefined;
|
|
250
|
+
categories?: {
|
|
248
251
|
lvl0: string[];
|
|
249
252
|
lvl1: string[];
|
|
250
253
|
lvl2: string[];
|
|
251
254
|
lvl3: string[];
|
|
252
255
|
lvl4: string[];
|
|
253
|
-
};
|
|
254
|
-
categoryNames
|
|
255
|
-
purchasePrice?: number | undefined;
|
|
256
|
-
profitPercentage?: number | undefined;
|
|
257
|
-
isDiscountable?: boolean | undefined;
|
|
256
|
+
} | undefined;
|
|
257
|
+
categoryNames?: string[] | undefined;
|
|
258
258
|
}, {
|
|
259
259
|
type: "Product";
|
|
260
260
|
id: string;
|
|
@@ -305,7 +305,10 @@ export declare const ProductSchema: z.ZodObject<{
|
|
|
305
305
|
created_at: number;
|
|
306
306
|
updated_at: number;
|
|
307
307
|
categoryIds: string[];
|
|
308
|
-
|
|
308
|
+
purchasePrice?: number | undefined;
|
|
309
|
+
profitPercentage?: number | undefined;
|
|
310
|
+
isDiscountable?: boolean | undefined;
|
|
311
|
+
categoryList?: ({
|
|
309
312
|
id: string;
|
|
310
313
|
companyId: string;
|
|
311
314
|
storeId: string;
|
|
@@ -329,18 +332,15 @@ export declare const ProductSchema: z.ZodObject<{
|
|
|
329
332
|
parentId?: string | null | undefined;
|
|
330
333
|
tag?: string | undefined;
|
|
331
334
|
} & /*elided*/ any)[];
|
|
332
|
-
})[];
|
|
333
|
-
categories
|
|
335
|
+
})[] | undefined;
|
|
336
|
+
categories?: {
|
|
334
337
|
lvl0: string[];
|
|
335
338
|
lvl1: string[];
|
|
336
339
|
lvl2: string[];
|
|
337
340
|
lvl3: string[];
|
|
338
341
|
lvl4: string[];
|
|
339
|
-
};
|
|
340
|
-
categoryNames
|
|
341
|
-
purchasePrice?: number | undefined;
|
|
342
|
-
profitPercentage?: number | undefined;
|
|
343
|
-
isDiscountable?: boolean | undefined;
|
|
342
|
+
} | undefined;
|
|
343
|
+
categoryNames?: string[] | undefined;
|
|
344
344
|
}>;
|
|
345
345
|
export type TProduct = z.infer<typeof ProductSchema>;
|
|
346
346
|
export declare const NewProductSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
@@ -444,7 +444,7 @@ export declare const NewProductSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
444
444
|
created_at: z.ZodNumber;
|
|
445
445
|
updated_at: z.ZodNumber;
|
|
446
446
|
categoryIds: z.ZodArray<z.ZodString, "many">;
|
|
447
|
-
categoryList: z.ZodArray<z.ZodType<{
|
|
447
|
+
categoryList: z.ZodOptional<z.ZodArray<z.ZodType<{
|
|
448
448
|
id: string;
|
|
449
449
|
companyId: string;
|
|
450
450
|
storeId: string;
|
|
@@ -492,8 +492,8 @@ export declare const NewProductSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
492
492
|
parentId?: string | null | undefined;
|
|
493
493
|
tag?: string | undefined;
|
|
494
494
|
} & /*elided*/ any)[];
|
|
495
|
-
}>, "many"
|
|
496
|
-
categories: z.ZodObject<{
|
|
495
|
+
}>, "many">>;
|
|
496
|
+
categories: z.ZodOptional<z.ZodObject<{
|
|
497
497
|
lvl0: z.ZodArray<z.ZodString, "many">;
|
|
498
498
|
lvl1: z.ZodArray<z.ZodString, "many">;
|
|
499
499
|
lvl2: z.ZodArray<z.ZodString, "many">;
|
|
@@ -511,8 +511,8 @@ export declare const NewProductSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
511
511
|
lvl2: string[];
|
|
512
512
|
lvl3: string[];
|
|
513
513
|
lvl4: string[];
|
|
514
|
-
}
|
|
515
|
-
categoryNames: z.ZodArray<z.ZodString, "many"
|
|
514
|
+
}>>;
|
|
515
|
+
categoryNames: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
516
516
|
}, {
|
|
517
517
|
image: z.ZodOptional<z.ZodType<File, z.ZodTypeDef, File>>;
|
|
518
518
|
}>, "strip", z.ZodTypeAny, {
|
|
@@ -565,7 +565,10 @@ export declare const NewProductSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
565
565
|
created_at: number;
|
|
566
566
|
updated_at: number;
|
|
567
567
|
categoryIds: string[];
|
|
568
|
-
|
|
568
|
+
purchasePrice?: number | undefined;
|
|
569
|
+
profitPercentage?: number | undefined;
|
|
570
|
+
isDiscountable?: boolean | undefined;
|
|
571
|
+
categoryList?: ({
|
|
569
572
|
id: string;
|
|
570
573
|
companyId: string;
|
|
571
574
|
storeId: string;
|
|
@@ -589,18 +592,15 @@ export declare const NewProductSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
589
592
|
parentId?: string | null | undefined;
|
|
590
593
|
tag?: string | undefined;
|
|
591
594
|
} & /*elided*/ any)[];
|
|
592
|
-
})[];
|
|
593
|
-
categories
|
|
595
|
+
})[] | undefined;
|
|
596
|
+
categories?: {
|
|
594
597
|
lvl0: string[];
|
|
595
598
|
lvl1: string[];
|
|
596
599
|
lvl2: string[];
|
|
597
600
|
lvl3: string[];
|
|
598
601
|
lvl4: string[];
|
|
599
|
-
};
|
|
600
|
-
categoryNames
|
|
601
|
-
purchasePrice?: number | undefined;
|
|
602
|
-
profitPercentage?: number | undefined;
|
|
603
|
-
isDiscountable?: boolean | undefined;
|
|
602
|
+
} | undefined;
|
|
603
|
+
categoryNames?: string[] | undefined;
|
|
604
604
|
image?: File | undefined;
|
|
605
605
|
}, {
|
|
606
606
|
type: "Product";
|
|
@@ -652,7 +652,10 @@ export declare const NewProductSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
652
652
|
created_at: number;
|
|
653
653
|
updated_at: number;
|
|
654
654
|
categoryIds: string[];
|
|
655
|
-
|
|
655
|
+
purchasePrice?: number | undefined;
|
|
656
|
+
profitPercentage?: number | undefined;
|
|
657
|
+
isDiscountable?: boolean | undefined;
|
|
658
|
+
categoryList?: ({
|
|
656
659
|
id: string;
|
|
657
660
|
companyId: string;
|
|
658
661
|
storeId: string;
|
|
@@ -676,18 +679,15 @@ export declare const NewProductSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
676
679
|
parentId?: string | null | undefined;
|
|
677
680
|
tag?: string | undefined;
|
|
678
681
|
} & /*elided*/ any)[];
|
|
679
|
-
})[];
|
|
680
|
-
categories
|
|
682
|
+
})[] | undefined;
|
|
683
|
+
categories?: {
|
|
681
684
|
lvl0: string[];
|
|
682
685
|
lvl1: string[];
|
|
683
686
|
lvl2: string[];
|
|
684
687
|
lvl3: string[];
|
|
685
688
|
lvl4: string[];
|
|
686
|
-
};
|
|
687
|
-
categoryNames
|
|
688
|
-
purchasePrice?: number | undefined;
|
|
689
|
-
profitPercentage?: number | undefined;
|
|
690
|
-
isDiscountable?: boolean | undefined;
|
|
689
|
+
} | undefined;
|
|
690
|
+
categoryNames?: string[] | undefined;
|
|
691
691
|
image?: File | undefined;
|
|
692
692
|
}>;
|
|
693
693
|
export type TNewProduct = z.infer<typeof NewProductSchema>;
|