@jsdev_ninja/core 0.13.24 → 0.13.25

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.
@@ -746,6 +746,20 @@ export declare const OrderSchema: z.ZodObject<{
746
746
  cartVat: number;
747
747
  deliveryPrice?: number | undefined;
748
748
  }>;
749
+ storeOptions: z.ZodOptional<z.ZodObject<{
750
+ deliveryPrice: z.ZodOptional<z.ZodNumber>;
751
+ freeDeliveryPrice: z.ZodOptional<z.ZodNumber>;
752
+ isVatIncludedInPrice: z.ZodOptional<z.ZodBoolean>;
753
+ }, "strip", z.ZodTypeAny, {
754
+ deliveryPrice?: number | undefined;
755
+ freeDeliveryPrice?: number | undefined;
756
+ isVatIncludedInPrice?: boolean | undefined;
757
+ }, {
758
+ deliveryPrice?: number | undefined;
759
+ freeDeliveryPrice?: number | undefined;
760
+ isVatIncludedInPrice?: boolean | undefined;
761
+ }>>;
762
+ orderDeliveryPrice: z.ZodOptional<z.ZodNumber>;
749
763
  originalAmount: z.ZodOptional<z.ZodNumber>;
750
764
  actualAmount: z.ZodOptional<z.ZodNumber>;
751
765
  date: z.ZodNumber;
@@ -844,7 +858,245 @@ export declare const OrderSchema: z.ZodObject<{
844
858
  }>;
845
859
  nameOnInvoice: z.ZodOptional<z.ZodString>;
846
860
  clientComment: z.ZodOptional<z.ZodString>;
