@jsdev_ninja/core 0.7.61 → 0.7.62

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 (53) hide show
  1. package/dist/core.cjs.js.map +1 -0
  2. package/dist/core.es.js +3037 -0
  3. package/dist/core.es.js.map +1 -0
  4. package/dist/core.umd.js +2 -0
  5. package/dist/core.umd.js.map +1 -0
  6. package/dist/entities/Address.d.ts +28 -0
  7. package/dist/entities/Address.d.ts.map +1 -0
  8. package/dist/entities/Address.js +10 -0
  9. package/dist/entities/Cart.d.ts +715 -0
  10. package/dist/entities/Cart.d.ts.map +1 -0
  11. package/dist/entities/Cart.js +14 -0
  12. package/dist/entities/Category.d.ts +103 -0
  13. package/dist/entities/Category.d.ts.map +1 -0
  14. package/dist/entities/Category.js +20 -0
  15. package/dist/entities/Locale.d.ts +12 -0
  16. package/dist/entities/Locale.d.ts.map +1 -0
  17. package/dist/entities/Locale.js +5 -0
  18. package/dist/entities/Order.d.ts +1118 -0
  19. package/dist/entities/Order.d.ts.map +1 -0
  20. package/dist/entities/Order.js +30 -0
  21. package/dist/entities/Payment.d.ts +30 -0
  22. package/dist/entities/Payment.d.ts.map +1 -0
  23. package/dist/entities/Payment.js +12 -0
  24. package/dist/entities/Product.d.ts +1000 -0
  25. package/dist/entities/Product.d.ts.map +1 -0
  26. package/dist/entities/Product.js +64 -0
  27. package/dist/entities/Profile.d.ts +102 -0
  28. package/dist/entities/Profile.d.ts.map +1 -0
  29. package/dist/entities/Profile.js +45 -0
  30. package/dist/entities/index.d.ts +6 -0
  31. package/dist/entities/index.d.ts.map +1 -0
  32. package/dist/entities/index.js +5 -0
  33. package/dist/index.d.ts +2 -0
  34. package/dist/index.d.ts.map +1 -0
  35. package/dist/index.js +1 -0
  36. package/dist/tsconfig.app.tsbuildinfo +1 -0
  37. package/dist/tsconfig.node.tsbuildinfo +1 -0
  38. package/dist/vite.config.d.ts +3 -0
  39. package/dist/vite.config.d.ts.map +1 -0
  40. package/dist/vite.config.js +25 -0
  41. package/eslint.config.js +28 -0
  42. package/index.html +13 -0
  43. package/package.json +1 -5
  44. package/src/App.css +42 -0
  45. package/src/App.tsx +35 -0
  46. package/src/assets/react.svg +1 -0
  47. package/src/index.css +68 -0
  48. package/src/main.tsx +3 -0
  49. package/src/vite-env.d.ts +1 -0
  50. package/tsconfig.app.json +19 -0
  51. package/tsconfig.json +7 -0
  52. package/tsconfig.node.json +26 -0
  53. package/vite.config.ts +27 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Order.d.ts","sourceRoot":"","sources":["../../lib/entities/Order.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAexB,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkBtB,CAAC;AAEH,MAAM,MAAM,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC"}
@@ -0,0 +1,30 @@
1
+ import { z } from "zod";
2
+ import { AddressSchema } from "./Address";
3
+ import { ProfileSchema } from "./Profile";
4
+ import { ProductSchema } from "./Product";
5
+ // pending - order created / by user
6
+ // processing order accepted by store by admin
7
+ // delivered - order delivered by admin
8
+ // canceled - order canceled by user/admin
9
+ // completed - order paid by admin
10
+ // type PaymentStatus = "pending" | "completed" | "failed" | "refunded" | "partially_refunded";
11
+ // type PaymentMethod = "credit_card" | "paypal" | "bank_transfer" | "cash_on_delivery";
12
+ export const OrderSchema = z.object({
13
+ type: z.literal("Order"),
14
+ id: z.string(),
15
+ companyId: z.string(),
16
+ storeId: z.string(),
17
+ userId: z.string(),
18
+ status: z.enum(["pending", "processing", "delivered", "canceled", "completed", "refunded"]),
19
+ cart: z.object({
20
+ id: z.string(),
21
+ items: z.array(z.object({ product: ProductSchema, amount: z.number() })),
22
+ cartTotal: z.number(),
23
+ cartDiscount: z.number(),
24
+ cartVat: z.number(),
25
+ }),
26
+ date: z.number(),
27
+ deliveryDate: z.number().optional(),
28
+ client: ProfileSchema,
29
+ address: AddressSchema,
30
+ });
@@ -0,0 +1,30 @@
1
+ import { z } from "zod";
2
+ export declare const PaymentSchema: z.ZodObject<{
3
+ id: z.ZodString;
4
+ orderId: z.ZodString;
5
+ amount: z.ZodNumber;
6
+ method: z.ZodEnum<["credit_card", "paypal", "bank_transfer"]>;
7
+ status: z.ZodDefault<z.ZodEnum<["pending", "completed", "failed"]>>;
8
+ transactionId: z.ZodOptional<z.ZodString>;
9
+ createdAt: z.ZodDefault<z.ZodDate>;
10
+ updatedAt: z.ZodOptional<z.ZodDate>;
11
+ }, "strip", z.ZodTypeAny, {
12
+ status: "pending" | "completed" | "failed";
13
+ id: string;
14
+ amount: number;
15
+ orderId: string;
16
+ method: "credit_card" | "paypal" | "bank_transfer";
17
+ createdAt: Date;
18
+ transactionId?: string | undefined;
19
+ updatedAt?: Date | undefined;
20
+ }, {
21
+ id: string;
22
+ amount: number;
23
+ orderId: string;
24
+ method: "credit_card" | "paypal" | "bank_transfer";
25
+ status?: "pending" | "completed" | "failed" | undefined;
26
+ transactionId?: string | undefined;
27
+ createdAt?: Date | undefined;
28
+ updatedAt?: Date | undefined;
29
+ }>;
30
+ //# sourceMappingURL=Payment.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Payment.d.ts","sourceRoot":"","sources":["../../lib/entities/Payment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;EASxB,CAAC"}
@@ -0,0 +1,12 @@
1
+ import { z } from "zod";
2
+ // 7. Payment Schema
3
+ export const PaymentSchema = z.object({
4
+ id: z.string().uuid(),
5
+ orderId: z.string().uuid(), // Reference to Order ID
6
+ amount: z.number().positive({ message: "Amount must be a positive number." }),
7
+ method: z.enum(["credit_card", "paypal", "bank_transfer"]),
8
+ status: z.enum(["pending", "completed", "failed"]).default("pending"),
9
+ transactionId: z.string().optional(),
10
+ createdAt: z.date().default(new Date()),
11
+ updatedAt: z.date().optional(),
12
+ });