@jsdev_ninja/core 0.13.26 → 0.13.28

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.
Files changed (55) hide show
  1. package/dist/core.cjs.js +1 -1
  2. package/dist/core.cjs.js.map +1 -1
  3. package/dist/core.es.js +149 -145
  4. package/dist/core.es.js.map +1 -1
  5. package/dist/core.umd.js +1 -1
  6. package/dist/core.umd.js.map +1 -1
  7. package/dist/lib/entities/Order.d.ts +3 -0
  8. package/dist/lib/entities/Order.d.ts.map +1 -1
  9. package/dist/lib/entities/Order.js +1 -0
  10. package/dist/lib/entities/Store.d.ts +46 -0
  11. package/dist/lib/entities/Store.d.ts.map +1 -1
  12. package/dist/lib/entities/Store.js +3 -0
  13. package/dist/tsconfig.app.tsbuildinfo +1 -1
  14. package/package.json +9 -2
  15. package/eslint.config.js +0 -28
  16. package/index.html +0 -13
  17. package/lib/entities/Address.ts +0 -13
  18. package/lib/entities/Atoms.ts +0 -11
  19. package/lib/entities/Cart.ts +0 -24
  20. package/lib/entities/Category.ts +0 -35
  21. package/lib/entities/Company.ts +0 -9
  22. package/lib/entities/DeliveryNote.ts +0 -70
  23. package/lib/entities/Discount/__tests__/engine.test.ts +0 -337
  24. package/lib/entities/Discount/__tests__/factory.test.ts +0 -91
  25. package/lib/entities/Discount/__tests__/integration.test.ts +0 -132
  26. package/lib/entities/Discount/__tests__/simple.test.ts +0 -215
  27. package/lib/entities/Discount/__tests__/utils.test.ts +0 -69
  28. package/lib/entities/Discount/engine.ts +0 -138
  29. package/lib/entities/Discount/factory.ts +0 -25
  30. package/lib/entities/Discount/index.ts +0 -10
  31. package/lib/entities/Discount/strategies/BundleStrategy.ts +0 -119
  32. package/lib/entities/Discount/strategies/__tests__/BundleStrategy.test.ts +0 -295
  33. package/lib/entities/Discount/strategy.ts +0 -6
  34. package/lib/entities/Discount/types.ts +0 -68
  35. package/lib/entities/Discount/utils.ts +0 -42
  36. package/lib/entities/FavoriteProduct.ts +0 -12
  37. package/lib/entities/Invoice.ts +0 -57
  38. package/lib/entities/Locale.ts +0 -8
  39. package/lib/entities/Order.ts +0 -66
  40. package/lib/entities/Organization.ts +0 -23
  41. package/lib/entities/Product.ts +0 -68
  42. package/lib/entities/Profile.ts +0 -56
  43. package/lib/entities/Store.ts +0 -23
  44. package/lib/entities/index.ts +0 -14
  45. package/lib/firebase-api/app.ts +0 -18
  46. package/lib/firebase-api/index.ts +0 -46
  47. package/lib/index.tsx +0 -3
  48. package/lib/utils/index.ts +0 -127
  49. package/src/main.tsx +0 -1
  50. package/src/vite-env.d.ts +0 -1
  51. package/tsconfig.app.json +0 -20
  52. package/tsconfig.json +0 -7
  53. package/tsconfig.node.json +0 -26
  54. package/vite.config.ts +0 -27
  55. package/vitest.config.ts +0 -10
@@ -1,6 +1,7 @@
1
1
  import { z } from "zod";
