@jsdev_ninja/core 0.10.4 → 0.10.6

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.
@@ -0,0 +1,68 @@
1
+ import { z } from "zod";
2
+ export declare const DiscountSchema: z.ZodObject<{
3
+ type: z.ZodLiteral<"Discount">;
4
+ storeId: z.ZodString;
5
+ companyId: z.ZodString;
6
+ id: z.ZodString;
7
+ name: z.ZodArray<z.ZodObject<{
8
+ lang: z.ZodEnum<["he"]>;
9
+ value: z.ZodString;
10
+ }, "strip", z.ZodTypeAny, {
11
+ value: string;
12
+ lang: "he";
13
+ }, {
14
+ value: string;
15
+ lang: "he";
16
+ }>, "many">;
17
+ active: z.ZodBoolean;
18
+ variant: z.ZodDiscriminatedUnion<"variantType", [z.ZodObject<{
19
+ variantType: z.ZodLiteral<"bundle">;
20
+ productsId: z.ZodArray<z.ZodString, "many">;
21
+ requiredQuantity: z.ZodNumber;
22
+ discountPrice: z.ZodNumber;
23
+ }, "strip", z.ZodTypeAny, {
24
+ variantType: "bundle";
25
+ productsId: string[];
26
+ requiredQuantity: number;
27
+ discountPrice: number;
28
+ }, {
29
+ variantType: "bundle";
30
+ productsId: string[];
31
+ requiredQuantity: number;
32
+ discountPrice: number;
33
+ }>]>;
34
+ }, "strip", z.ZodTypeAny, {
35
+ type: "Discount";
36
+ id: string;
37
+ companyId: string;
38
+ storeId: string;
39
+ name: {
40
+ value: string;
41
+ lang: "he";
42
+ }[];
43
+ active: boolean;
44
+ variant: {
45
+ variantType: "bundle";
46
+ productsId: string[];
47
+ requiredQuantity: number;
48
+ discountPrice: number;
49
+ };
50
+ }, {
51
+ type: "Discount";
52
+ id: string;
53
+ companyId: string;
54
+ storeId: string;
55
+ name: {
56
+ value: string;
57
+ lang: "he";
58
+ }[];
59
+ active: boolean;
60
+ variant: {
61
+ variantType: "bundle";
62
+ productsId: string[];
63
+ requiredQuantity: number;
64
+ discountPrice: number;
65
+ };
66
+ }>;
67
+ export type TDiscount = z.infer<typeof DiscountSchema>;
68
+ //# sourceMappingURL=Discount.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Discount.d.ts","sourceRoot":"","sources":["../../lib/entities/Discount.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAezB,CAAC;AACH,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC"}
@@ -0,0 +1,19 @@
1
+ import { z } from "zod";
2
+ import { LocaleSchema } from "./Locale";
3
+ const text = z.string().min(1);
4
+ export const DiscountSchema = z.object({
5
+ type: z.literal("Discount"),
6
+ storeId: text,
7
+ companyId: text,
8
+ id: text,
9
+ name: z.array(LocaleSchema),
10
+ active: z.boolean(),
11
+ variant: z.discriminatedUnion("variantType", [
12
+ z.object({
13
+ variantType: z.literal("bundle"),
14
+ productsId: z.array(z.string()).min(1),
15
+ requiredQuantity: z.number().positive(),
16
+ discountPrice: z.number().positive(),
17
+ }),
18
+ ]),
19
+ });
@@ -8,6 +8,7 @@ declare const StoreSchema: z.ZodObject<{
8
8
  tenantId: z.ZodString;
9
9
  paymentType: z.ZodEnum<["external", "j5"]>;
10
10
  allowAnonymousClients: z.ZodBoolean;
11
+ isVatIncludedInPrice: z.ZodBoolean;
11
12
  }, "strip", z.ZodTypeAny, {
12
13
  id: string;
13
14
  companyId: string;
@@ -17,6 +18,7 @@ declare const StoreSchema: z.ZodObject<{
17
18
  urls: string[];
18
19
  logoUrl: string;
19
20
  allowAnonymousClients: boolean;
21
+ isVatIncludedInPrice: boolean;
20
22
  }, {
21
23
  id: string;
22
24
  companyId: string;
@@ -26,6 +28,7 @@ declare const StoreSchema: z.ZodObject<{
26
28
  urls: string[];
27
29
  logoUrl: string;
28
30
  allowAnonymousClients: boolean;
31
+ isVatIncludedInPrice: boolean;
29
32
  }>;
30
33
  export type TStore = z.infer<typeof StoreSchema>;
31
34
  export {};
@@ -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;AAExB,QAAA,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;EASf,CAAC;AACH,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;AAExB,QAAA,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAUf,CAAC;AACH,MAAM,MAAM,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC"}
@@ -8,4 +8,5 @@ const StoreSchema = z.object({
8
8
  tenantId: z.string(), // firebase auth tenantId
9
9
  paymentType: z.enum(["external", "j5"]),
10
10
  allowAnonymousClients: z.boolean(),
11
+ isVatIncludedInPrice: z.boolean(),
11
12
  });
@@ -9,4 +9,5 @@ export * from "./Order";
9
9
  export * from "./Product";
10
10
  export * from "./Profile";
11
11
  export * from "./Store";
12
+ export * from "./Discount";
12
13
  //# 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"}
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"}
@@ -9,3 +9,4 @@ export * from "./Order";
9
9
  export * from "./Product";
10
10
  export * from "./Profile";
11
11
  export * from "./Store";
12
+ export * from "./Discount";
@@ -12,6 +12,7 @@ export declare const storeCollections: {
12
12
  readonly favorites: "favorites";
13
13
  readonly payments: "payments";
14
14
  readonly settings: "settings";
15
+ readonly discounts: "discounts";
15
16
  };
16
17
  export declare const FirestoreApi: {
17
18
  systemCollections: {
@@ -28,6 +29,7 @@ export declare const FirestoreApi: {
28
29
  readonly favorites: "favorites";
29
30
  readonly payments: "payments";
30
31
  readonly settings: "settings";
32
+ readonly discounts: "discounts";
31
33
  };
32
34
  getPath: ({ companyId, storeId, collectionName, id, }: {
33
35
  companyId: string;
@@ -53,6 +55,7 @@ export declare const FirebaseAPI: {
53
55
  readonly favorites: "favorites";
54
56
  readonly payments: "payments";
55
57
  readonly settings: "settings";
58
+ readonly discounts: "discounts";
56
59
  };
57
60
  getPath: ({ companyId, storeId, collectionName, id, }: {
58
61
  companyId: string;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/firebase-api/index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,iBAAiB;;;CAGpB,CAAC;AAEX,eAAO,MAAM,gBAAgB;;;;;;;;;;CAUnB,CAAC;AAEX,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;2DASrB;QACF,SAAS,EAAE,MAAM,CAAC;QAClB,OAAO,EAAE,MAAM,CAAC;QAChB,cAAc,EAAE,MAAM,OAAO,gBAAgB,CAAC;QAC9C,EAAE,CAAC,EAAE,MAAM,CAAC;KACZ;iCAI4B,MAAM,OAAO,gBAAgB;CAG1D,CAAC;AAEF,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;+DAdpB;YACF,SAAS,EAAE,MAAM,CAAC;YAClB,OAAO,EAAE,MAAM,CAAC;YAChB,cAAc,EAAE,MAAM,OAAO,gBAAgB,CAAC;YAC9C,EAAE,CAAC,EAAE,MAAM,CAAC;SACZ;qCAI4B,MAAM,OAAO,gBAAgB;;CAO1D,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/firebase-api/index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,iBAAiB;;;CAGpB,CAAC;AAEX,eAAO,MAAM,gBAAgB;;;;;;;;;;;CAWnB,CAAC;AAEX,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;2DASrB;QACF,SAAS,EAAE,MAAM,CAAC;QAClB,OAAO,EAAE,MAAM,CAAC;QAChB,cAAc,EAAE,MAAM,OAAO,gBAAgB,CAAC;QAC9C,EAAE,CAAC,EAAE,MAAM,CAAC;KACZ;iCAI4B,MAAM,OAAO,gBAAgB;CAG1D,CAAC;AAEF,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;+DAdpB;YACF,SAAS,EAAE,MAAM,CAAC;YAClB,OAAO,EAAE,MAAM,CAAC;YAChB,cAAc,EAAE,MAAM,OAAO,gBAAgB,CAAC;YAC9C,EAAE,CAAC,EAAE,MAAM,CAAC;SACZ;qCAI4B,MAAM,OAAO,gBAAgB;;CAO1D,CAAC"}
@@ -12,6 +12,7 @@ export const storeCollections = {
12
12
  favorites: "favorites",
13
13
  payments: "payments",
14
14
  settings: "settings",
15
+ discounts: "discounts",
15
16
  };
16
17
  export const FirestoreApi = {
17
18
  systemCollections,
@@ -1 +1 @@
1
- {"root":["../lib/index.tsx","../lib/entities/address.ts","../lib/entities/atoms.ts","../lib/entities/cart.ts","../lib/entities/category.ts","../lib/entities/company.ts","../lib/entities/favoriteproduct.ts","../lib/entities/locale.ts","../lib/entities/order.ts","../lib/entities/product.ts","../lib/entities/profile.ts","../lib/entities/store.ts","../lib/entities/index.ts","../lib/firebase-api/app.ts","../lib/firebase-api/index.ts"],"version":"5.7.3"}
1
+ {"root":["../lib/index.tsx","../lib/entities/address.ts","../lib/entities/atoms.ts","../lib/entities/cart.ts","../lib/entities/category.ts","../lib/entities/company.ts","../lib/entities/discount.ts","../lib/entities/favoriteproduct.ts","../lib/entities/locale.ts","../lib/entities/order.ts","../lib/entities/product.ts","../lib/entities/profile.ts","../lib/entities/store.ts","../lib/entities/index.ts","../lib/firebase-api/app.ts","../lib/firebase-api/index.ts"],"version":"5.7.3"}
@@ -0,0 +1,22 @@
1
+ import { z } from "zod";
2
+ import { LocaleSchema } from "./Locale";
3
+
4
+ const text = z.string().min(1);
5
+
6
+ export const DiscountSchema = z.object({
7
+ type: z.literal("Discount"),
8
+ storeId: text,
9
+ companyId: text,
10
+ id: text,
11
+ name: z.array(LocaleSchema),
12
+ active: z.boolean(),
13
+ variant: z.discriminatedUnion("variantType", [
14
+ z.object({
15
+ variantType: z.literal("bundle"),
16
+ productsId: z.array(z.string()).min(1),
17
+ requiredQuantity: z.number().positive(),
18
+ discountPrice: z.number().positive(),
19
+ }),
20
+ ]),
21
+ });
22
+ export type TDiscount = z.infer<typeof DiscountSchema>;
@@ -9,5 +9,6 @@ const StoreSchema = z.object({
9
9
  tenantId: z.string(), // firebase auth tenantId
10
10
  paymentType: z.enum(["external", "j5"]),
11
11
  allowAnonymousClients: z.boolean(),
12
+ isVatIncludedInPrice: z.boolean(),
12
13
  });
13
14
  export type TStore = z.infer<typeof StoreSchema>;
@@ -9,3 +9,4 @@ export * from "./Order";
9
9
  export * from "./Product";
10
10
  export * from "./Profile";
11
11
  export * from "./Store";
12
+ export * from "./Discount";
@@ -13,6 +13,7 @@ export const storeCollections = {
13
13
  favorites: "favorites",
14
14
  payments: "payments",
15
15
  settings: "settings",
16
+ discounts: "discounts",
16
17
  } as const;
17
18
 
18
19
  export const FirestoreApi = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jsdev_ninja/core",
3
- "version": "0.10.4",
3
+ "version": "0.10.6",
4
4
  "main": "dist/core.cjs.js",
5
5
  "module": "dist/core.es.js",
6
6
  "types": "dist/index.d.ts",