@jsdev_ninja/core 0.13.28 → 0.13.30

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.
@@ -7,7 +7,7 @@ export declare const OrderSchema: z.ZodObject<{
7
7
  storeId: z.ZodString;
8
8
  userId: z.ZodString;
9
9
  status: z.ZodEnum<["draft", "pending", "processing", "in_delivery", "delivered", "cancelled", "completed", "refunded"]>;
10
- paymentType: z.ZodOptional<z.ZodEnum<["internal", "external"]>>;
10
+ paymentType: z.ZodOptional<z.ZodEnum<["external", "j5", "none"]>>;
11
11
  paymentStatus: z.ZodEnum<["pending", "pending_j5", "external", "completed", "failed", "refunded"]>;
12
12
  cart: z.ZodObject<{
13
13
  id: z.ZodString;
@@ -765,7 +765,7 @@ export declare const OrderSchema: z.ZodObject<{
765
765
  actualAmount: z.ZodOptional<z.ZodNumber>;
766
766
  date: z.ZodNumber;
767
767
  deliveryDate: z.ZodNumber;
768
- client: z.ZodObject<{
768
+ client: z.ZodOptional<z.ZodObject<{
769
769
  type: z.ZodLiteral<"Profile">;
770
770
  id: z.ZodString;
771
771
  companyId: z.ZodString;
@@ -804,7 +804,7 @@ export declare const OrderSchema: z.ZodObject<{
804
804
  isAnonymous: z.ZodBoolean;
805
805
  createdDate: z.ZodNumber;
806
806
  lastActivityDate: z.ZodNumber;
807
- paymentType: z.ZodEnum<["default", "delayed"]>;
807
+ paymentType: z.ZodEnum<["external", "j5", "none"]>;
808
808
  organizationId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
809
809
  }, "strip", z.ZodTypeAny, {
810
810
  type: "Profile";
@@ -818,7 +818,7 @@ export declare const OrderSchema: z.ZodObject<{
818
818
  isAnonymous: boolean;
819
819
  createdDate: number;
820
820
  lastActivityDate: number;
821
- paymentType: "default" | "delayed";
821
+ paymentType: "none" | "external" | "j5";
822
822
  companyName?: string | undefined;
823
823
  phoneNumber?: string | undefined;
824
824
  address?: {
@@ -843,7 +843,7 @@ export declare const OrderSchema: z.ZodObject<{
843
843
  isAnonymous: boolean;
844
844
  createdDate: number;
845
845
  lastActivityDate: number;
846
- paymentType: "default" | "delayed";
846
+ paymentType: "none" | "external" | "j5";
847
847
  companyName?: string | undefined;
848
848
  phoneNumber?: string | undefined;
849
849
  address?: {
@@ -856,7 +856,7 @@ export declare const OrderSchema: z.ZodObject<{
856
856
  apartmentNumber?: string | undefined;
857
857
  } | undefined;
858
858
  organizationId?: string | null | undefined;
859
- }>;
859
+ }>>;
860
860
  nameOnInvoice: z.ZodOptional<z.ZodString>;
861
861
  clientComment: z.ZodOptional<z.ZodString>;
862
862
  organizationId: z.ZodOptional<z.ZodString>;
@@ -1293,7 +1293,7 @@ export declare const OrderSchema: z.ZodObject<{
1293
1293
  companyId: string;
1294
1294
  storeId: string;
1295
1295
  userId: string;
1296
- paymentStatus: "completed" | "pending" | "refunded" | "external" | "pending_j5" | "failed";
1296
+ paymentStatus: "completed" | "external" | "pending" | "refunded" | "pending_j5" | "failed";
1297
1297
  cart: {
1298
1298
  id: string;
1299
1299
  items: {
@@ -1395,7 +1395,19 @@ export declare const OrderSchema: z.ZodObject<{
1395
1395
  deliveryPrice?: number | undefined;
1396
1396
  };
1397
1397
  deliveryDate: number;
1398
- client: {
1398
+ paymentType?: "none" | "external" | "j5" | undefined;
1399
+ organizationId?: string | undefined;
1400
+ nameOnInvoice?: string | undefined;
1401
+ createdBy?: "user" | "admin" | undefined;
1402
+ storeOptions?: {
1403
+ deliveryPrice?: number | undefined;
1404
+ freeDeliveryPrice?: number | undefined;
1405
+ isVatIncludedInPrice?: boolean | undefined;
1406
+ } | undefined;
1407
+ orderDeliveryPrice?: number | undefined;
1408
+ originalAmount?: number | undefined;
1409
+ actualAmount?: number | undefined;
1410
+ client?: {
1399
1411
  type: "Profile";
1400
1412
  id: string;
1401
1413
  companyId: string;
@@ -1407,7 +1419,7 @@ export declare const OrderSchema: z.ZodObject<{
1407
1419
  isAnonymous: boolean;
1408
1420
  createdDate: number;
1409
1421
  lastActivityDate: number;
1410
- paymentType: "default" | "delayed";
1422
+ paymentType: "none" | "external" | "j5";
1411
1423
  companyName?: string | undefined;
1412
1424
  phoneNumber?: string | undefined;
1413
1425
  address?: {
@@ -1420,19 +1432,7 @@ export declare const OrderSchema: z.ZodObject<{
1420
1432
  apartmentNumber?: string | undefined;
1421
1433
  } | undefined;
1422
1434
  organizationId?: string | null | undefined;
1423
- };
1424
- paymentType?: "internal" | "external" | undefined;
1425
- organizationId?: string | undefined;
1426
- nameOnInvoice?: string | undefined;
1427
- createdBy?: "user" | "admin" | undefined;
1428
- storeOptions?: {
1429
- deliveryPrice?: number | undefined;
1430
- freeDeliveryPrice?: number | undefined;
1431
- isVatIncludedInPrice?: boolean | undefined;
1432
1435
  } | undefined;
1433
- orderDeliveryPrice?: number | undefined;
1434
- originalAmount?: number | undefined;
1435
- actualAmount?: number | undefined;
1436
1436
  clientComment?: string | undefined;
1437
1437
  billingAccount?: {
1438
1438
  number: string;
@@ -1551,7 +1551,7 @@ export declare const OrderSchema: z.ZodObject<{
1551
1551
  companyId: string;
1552
1552
  storeId: string;
1553
1553
  userId: string;
1554
- paymentStatus: "completed" | "pending" | "refunded" | "external" | "pending_j5" | "failed";
1554
+ paymentStatus: "completed" | "external" | "pending" | "refunded" | "pending_j5" | "failed";
1555
1555
  cart: {
1556
1556
  id: string;
1557
1557
  items: {
@@ -1653,7 +1653,19 @@ export declare const OrderSchema: z.ZodObject<{
1653
1653
  deliveryPrice?: number | undefined;
1654
1654
  };
1655
1655
  deliveryDate: number;
1656
- client: {
1656
+ paymentType?: "none" | "external" | "j5" | undefined;
1657
+ organizationId?: string | undefined;
1658
+ nameOnInvoice?: string | undefined;
1659
+ createdBy?: "user" | "admin" | undefined;
1660
+ storeOptions?: {
1661
+ deliveryPrice?: number | undefined;
1662
+ freeDeliveryPrice?: number | undefined;
1663
+ isVatIncludedInPrice?: boolean | undefined;
1664
+ } | undefined;
1665
+ orderDeliveryPrice?: number | undefined;
1666
+ originalAmount?: number | undefined;
1667
+ actualAmount?: number | undefined;
1668
+ client?: {
1657
1669
  type: "Profile";
1658
1670
  id: string;
1659
1671
  companyId: string;
@@ -1665,7 +1677,7 @@ export declare const OrderSchema: z.ZodObject<{
1665
1677
  isAnonymous: boolean;
1666
1678
  createdDate: number;
1667
1679
  lastActivityDate: number;
1668
- paymentType: "default" | "delayed";
1680
+ paymentType: "none" | "external" | "j5";
1669
1681
  companyName?: string | undefined;
1670
1682
  phoneNumber?: string | undefined;
1671
1683
  address?: {
@@ -1678,19 +1690,7 @@ export declare const OrderSchema: z.ZodObject<{
1678
1690
  apartmentNumber?: string | undefined;
1679
1691
  } | undefined;
1680
1692
  organizationId?: string | null | undefined;
1681
- };
1682
- paymentType?: "internal" | "external" | undefined;
1683
- organizationId?: string | undefined;
1684
- nameOnInvoice?: string | undefined;
1685
- createdBy?: "user" | "admin" | undefined;
1686
- storeOptions?: {
1687
- deliveryPrice?: number | undefined;
1688
- freeDeliveryPrice?: number | undefined;
1689
- isVatIncludedInPrice?: boolean | undefined;
1690
1693
  } | undefined;
1691
- orderDeliveryPrice?: number | undefined;
1692
- originalAmount?: number | undefined;
1693
- actualAmount?: number | undefined;
1694
1694
  clientComment?: string | undefined;
1695
1695
  billingAccount?: {
1696
1696
  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;AAgBxB,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgDtB,CAAC;AAEH,MAAM,MAAM,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC"}
@@ -5,6 +5,7 @@ import { CartItemProductSchema } from "./Cart";
5
5
  import { DeliveryNoteSchema, EzDeliveryNoteSchema } from "./DeliveryNote";
6
6
  import { BillingAccountSchema } from "./Organization";
7
7
  import { EzInvoiceSchema, InvoiceSchema } from "./Invoice";
8
+ import { PaymentTypeSchema } from "./Payment";
8
9
  // pending - order created / by user
9
10
  // processing order accepted by store by admin
10
11
  // delivered - order delivered by admin
@@ -28,7 +29,7 @@ export const OrderSchema = z.object({
28
29
  "completed",
29
30
  "refunded",
30
31
  ]),
31
- paymentType: z.enum(["internal", "external"]).optional(),
32
+ paymentType: PaymentTypeSchema.optional(),
32
33
  paymentStatus: z.enum(["pending", "pending_j5", "external", "completed", "failed", "refunded"]), //todo check if hyp support partial refund
33
34
  cart: z.object({
34
35
  id: z.string(),
@@ -50,7 +51,7 @@ export const OrderSchema = z.object({
50
51
  actualAmount: z.number().positive().optional(), // what store charge
51
52
  date: z.number(),
52
53
  deliveryDate: z.coerce.number(),
53
- client: ProfileSchema.required({}),
54
+ client: ProfileSchema.optional(),
54
55
  nameOnInvoice: z.string().optional(),
55
56
  clientComment: z.string().optional(),
56
57
  organizationId: z.string().optional(),
@@ -30,11 +30,11 @@ export declare const OrganizationSchema: z.ZodObject<{
30
30
  id: string;
31
31
  name: string;
32
32
  }>, "many">;
33
- paymentType: z.ZodEnum<["default", "delayed"]>;
33
+ paymentType: z.ZodEnum<["external", "j5", "none"]>;
34
34
  }, "strip", z.ZodTypeAny, {
35
35
  id: string;
36
36
  name: string;
37
- paymentType: "default" | "delayed";
37
+ paymentType: "none" | "external" | "j5";
38
38
  billingAccounts: {
39
39
  number: string;
40
40
  id: string;
@@ -45,7 +45,7 @@ export declare const OrganizationSchema: z.ZodObject<{
45
45
  }, {
46
46
  id: string;
47
47
  name: string;
48
- paymentType: "default" | "delayed";
48
+ paymentType: "none" | "external" | "j5";
49
49
  billingAccounts: {
50
50
  number: string;
51
51
  id: string;
@@ -72,10 +72,10 @@ export declare const NewOrganizationSchema: z.ZodObject<Omit<{
72
72
  id: string;
73
73
  name: string;
74
74
  }>, "many">;
75
- paymentType: z.ZodEnum<["default", "delayed"]>;
75
+ paymentType: z.ZodEnum<["external", "j5", "none"]>;
76
76
  }, "id">, "strip", z.ZodTypeAny, {
77
77
  name: string;
78
- paymentType: "default" | "delayed";
78
+ paymentType: "none" | "external" | "j5";
79
79
  billingAccounts: {
80
80
  number: string;
81
81
  id: string;
@@ -85,7 +85,7 @@ export declare const NewOrganizationSchema: z.ZodObject<Omit<{
85
85
  nameOnInvoice?: string | undefined;
86
86
  }, {
87
87
  name: string;
88
- paymentType: "default" | "delayed";
88
+ paymentType: "none" | "external" | "j5";
89
89
  billingAccounts: {
90
90
  number: string;
91
91
  id: string;
@@ -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;AAExB,eAAO,MAAM,oBAAoB;;;;;;;;;;;;EAI/B,CAAC;AAGH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAO7B,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;AAGxB,eAAO,MAAM,oBAAoB;;;;;;;;;;;;EAI/B,CAAC;AAGH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAO7B,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,4 +1,5 @@
1
1
  import { z } from "zod";
2
+ import { PaymentTypeSchema } from "./Payment";
2
3
  export const BillingAccountSchema = z.object({
3
4
  number: z.string(),
4
5
  name: z.string(),
@@ -11,6 +12,6 @@ export const OrganizationSchema = z.object({
11
12
  discountPercentage: z.number().positive().min(0).max(100).optional(),
12
13
  nameOnInvoice: z.string().optional(),
13
14
  billingAccounts: z.array(BillingAccountSchema),
14
- paymentType: z.enum(["default", "delayed"]),
15
+ paymentType: PaymentTypeSchema
15
16
  });
16
17
  export const NewOrganizationSchema = OrganizationSchema.omit({ id: true });
@@ -0,0 +1,4 @@
1
+ import { z } from "zod";
2
+ export declare const PaymentTypeSchema: z.ZodEnum<["external", "j5", "none"]>;
3
+ export type TPaymentType = z.infer<typeof PaymentTypeSchema>;
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../lib/entities/Payment/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,eAAO,MAAM,iBAAiB,uCAAqC,CAAC;AAEpE,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { z } from "zod";
2
+ // payment type priority -> store -> organization -> profile (profile is stronger)
3
+ // value fixed on order creation, can be changed later by admin
4
+ export const PaymentTypeSchema = z.enum(["external", "j5", "none"]);
@@ -1,6 +1,4 @@
1
1
  import { z } from "zod";
2
- export declare const ProfilePaymentTypeSchema: z.ZodEnum<["default", "delayed"]>;
3
- export type TProfilePaymentType = z.infer<typeof ProfilePaymentTypeSchema>;
4
2
  export declare const ProfileSchema: z.ZodObject<{
5
3
  type: z.ZodLiteral<"Profile">;
6
4
  id: z.ZodString;
@@ -40,7 +38,7 @@ export declare const ProfileSchema: z.ZodObject<{
40
38
  isAnonymous: z.ZodBoolean;
41
39
  createdDate: z.ZodNumber;
42
40
  lastActivityDate: z.ZodNumber;
43
- paymentType: z.ZodEnum<["default", "delayed"]>;
41
+ paymentType: z.ZodEnum<["external", "j5", "none"]>;
44
42
  organizationId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
45
43
  }, "strip", z.ZodTypeAny, {
46
44
  type: "Profile";
@@ -54,7 +52,7 @@ export declare const ProfileSchema: z.ZodObject<{
54
52
  isAnonymous: boolean;
55
53
  createdDate: number;
56
54
  lastActivityDate: number;
57
- paymentType: "default" | "delayed";
55
+ paymentType: "none" | "external" | "j5";
58
56
  companyName?: string | undefined;
59
57
  phoneNumber?: string | undefined;
60
58
  address?: {
@@ -79,7 +77,7 @@ export declare const ProfileSchema: z.ZodObject<{
79
77
  isAnonymous: boolean;
80
78
  createdDate: number;
81
79
  lastActivityDate: number;
82
- paymentType: "default" | "delayed";
80
+ paymentType: "none" | "external" | "j5";
83
81
  companyName?: string | undefined;
84
82
  phoneNumber?: string | undefined;
85
83
  address?: {
@@ -94,5 +92,4 @@ export declare const ProfileSchema: z.ZodObject<{
94
92
  organizationId?: string | null | undefined;
95
93
  }>;
96
94
  export type TProfile = z.infer<typeof ProfileSchema>;
97
- export declare function createEmptyProfile(): TProfile;
98
95
  //# sourceMappingURL=Profile.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Profile.d.ts","sourceRoot":"","sources":["../../../lib/entities/Profile.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,wBAAwB,mCAEnC,CAAC;AACH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAE3E,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiBxB,CAAC;AAEH,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AAErD,wBAAgB,kBAAkB,IAAI,QAAQ,CAyB7C"}
1
+ {"version":3,"file":"Profile.d.ts","sourceRoot":"","sources":["../../../lib/entities/Profile.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiBxB,CAAC;AAEH,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC"}
@@ -1,9 +1,7 @@
1
1
  import { z } from "zod";
2
2
  import { AddressSchema } from "./Address";
3
3
  import { notEmptyTextSchema } from "./Atoms";
4
- export const ProfilePaymentTypeSchema = z.enum(["default", "delayed"], {
5
- description: "delayed is J5 transaction",
6
- });
4
+ import { PaymentTypeSchema } from "./Payment";
7
5
  export const ProfileSchema = z.object({
8
6
  type: z.literal("Profile"),
9
7
  id: notEmptyTextSchema,
@@ -19,32 +17,6 @@ export const ProfileSchema = z.object({
19
17
  isAnonymous: z.boolean(),
20
18
  createdDate: z.number(),
21
19
  lastActivityDate: z.number(),
22
- paymentType: ProfilePaymentTypeSchema,
20
+ paymentType: PaymentTypeSchema,
23
21
  organizationId: z.string().optional().nullable(),
24
22
  });
25
- export function createEmptyProfile() {
26
- return {
27
- type: "Profile",
28
- id: "",
29
- companyId: "",
30
- storeId: "",
31
- tenantId: "",
32
- clientType: "user",
33
- displayName: "",
34
- email: "",
35
- phoneNumber: "",
36
- address: {
37
- country: "",
38
- city: "",
39
- street: "",
40
- streetNumber: "",
41
- floor: "",
42
- apartmentEnterNumber: "",
43
- apartmentNumber: "",
44
- },
45
- createdDate: 0,
46
- lastActivityDate: 0,
47
- isAnonymous: true,
48
- paymentType: ProfilePaymentTypeSchema.Values.default,
49
- };
50
- }
@@ -7,7 +7,7 @@ export declare const StoreSchema: z.ZodObject<{
7
7
  urls: z.ZodArray<z.ZodString, "many">;
8
8
  logoUrl: z.ZodString;
9
9
  tenantId: z.ZodString;
10
- paymentType: z.ZodEnum<["external", "j5"]>;
10
+ paymentType: z.ZodEnum<["external", "j5", "none"]>;
11
11
  allowAnonymousClients: z.ZodBoolean;
12
12
  isVatIncludedInPrice: z.ZodBoolean;
13
13
  clientTypes: z.ZodArray<z.ZodEnum<["individual", "company"]>, "many">;
@@ -45,7 +45,7 @@ export declare const StoreSchema: z.ZodObject<{
45
45
  companyId: string;
46
46
  name: string;
47
47
  tenantId: string;
48
- paymentType: "external" | "j5";
48
+ paymentType: "none" | "external" | "j5";
49
49
  isVatIncludedInPrice: boolean;
50
50
  urls: string[];
51
51
  logoUrl: string;
@@ -69,7 +69,7 @@ export declare const StoreSchema: z.ZodObject<{
69
69
  companyId: string;
70
70
  name: string;
71
71
  tenantId: string;
72
- paymentType: "external" | "j5";
72
+ paymentType: "none" | "external" | "j5";
73
73
  isVatIncludedInPrice: boolean;
74
74
  urls: string[];
75
75
  logoUrl: string;
@@ -1 +1 @@
1
- {"version":3,"file":"Store.d.ts","sourceRoot":"","sources":["../../../lib/entities/Store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,iBAAiB,sCAAoC,CAAC;AAEnE,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgBtB,CAAC;AAEH,MAAM,MAAM,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC"}
1
+ {"version":3,"file":"Store.d.ts","sourceRoot":"","sources":["../../../lib/entities/Store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,iBAAiB,sCAAoC,CAAC;AAEnE,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgBtB,CAAC;AAEH,MAAM,MAAM,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC"}
@@ -1,5 +1,6 @@
1
1
  import { z } from "zod";
2
2
  import { AddressSchema } from "./Address";
3
+ import { PaymentTypeSchema } from "./Payment";
3
4
  export const clientTypesSchema = z.enum(["individual", "company"]);
4
5
  export const StoreSchema = z.object({
5
6
  id: z.string(),
@@ -8,7 +9,7 @@ export const StoreSchema = z.object({
8
9
  urls: z.array(z.string()),
9
10
  logoUrl: z.string(),
10
11
  tenantId: z.string(), // firebase auth tenantId
11
- paymentType: z.enum(["external", "j5"]),
12
+ paymentType: PaymentTypeSchema,
12
13
  allowAnonymousClients: z.boolean(),
13
14
  isVatIncludedInPrice: z.boolean(),
14
15
  clientTypes: z.array(clientTypesSchema),
@@ -12,4 +12,5 @@ export * from "./Store";
12
12
  export * from "./Discount";
13
13
  export * from "./Organization";
14
14
  export * from "./DeliveryNote";
15
+ export * from "./Payment";
15
16
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../lib/entities/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,mBAAmB,CAAC;AAClC,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../lib/entities/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,mBAAmB,CAAC;AAClC,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,WAAW,CAAC"}
@@ -12,3 +12,4 @@ export * from "./Store";
12
12
  export * from "./Discount";
13
13
  export * from "./Organization";
14
14
  export * from "./DeliveryNote";
15
+ export * from "./Payment";