@jsdev_ninja/core 0.12.5 → 0.12.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.
@@ -1,5 +1,6 @@
1
1
  import { z } from "zod";
2
- declare const StoreSchema: z.ZodObject<{
2
+ export declare const clientTypesSchema: z.ZodEnum<["individual", "company"]>;
3
+ export declare const StoreSchema: z.ZodObject<{
3
4
  id: z.ZodString;
4
5
  companyId: z.ZodString;
5
6
  name: z.ZodString;
@@ -43,5 +44,4 @@ declare const StoreSchema: z.ZodObject<{
43
44
  deliveryPrice?: number | undefined;
44
45
  }>;
45
46
  export type TStore = z.infer<typeof StoreSchema>;
46
- export {};
47
47
  //# 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;AAGxB,QAAA,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAcf,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,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,6 +1,6 @@
1
1
  import { z } from "zod";
2
- const clientTypesSchema = z.enum(["individual", "company"]);
3
- const StoreSchema = z.object({
2
+ export const clientTypesSchema = z.enum(["individual", "company"]);
3
+ export const StoreSchema = z.object({
4
4
  id: z.string(),
5
5
  companyId: z.string(),
6
6
  name: z.string(),
@@ -1,7 +1,8 @@
1
1
  import { z } from "zod";
2
2
 
3
- const clientTypesSchema = z.enum(["individual", "company"]);
4
- const StoreSchema = z.object({
3
+ export const clientTypesSchema = z.enum(["individual", "company"]);
4
+
5
+ export const StoreSchema = z.object({
5
6
  id: z.string(),
6
7
  companyId: z.string(),
7
8
  name: z.string(),
@@ -16,4 +17,5 @@ const StoreSchema = z.object({
16
17
  freeDeliveryPrice: z.number().optional(),
17
18
  deliveryPrice: z.number().optional(),
18
19
  });
20
+
19
21
  export type TStore = z.infer<typeof StoreSchema>;
@@ -51,6 +51,9 @@ export function getCartCost({
51
51
  };
52
52
  });
53
53
 
54
+ // calculate delivery price before
55
+ // check if cart cost is greater than free delivery price
56
+
54
57
  const activeDiscounts = discounts.filter((discount) => {
55
58
  if (discount.variant.variantType === "bundle") {
56
59
  const productsTotal =
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jsdev_ninja/core",
3
- "version": "0.12.5",
3
+ "version": "0.12.6",
4
4
  "main": "dist/core.cjs.js",
5
5
  "module": "dist/core.es.js",
6
6
  "types": "dist/index.d.ts",