861
+ organizationId: z.ZodOptional<z.ZodString>;
862
+ billingAccount: z.ZodOptional<z.ZodObject<{
863
+ number: z.ZodString;
864
+ name: z.ZodString;
865
+ id: z.ZodString;
866
+ }, "strip", z.ZodTypeAny, {
867
+ number: string;
868
+ id: string;
869
+ name: string;
870
+ }, {
871
+ number: string;
872
+ id: string;
873
+ name: string;
874
+ }>>;
847
875
  deliveryNote: z.ZodOptional<z.ZodObject<{
876
+ id: z.ZodString;
877
+ number: z.ZodString;
878
+ date: z.ZodNumber;
879
+ createdAt: z.ZodNumber;
880
+ status: z.ZodEnum<["pending", "paid", "cancelled"]>;
881
+ companyDetails: z.ZodOptional<z.ZodObject<{
882
+ name: z.ZodOptional<z.ZodString>;
883
+ address: z.ZodOptional<z.ZodString>;
884
+ phone: z.ZodOptional<z.ZodString>;
885
+ email: z.ZodOptional<z.ZodString>;
886
+ }, "strip", z.ZodTypeAny, {
887
+ name?: string | undefined;
888
+ email?: string | undefined;
889
+ address?: string | undefined;
890
+ phone?: string | undefined;
891
+ }, {
892
+ name?: string | undefined;
893
+ email?: string | undefined;
894
+ address?: string | undefined;
895
+ phone?: string | undefined;
896
+ }>>;
897
+ clientDetails: z.ZodOptional<z.ZodObject<{
898
+ name: z.ZodOptional<z.ZodString>;
899
+ address: z.ZodOptional<z.ZodString>;
900
+ phone: z.ZodOptional<z.ZodString>;
901
+ email: z.ZodOptional<z.ZodString>;
902
+ }, "strip", z.ZodTypeAny, {
903
+ name?: string | undefined;
904
+ email?: string | undefined;
905
+ address?: string | undefined;
906
+ phone?: string | undefined;
907
+ }, {
908
+ name?: string | undefined;
909
+ email?: string | undefined;
910
+ address?: string | undefined;
911
+ phone?: string | undefined;
912
+ }>>;
913
+ items: z.ZodOptional<z.ZodArray<z.ZodObject<{
914
+ name: z.ZodOptional<z.ZodString>;
915
+ price: z.ZodOptional<z.ZodNumber>;
916
+ quantity: z.ZodOptional<z.ZodNumber>;
917
+ total: z.ZodOptional<z.ZodNumber>;
918
+ }, "strip", z.ZodTypeAny, {
919
+ name?: string | undefined;
920
+ price?: number | undefined;
921
+ quantity?: number | undefined;
922
+ total?: number | undefined;
923
+ }, {
924
+ name?: string | undefined;
925
+ price?: number | undefined;
926
+ quantity?: number | undefined;
927
+ total?: number | undefined;
928
+ }>, "many">>;
929
+ total: z.ZodOptional<z.ZodNumber>;
930
+ vat: z.ZodOptional<z.ZodNumber>;
931
+ link: z.ZodOptional<z.ZodString>;
932
+ }, "strip", z.ZodTypeAny, {
933
+ number: string;
934
+ status: "pending" | "paid" | "cancelled";
935
+ id: string;
936
+ date: number;
937
+ createdAt: number;
938
+ vat?: number | undefined;
939
+ items?: {
940
+ name?: string | undefined;
941
+ price?: number | undefined;
942
+ quantity?: number | undefined;
943
+ total?: number | undefined;
944
+ }[] | undefined;
945
+ companyDetails?: {
946
+ name?: string | undefined;
947
+ email?: string | undefined;
948
+ address?: string | undefined;
949
+ phone?: string | undefined;
950
+ } | undefined;
951
+ clientDetails?: {
952
+ name?: string | undefined;
953
+ email?: string | undefined;
954
+ address?: string | undefined;
955
+ phone?: string | undefined;
956
+ } | undefined;
957
+ total?: number | undefined;
958
+ link?: string | undefined;
959
+ }, {
960
+ number: string;
961
+ status: "pending" | "paid" | "cancelled";
962
+ id: string;
963
+ date: number;
964
+ createdAt: number;
965
+ vat?: number | undefined;
966
+ items?: {
967
+ name?: string | undefined;
968
+ price?: number | undefined;
969
+ quantity?: number | undefined;
970
+ total?: number | undefined;
971
+ }[] | undefined;
972
+ companyDetails?: {
973
+ name?: string | undefined;
974
+ email?: string | undefined;
975
+ address?: string | undefined;
976
+ phone?: string | undefined;
977
+ } | undefined;
978
+ clientDetails?: {
979
+ name?: string | undefined;
980
+ email?: string | undefined;
981
+ address?: string | undefined;
982
+ phone?: string | undefined;
983
+ } | undefined;
984
+ total?: number | undefined;
985
+ link?: string | undefined;
986
+ }>>;
987
+ invoice: z.ZodOptional<z.ZodObject<{
988
+ id: z.ZodString;
989
+ number: z.ZodString;
990
+ date: z.ZodString;
991
+ createdAt: z.ZodNumber;
992
+ status: z.ZodEnum<["pending", "paid", "cancelled"]>;
993
+ companyDetails: z.ZodOptional<z.ZodObject<{
994
+ name: z.ZodOptional<z.ZodString>;
995
+ address: z.ZodOptional<z.ZodString>;
996
+ phone: z.ZodOptional<z.ZodString>;
997
+ email: z.ZodOptional<z.ZodString>;
998
+ }, "strip", z.ZodTypeAny, {
999
+ name?: string | undefined;
1000
+ email?: string | undefined;
1001
+ address?: string | undefined;
1002
+ phone?: string | undefined;
1003
+ }, {
1004
+ name?: string | undefined;
1005
+ email?: string | undefined;
1006
+ address?: string | undefined;
1007
+ phone?: string | undefined;
1008
+ }>>;
1009
+ clientDetails: z.ZodOptional<z.ZodObject<{
1010
+ name: z.ZodOptional<z.ZodString>;
1011
+ address: z.ZodOptional<z.ZodString>;
1012
+ phone: z.ZodOptional<z.ZodString>;
1013
+ email: z.ZodOptional<z.ZodString>;
1014
+ }, "strip", z.ZodTypeAny, {
1015
+ name?: string | undefined;
1016
+ email?: string | undefined;
1017
+ address?: string | undefined;
1018
+ phone?: string | undefined;
1019
+ }, {
1020
+ name?: string | undefined;
1021
+ email?: string | undefined;
1022
+ address?: string | undefined;
1023
+ phone?: string | undefined;
1024
+ }>>;
1025
+ items: z.ZodOptional<z.ZodArray<z.ZodObject<{
1026
+ name: z.ZodOptional<z.ZodString>;
1027
+ price: z.ZodOptional<z.ZodNumber>;
1028
+ quantity: z.ZodOptional<z.ZodNumber>;
1029
+ total: z.ZodOptional<z.ZodNumber>;
1030
+ }, "strip", z.ZodTypeAny, {
1031
+ name?: string | undefined;
1032
+ price?: number | undefined;
1033
+ quantity?: number | undefined;
1034
+ total?: number | undefined;
1035
+ }, {
1036
+ name?: string | undefined;
1037
+ price?: number | undefined;
1038
+ quantity?: number | undefined;
1039
+ total?: number | undefined;
1040
+ }>, "many">>;
1041
+ total: z.ZodOptional<z.ZodNumber>;
1042
+ vat: z.ZodOptional<z.ZodNumber>;
1043
+ link: z.ZodOptional<z.ZodString>;
1044
+ }, "strip", z.ZodTypeAny, {
1045
+ number: string;
1046
+ status: "pending" | "paid" | "cancelled";
1047
+ id: string;
1048
+ date: string;
1049
+ createdAt: number;
1050
+ vat?: number | undefined;
1051
+ items?: {
1052
+ name?: string | undefined;
1053
+ price?: number | undefined;
1054
+ quantity?: number | undefined;
1055
+ total?: number | undefined;
1056
+ }[] | undefined;
1057
+ companyDetails?: {
1058
+ name?: string | undefined;
1059
+ email?: string | undefined;
1060
+ address?: string | undefined;
1061
+ phone?: string | undefined;
1062
+ } | undefined;
1063
+ clientDetails?: {
1064
+ name?: string | undefined;
1065
+ email?: string | undefined;
1066
+ address?: string | undefined;
1067
+ phone?: string | undefined;
1068
+ } | undefined;
1069
+ total?: number | undefined;
1070
+ link?: string | undefined;
1071
+ }, {
1072
+ number: string;
1073
+ status: "pending" | "paid" | "cancelled";
1074
+ id: string;
1075
+ date: string;
1076
+ createdAt: number;
1077
+ vat?: number | undefined;
1078
+ items?: {
1079
+ name?: string | undefined;
1080
+ price?: number | undefined;
1081
+ quantity?: number | undefined;
1082
+ total?: number | undefined;
1083
+ }[] | undefined;
1084
+ companyDetails?: {
1085
+ name?: string | undefined;
1086
+ email?: string | undefined;
1087
+ address?: string | undefined;
1088
+ phone?: string | undefined;
1089
+ } | undefined;
1090
+ clientDetails?: {
1091
+ name?: string | undefined;
1092
+ email?: string | undefined;
1093
+ address?: string | undefined;
1094
+ phone?: string | undefined;
1095
+ } | undefined;
1096
+ total?: number | undefined;
1097
+ link?: string | undefined;
1098
+ }>>;
1099
+ ezInvoice: z.ZodOptional<z.ZodObject<{
848
1100
  doc_uuid: z.ZodString;
849
1101
  pdf_link: z.ZodString;
850
1102
  pdf_link_copy: z.ZodString;
@@ -938,7 +1190,7 @@ export declare const OrderSchema: z.ZodObject<{
938
1190
  date?: number | undefined;
939
1191
  warning?: string | undefined;
940
1192
  }>>;
941
- invoice: z.ZodOptional<z.ZodObject<{
1193
+ ezDeliveryNote: z.ZodOptional<z.ZodObject<{
942
1194
  doc_uuid: z.ZodString;
943
1195
  pdf_link: z.ZodString;
944
1196
  pdf_link_copy: z.ZodString;
@@ -1032,23 +1284,9 @@ export declare const OrderSchema: z.ZodObject<{
1032
1284
  date?: number | undefined;
1033
1285
  warning?: string | undefined;
1034
1286
  }>>;
1035
- organizationId: z.ZodOptional<z.ZodString>;
1036
- billingAccount: z.ZodOptional<z.ZodObject<{
1037
- number: z.ZodString;
1038
- name: z.ZodString;
1039
- id: z.ZodString;
1040
- }, "strip", z.ZodTypeAny, {
1041
- number: string;
1042
- id: string;
1043
- name: string;
1044
- }, {
1045
- number: string;
1046
- id: string;
1047
- name: string;
1048
- }>>;
1049
1287
  }, "strip", z.ZodTypeAny, {
1050
1288
  type: "Order";
1051
- status: "draft" | "completed" | "pending" | "processing" | "in_delivery" | "delivered" | "cancelled" | "refunded";
1289
+ status: "draft" | "completed" | "pending" | "cancelled" | "processing" | "in_delivery" | "delivered" | "refunded";
1052
1290
  id: string;
1053
1291
  date: number;
1054
1292
  companyId: string;
@@ -1185,10 +1423,77 @@ export declare const OrderSchema: z.ZodObject<{
1185
1423
  paymentType?: "internal" | "external" | undefined;
1186
1424
  organizationId?: string | undefined;
1187
1425
  nameOnInvoice?: string | undefined;
1426
+ storeOptions?: {
1427
+ deliveryPrice?: number | undefined;
1428
+ freeDeliveryPrice?: number | undefined;
1429
+ isVatIncludedInPrice?: boolean | undefined;
1430
+ } | undefined;
1431
+ orderDeliveryPrice?: number | undefined;
1188
1432
  originalAmount?: number | undefined;
1189
1433
  actualAmount?: number | undefined;
1190
1434
  clientComment?: string | undefined;
1435
+ billingAccount?: {
1436
+ number: string;
1437
+ id: string;
1438
+ name: string;
1439
+ } | undefined;
1191
1440
  deliveryNote?: {
1441
+ number: string;
1442
+ status: "pending" | "paid" | "cancelled";
1443
+ id: string;
1444
+ date: number;
1445
+ createdAt: number;
1446
+ vat?: number | undefined;
1447
+ items?: {
1448
+ name?: string | undefined;
1449
+ price?: number | undefined;
1450
+ quantity?: number | undefined;
1451
+ total?: number | undefined;
1452
+ }[] | undefined;
1453
+ companyDetails?: {
1454
+ name?: string | undefined;
1455
+ email?: string | undefined;
1456
+ address?: string | undefined;
1457
+ phone?: string | undefined;
1458
+ } | undefined;
1459
+ clientDetails?: {
1460
+ name?: string | undefined;
1461
+ email?: string | undefined;
1462
+ address?: string | undefined;
1463
+ phone?: string | undefined;
1464
+ } | undefined;
1465
+ total?: number | undefined;
1466
+ link?: string | undefined;
1467
+ } | undefined;
1468
+ invoice?: {
1469
+ number: string;
1470
+ status: "pending" | "paid" | "cancelled";
1471
+ id: string;
1472
+ date: string;
1473
+ createdAt: number;
1474
+ vat?: number | undefined;
1475
+ items?: {
1476
+ name?: string | undefined;
1477
+ price?: number | undefined;
1478
+ quantity?: number | undefined;
1479
+ total?: number | undefined;
1480
+ }[] | undefined;
1481
+ companyDetails?: {
1482
+ name?: string | undefined;
1483
+ email?: string | undefined;
1484
+ address?: string | undefined;
1485
+ phone?: string | undefined;
1486
+ } | undefined;
1487
+ clientDetails?: {
1488
+ name?: string | undefined;
1489
+ email?: string | undefined;
1490
+ address?: string | undefined;
1491
+ phone?: string | undefined;
1492
+ } | undefined;
1493
+ total?: number | undefined;
1494
+ link?: string | undefined;
1495
+ } | undefined;
1496
+ ezInvoice?: {
1192
1497
  doc_uuid: string;
1193
1498
  pdf_link: string;
1194
1499
  pdf_link_copy: string;
@@ -1212,7 +1517,7 @@ export declare const OrderSchema: z.ZodObject<{
1212
1517
  date?: number | undefined;
1213
1518
  warning?: string | undefined;
1214
1519
  } | undefined;
1215
- invoice?: {
1520
+ ezDeliveryNote?: {
1216
1521
  doc_uuid: string;
1217
1522
  pdf_link: string;
1218
1523
  pdf_link_copy: string;
@@ -1236,14 +1541,9 @@ export declare const OrderSchema: z.ZodObject<{
1236
1541
  date?: number | undefined;
1237
1542
  warning?: string | undefined;
1238
1543
  } | undefined;
1239
- billingAccount?: {
1240
- number: string;
1241
- id: string;
1242
- name: string;
1243
- } | undefined;
1244
1544
  }, {
1245
1545
  type: "Order";
1246
- status: "draft" | "completed" | "pending" | "processing" | "in_delivery" | "delivered" | "cancelled" | "refunded";
1546
+ status: "draft" | "completed" | "pending" | "cancelled" | "processing" | "in_delivery" | "delivered" | "refunded";
1247
1547
  id: string;
1248
1548
  date: number;
1249
1549
  companyId: string;
@@ -1380,10 +1680,77 @@ export declare const OrderSchema: z.ZodObject<{
1380
1680
  paymentType?: "internal" | "external" | undefined;
1381
1681
  organizationId?: string | undefined;
1382
1682
  nameOnInvoice?: string | undefined;
1683
+ storeOptions?: {
1684
+ deliveryPrice?: number | undefined;
1685
+ freeDeliveryPrice?: number | undefined;
1686
+ isVatIncludedInPrice?: boolean | undefined;
1687
+ } | undefined;
1688
+ orderDeliveryPrice?: number | undefined;
1383
1689
  originalAmount?: number | undefined;
1384
1690
  actualAmount?: number | undefined;
1385
1691
  clientComment?: string | undefined;
1692
+ billingAccount?: {
1693
+ number: string;
1694
+ id: string;
1695
+ name: string;
1696
+ } | undefined;
1386
1697
  deliveryNote?: {
1698
+ number: string;
1699
+ status: "pending" | "paid" | "cancelled";
1700
+ id: string;
1701
+ date: number;
1702
+ createdAt: number;
1703
+ vat?: number | undefined;
1704
+ items?: {
1705
+ name?: string | undefined;
1706
+ price?: number | undefined;
1707
+ quantity?: number | undefined;
1708
+ total?: number | undefined;
1709
+ }[] | undefined;
1710
+ companyDetails?: {
1711
+ name?: string | undefined;
1712
+ email?: string | undefined;
1713
+ address?: string | undefined;
1714
+ phone?: string | undefined;
1715
+ } | undefined;
1716
+ clientDetails?: {
1717
+ name?: string | undefined;
1718
+ email?: string | undefined;
1719
+ address?: string | undefined;
1720
+ phone?: string | undefined;
1721
+ } | undefined;
1722
+ total?: number | undefined;
1723
+ link?: string | undefined;
1724
+ } | undefined;
1725
+ invoice?: {
1726
+ number: string;
1727
+ status: "pending" | "paid" | "cancelled";
1728
+ id: string;
1729
+ date: string;
1730
+ createdAt: number;
1731
+ vat?: number | undefined;
1732
+ items?: {
1733
+ name?: string | undefined;
1734
+ price?: number | undefined;
1735
+ quantity?: number | undefined;
1736
+ total?: number | undefined;
1737
+ }[] | undefined;
1738
+ companyDetails?: {
1739
+ name?: string | undefined;
1740
+ email?: string | undefined;
1741
+ address?: string | undefined;
1742
+ phone?: string | undefined;
1743
+ } | undefined;
1744
+ clientDetails?: {
1745
+ name?: string | undefined;
1746
+ email?: string | undefined;
1747
+ address?: string | undefined;
1748
+ phone?: string | undefined;
1749
+ } | undefined;
1750
+ total?: number | undefined;
1751
+ link?: string | undefined;
1752
+ } | undefined;
1753
+ ezInvoice?: {
1387
1754
  doc_uuid: string;
1388
1755
  pdf_link: string;
1389
1756
  pdf_link_copy: string;
@@ -1407,7 +1774,7 @@ export declare const OrderSchema: z.ZodObject<{
1407
1774
  date?: number | undefined;
1408
1775
  warning?: string | undefined;
1409
1776
  } | undefined;
1410
- invoice?: {
1777
+ ezDeliveryNote?: {
1411
1778
  doc_uuid: string;
1412
1779
  pdf_link: string;
1413
1780
  pdf_link_copy: string;
@@ -1431,11 +1798,6 @@ export declare const OrderSchema: z.ZodObject<{
1431
1798
  date?: number | undefined;
1432
1799
  warning?: string | undefined;
1433
1800
  } | undefined;
1434
- billingAccount?: {
1435
- number: string;
1436
- id: string;
1437
- name: string;
1438
- } | undefined;
1439
1801
  }>;
1440
1802
  export type TOrder = z.infer<typeof OrderSchema>;
1441
1803
  //# sourceMappingURL=Order.d.ts.map
@@ -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;AAgBxB,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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2,9 +2,9 @@ import { z } from "zod";
2
2
  import { ProfileSchema } from "./Profile";
3
3
  import { notEmptyTextSchema } from "./Atoms";
4
4
  import { CartItemProductSchema } from "./Cart";
5
- import { DeliveryNoteSchema } from "./DeliveryNote";
5
+ import { DeliveryNoteSchema, EzDeliveryNoteSchema } from "./DeliveryNote";
6
6
  import { BillingAccountSchema } from "./Organization";
7
- import { InvoiceSchema } from "./Invoice";
7
+ import { EzInvoiceSchema, InvoiceSchema } from "./Invoice";
8
8
  // pending - order created / by user
9
9
  // processing order accepted by store by admin
10
10
  // delivered - order delivered by admin
@@ -35,8 +35,16 @@ export const OrderSchema = z.object({
35
35
  cartDiscount: z.number(),
36
36
  cartTotal: z.number(),
37
37
  cartVat: z.number(),
38
- deliveryPrice: z.number().optional(),
38
+ deliveryPrice: z.number().optional(), // final delivery price for cart
39
39
  }),
40
+ storeOptions: z
41
+ .object({
42
+ deliveryPrice: z.number().optional(),
43
+ freeDeliveryPrice: z.number().optional(),
44
+ isVatIncludedInPrice: z.boolean().optional(),
45
+ })
46
+ .optional(),
47
+ orderDeliveryPrice: z.number().optional(), // delivery price for order
40
48
  originalAmount: z.number().positive().optional(), // what client pay
41
49
  actualAmount: z.number().positive().optional(), // what store charge
42
50
  date: z.number(),
@@ -44,8 +52,10 @@ export const OrderSchema = z.object({
44
52
  client: ProfileSchema.required({}),
45
53
  nameOnInvoice: z.string().optional(),
46
54
  clientComment: z.string().optional(),
47
- deliveryNote: DeliveryNoteSchema.optional(),
48
- invoice: InvoiceSchema.optional(),
49
55
  organizationId: z.string().optional(),
50
56
  billingAccount: BillingAccountSchema.optional(),
57
+ deliveryNote: DeliveryNoteSchema.optional(),
58
+ invoice: InvoiceSchema.optional(),
59
+ ezInvoice: EzInvoiceSchema.optional(),
60
+ ezDeliveryNote: EzDeliveryNoteSchema.optional(),
51
61
  });
@@ -20,28 +20,28 @@ export declare const StoreSchema: z.ZodObject<{
20
20
  name: string;
21
21
  tenantId: string;
22
22
  paymentType: "external" | "j5";
23
+ isVatIncludedInPrice: boolean;
23
24
  urls: string[];
24
25
  logoUrl: string;
25
26
  allowAnonymousClients: boolean;
26
- isVatIncludedInPrice: boolean;
27
27
  clientTypes: ("company" | "individual")[];
28
28
  deliveryPrice?: number | undefined;
29
- minimumOrder?: number | undefined;
30
29
  freeDeliveryPrice?: number | undefined;
30
+ minimumOrder?: number | undefined;
31
31
  }, {
32
32
  id: string;
33
33
  companyId: string;
34
34
  name: string;
35
35
  tenantId: string;
36
36
  paymentType: "external" | "j5";
37
+ isVatIncludedInPrice: boolean;
37
38
  urls: string[];
38
39
  logoUrl: string;
39
40
  allowAnonymousClients: boolean;
40
- isVatIncludedInPrice: boolean;
41
41
  clientTypes: ("company" | "individual")[];
42
42
  deliveryPrice?: number | undefined;
43
- minimumOrder?: number | undefined;
44
43
  freeDeliveryPrice?: number | undefined;
44
+ minimumOrder?: number | undefined;
45
45
  }>;
46
46
  export type TStore = z.infer<typeof StoreSchema>;
47
47
  //# sourceMappingURL=Store.d.ts.map
@@ -19,11 +19,11 @@ export const storeCollections = {
19
19
  export const FirestoreApi = {
20
20
  systemCollections,
21
21
  storeCollections,
22
- // for client
22
+ // for client and server
23
23
  getPath: ({ companyId, storeId, collectionName, id, }) => {
24
24
  return `${companyId}/${storeId}/${collectionName}${id ? `/${id}` : ""}`;
25
25
  },
26
- // for backend
26
+ // for firestore events
27
27
  getDocPath: (collectionName) => {
28
28
  return `{companyId}/{storeId}/${collectionName}/{id}`;
29
29
  },
@@ -1,8 +1,10 @@
1
- import { TCart, TDiscount, TStore } from "../entities";
2
- export declare function getCartCost({ cart, discounts, store, }: {
1
+ import { TCart, TDiscount } from "../entities";
2
+ export declare function getCartCost({ cart, discounts, deliveryPrice, freeDeliveryPrice, isVatIncludedInPrice, }: {
3
3
  cart: TCart["items"];
4
4
  discounts: TDiscount[];
5
- store: TStore;
5
+ deliveryPrice?: number;
6
+ freeDeliveryPrice?: number;
7
+ isVatIncludedInPrice?: boolean;
6
8
  }): {
7
9
  discount: number;
8
10
  cost: number;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../lib/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,SAAS,EAAY,MAAM,EAAE,MAAM,aAAa,CAAC;AA8BjE,wBAAgB,WAAW,CAAC,EAC3B,IAAI,EACJ,SAAS,EACT,KAAK,GACL,EAAE;IACF,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;IACrB,SAAS,EAAE,SAAS,EAAE,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;CACd;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAsFA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../lib/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,SAAS,EAAoB,MAAM,aAAa,CAAC;AA8BjE,wBAAgB,WAAW,CAAC,EAC3B,IAAI,EACJ,SAAS,EACT,aAAiB,EACjB,iBAAqB,EACrB,oBAA4B,GAC5B,EAAE;IACF,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;IACrB,SAAS,EAAE,SAAS,EAAE,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAC/B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAoFA"}
@@ -23,8 +23,7 @@ function getPriceAfterDiscount(product) {
23
23
  return product.price;
24
24
  }
25
25
  // main
26
- export function getCartCost({ cart, discounts, store, }) {
27
- const { isVatIncludedInPrice } = store;
26
+ export function getCartCost({ cart, discounts, deliveryPrice = 0, freeDeliveryPrice = 0, isVatIncludedInPrice = false, }) {
28
27
  // Convert cart items to the format expected by the discount engine
29
28
  const cartForEngine = cart.map((item) => ({
30
29
  amount: item.amount,
@@ -83,9 +82,9 @@ export function getCartCost({ cart, discounts, store, }) {
83
82
  finalCost: 0,
84
83
  vat: 0,
85
84
  productsCost: 0,
86
- deliveryPrice: store?.deliveryPrice ?? 0,
85
+ deliveryPrice: deliveryPrice,
87
86
  });
88
- if (cartDetails.deliveryPrice && cartDetails.productsCost >= (store.freeDeliveryPrice ?? 0)) {
87
+ if (cartDetails.deliveryPrice && cartDetails.productsCost >= freeDeliveryPrice) {
89
88
  cartDetails.deliveryPrice = 0;
90
89
  }
91
90
  else {