2
2
  export declare const OrderSchema: z.ZodObject<{
3
3
  type: z.ZodLiteral<"Order">;
4
+ createdBy: z.ZodOptional<z.ZodEnum<["user", "admin"]>>;
4
5
  id: z.ZodString;
5
6
  companyId: z.ZodString;
6
7
  storeId: z.ZodString;
@@ -1423,6 +1424,7 @@ export declare const OrderSchema: z.ZodObject<{
1423
1424
  paymentType?: "internal" | "external" | undefined;
1424
1425
  organizationId?: string | undefined;
1425
1426
  nameOnInvoice?: string | undefined;
1427
+ createdBy?: "user" | "admin" | undefined;
1426
1428
  storeOptions?: {
1427
1429
  deliveryPrice?: number | undefined;
1428
1430
  freeDeliveryPrice?: number | undefined;
@@ -1680,6 +1682,7 @@ export declare const OrderSchema: z.ZodObject<{
1680
1682
  paymentType?: "internal" | "external" | undefined;
1681
1683
  organizationId?: string | undefined;
1682
1684
  nameOnInvoice?: string | undefined;
1685
+ createdBy?: "user" | "admin" | undefined;
1683
1686
  storeOptions?: {
1684
1687
  deliveryPrice?: number | undefined;
1685
1688
  freeDeliveryPrice?: number | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"Order.d.ts","sourceRoot":"","sources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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgDtB,CAAC;AAEH,MAAM,MAAM,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC"}
@@ -13,6 +13,7 @@ import { EzInvoiceSchema, InvoiceSchema } from "./Invoice";
13
13
  // type PaymentMethod = "credit_card" | "paypal" | "bank_transfer" | "cash_on_delivery";
14
14
  export const OrderSchema = z.object({
15
15
  type: z.literal("Order"),
16
+ createdBy: z.enum(["user", "admin"]).optional(),
16
17
  id: notEmptyTextSchema,
17
18
  companyId: notEmptyTextSchema,
18
19
  storeId: notEmptyTextSchema,
@@ -14,6 +14,32 @@ export declare const StoreSchema: z.ZodObject<{
14
14
  minimumOrder: z.ZodOptional<z.ZodNumber>;
15
15
  freeDeliveryPrice: z.ZodOptional<z.ZodNumber>;
16
16
  deliveryPrice: z.ZodOptional<z.ZodNumber>;
17
+ address: z.ZodOptional<z.ZodObject<{
18
+ country: z.ZodOptional<z.ZodString>;
19
+ city: z.ZodOptional<z.ZodString>;
20
+ street: z.ZodOptional<z.ZodString>;
21
+ streetNumber: z.ZodOptional<z.ZodString>;
22
+ floor: z.ZodOptional<z.ZodString>;
23
+ apartmentEnterNumber: z.ZodOptional<z.ZodString>;
24
+ apartmentNumber: z.ZodOptional<z.ZodString>;
25
+ }, "strip", z.ZodTypeAny, {
26
+ country?: string | undefined;
27
+ city?: string | undefined;
28
+ street?: string | undefined;
29
+ streetNumber?: string | undefined;
30
+ floor?: string | undefined;
31
+ apartmentEnterNumber?: string | undefined;
32
+ apartmentNumber?: string | undefined;
33
+ }, {
34
+ country?: string | undefined;
35
+ city?: string | undefined;
36
+ street?: string | undefined;
37
+ streetNumber?: string | undefined;
38
+ floor?: string | undefined;
39
+ apartmentEnterNumber?: string | undefined;
40
+ apartmentNumber?: string | undefined;
41
+ }>>;
42
+ companyNumber: z.ZodOptional<z.ZodString>;
17
43
  }, "strip", z.ZodTypeAny, {
18
44
  id: string;
19
45
  companyId: string;
@@ -25,9 +51,19 @@ export declare const StoreSchema: z.ZodObject<{
25
51
  logoUrl: string;
26
52
  allowAnonymousClients: boolean;
27
53
  clientTypes: ("company" | "individual")[];
54
+ address?: {
55
+ country?: string | undefined;
56
+ city?: string | undefined;
57
+ street?: string | undefined;
58
+ streetNumber?: string | undefined;
59
+ floor?: string | undefined;
60
+ apartmentEnterNumber?: string | undefined;
61
+ apartmentNumber?: string | undefined;
62
+ } | undefined;
28
63
  deliveryPrice?: number | undefined;
29
64
  freeDeliveryPrice?: number | undefined;
30
65
  minimumOrder?: number | undefined;
66
+ companyNumber?: string | undefined;
31
67
  }, {
32
68
  id: string;
33
69
  companyId: string;
@@ -39,9 +75,19 @@ export declare const StoreSchema: z.ZodObject<{
39
75
  logoUrl: string;
40
76
  allowAnonymousClients: boolean;
41
77
  clientTypes: ("company" | "individual")[];
78
+ address?: {
79
+ country?: string | undefined;
80
+ city?: string | undefined;
81
+ street?: string | undefined;
82
+ streetNumber?: string | undefined;
83
+ floor?: string | undefined;
84
+ apartmentEnterNumber?: string | undefined;
85
+ apartmentNumber?: string | undefined;
86
+ } | undefined;
42
87
  deliveryPrice?: number | undefined;
43
88
  freeDeliveryPrice?: number | undefined;
44
89
  minimumOrder?: number | undefined;
90
+ companyNumber?: string | undefined;
45
91
  }>;
46
92
  export type TStore = z.infer<typeof StoreSchema>;
47
93
  //# sourceMappingURL=Store.d.ts.map
@@ -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,eAAO,MAAM,iBAAiB,sCAAoC,CAAC;AAEnE,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EActB,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;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,4 +1,5 @@
1
1
  import { z } from "zod";
2
+ import { AddressSchema } from "./Address";
2
3
  export const clientTypesSchema = z.enum(["individual", "company"]);
3
4
  export const StoreSchema = z.object({
4
5
  id: z.string(),
@@ -14,4 +15,6 @@ export const StoreSchema = z.object({
14
15
  minimumOrder: z.number().optional(),
15
16
  freeDeliveryPrice: z.number().optional(),
16
17
  deliveryPrice: z.number().optional(),
18
+ address: AddressSchema.optional(),
19
+ companyNumber: z.string().optional(), // חפ של החברה
17
20
  });