@jsdev_ninja/core 0.14.8 → 0.15.0

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,13 +1,15 @@
1
1
  import { z } from "zod";
2
- export declare const BudgetTransactionTypeSchema: z.ZodEnum<["order_created", "payment_received", "order_cancelled", "order_refunded", "credit_note", "debit_note"]>;
2
+ export declare const BudgetTransactionTypeSchema: z.ZodEnum<["delivery_note", "payment_received", "credit_note", "debit_note", "order_created", "order_cancelled", "order_refunded"]>;
3
3
  export declare const PaymentMethodSchema: z.ZodEnum<["check", "bank_transfer", "cash", "credit_card", "other"]>;
4
4
  export declare const BudgetTransactionSchema: z.ZodObject<{
5
5
  id: z.ZodString;
6
- type: z.ZodEnum<["order_created", "payment_received", "order_cancelled", "order_refunded", "credit_note", "debit_note"]>;
6
+ type: z.ZodEnum<["delivery_note", "payment_received", "credit_note", "debit_note", "order_created", "order_cancelled", "order_refunded"]>;
7
7
  debt: z.ZodNumber;
8
8
  runningBalance: z.ZodNumber;
9
9
  orderId: z.ZodNullable<z.ZodString>;
10
10
  orderTotal: z.ZodNullable<z.ZodNumber>;
11
+ deliveryNoteId: z.ZodNullable<z.ZodString>;
12
+ deliveryNoteNumber: z.ZodNullable<z.ZodString>;
11
13
  billingAccountId: z.ZodNullable<z.ZodString>;
12
14
  billingAccountName: z.ZodNullable<z.ZodString>;
13
15
  billingAccountNumber: z.ZodNullable<z.ZodString>;
@@ -18,7 +20,7 @@ export declare const BudgetTransactionSchema: z.ZodObject<{
18
20
  createdAt: z.ZodNumber;
19
21
  createdBy: z.ZodString;
20
22
  }, "strip", z.ZodTypeAny, {
21
- type: "order_created" | "payment_received" | "order_cancelled" | "order_refunded" | "credit_note" | "debit_note";
23
+ type: "delivery_note" | "payment_received" | "credit_note" | "debit_note" | "order_created" | "order_cancelled" | "order_refunded";
22
24
  id: string;
23
25
  createdAt: number;
24
26
  createdBy: string;
@@ -26,6 +28,8 @@ export declare const BudgetTransactionSchema: z.ZodObject<{
26
28
  runningBalance: number;
27
29
  orderId: string | null;
28
30
  orderTotal: number | null;
31
+ deliveryNoteId: string | null;
32
+ deliveryNoteNumber: string | null;
29
33
  billingAccountId: string | null;
30
34
  billingAccountName: string | null;
31
35
  billingAccountNumber: string | null;
@@ -34,7 +38,7 @@ export declare const BudgetTransactionSchema: z.ZodObject<{
34
38
  paymentMethod: "check" | "bank_transfer" | "cash" | "credit_card" | "other" | null;
35
39
  note: string | null;
36
40
  }, {
37
- type: "order_created" | "payment_received" | "order_cancelled" | "order_refunded" | "credit_note" | "debit_note";
41
+ type: "delivery_note" | "payment_received" | "credit_note" | "debit_note" | "order_created" | "order_cancelled" | "order_refunded";
38
42
  id: string;
39
43
  createdAt: number;
40
44
  createdBy: string;
@@ -42,6 +46,8 @@ export declare const BudgetTransactionSchema: z.ZodObject<{
42
46
  runningBalance: number;
43
47
  orderId: string | null;
44
48
  orderTotal: number | null;
49
+ deliveryNoteId: string | null;
50
+ deliveryNoteNumber: string | null;
45
51
  billingAccountId: string | null;
46
52
  billingAccountName: string | null;
47
53
  billingAccountNumber: string | null;
@@ -1 +1 @@
1
- {"version":3,"file":"Budget.d.ts","sourceRoot":"","sources":["../../../lib/entities/Budget.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,2BAA2B,oHAOtC,CAAC;AAEH,eAAO,MAAM,mBAAmB,uEAAqE,CAAC;AAEtG,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA0BlC,CAAC;AAEH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAa9B,CAAC;AAEH,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AACjF,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AACjE,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AACzE,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC"}
1
+ {"version":3,"file":"Budget.d.ts","sourceRoot":"","sources":["../../../lib/entities/Budget.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,2BAA2B,qIAQtC,CAAC;AAEH,eAAO,MAAM,mBAAmB,uEAAqE,CAAC;AAEtG,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA8BlC,CAAC;AAEH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAa9B,CAAC;AAEH,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AACjF,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AACjE,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AACzE,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC"}
@@ -1,22 +1,26 @@
1
1
  import { z } from "zod";
2
2
  export const BudgetTransactionTypeSchema = z.enum([
3
- "order_created",
3
+ "delivery_note",
4
4
  "payment_received",
5
- "order_cancelled",
6
- "order_refunded",
7
5
  "credit_note",
8
6
  "debit_note",
7
+ "order_created", // legacy — no longer used for new transactions
8
+ "order_cancelled", // legacy
9
+ "order_refunded", // legacy
9
10
  ]);
10
11
  export const PaymentMethodSchema = z.enum(["check", "bank_transfer", "cash", "credit_card", "other"]);
11
12
  export const BudgetTransactionSchema = z.object({
12
13
  id: z.string(),
13
14
  type: BudgetTransactionTypeSchema,
14
- // positive = debt added (order/debit note), negative = debt reduced (payment/cancellation)
15
+ // positive = debt added (delivery note / debit note), negative = debt reduced (payment / credit)
15
16
  debt: z.number(),
16
17
  runningBalance: z.number(),
17
18
  // order reference
18
19
  orderId: z.string().nullable(),
19
20
  orderTotal: z.number().nullable(),
21
+ // delivery note reference (for delivery_note type)
22
+ deliveryNoteId: z.string().nullable(),
23
+ deliveryNoteNumber: z.string().nullable(),
20
24
  // billing account snapshot (if order had one)
21
25
  billingAccountId: z.string().nullable(),
22
26
  billingAccountName: z.string().nullable(),
@@ -35,7 +39,7 @@ export const BudgetAccountSchema = z.object({
35
39
  organizationName: z.string(),
36
40
  companyId: z.string(),
37
41
  storeId: z.string(),
38
- totalDebits: z.number(), // sum of order amounts
42
+ totalDebits: z.number(), // sum of delivery note amounts
39
43
  totalCredits: z.number(), // sum of payments received
40
44
  balance: z.number(), // totalDebits - totalCredits (positive = owes money)
41
45
  currency: z.literal("ILS"),
@@ -839,6 +839,7 @@ export declare const OrderSchema: z.ZodObject<{
839
839
  lastActivityDate: z.ZodNumber;
840
840
  paymentType: z.ZodOptional<z.ZodEnum<["external", "j5", "none"]>>;
841
841
  organizationId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
842
+ organizationIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
842
843
  }, "strip", z.ZodTypeAny, {
843
844
  type: "Profile";
844
845
  id: string;
@@ -864,6 +865,7 @@ export declare const OrderSchema: z.ZodObject<{
864
865
  } | undefined;
865
866
  paymentType?: "none" | "external" | "j5" | undefined;
866
867
  organizationId?: string | null | undefined;
868
+ organizationIds?: string[] | undefined;
867
869
  }, {
868
870
  type: "Profile";
869
871
  id: string;
@@ -889,6 +891,7 @@ export declare const OrderSchema: z.ZodObject<{
889
891
  } | undefined;
890
892
  paymentType?: "none" | "external" | "j5" | undefined;
891
893
  organizationId?: string | null | undefined;
894
+ organizationIds?: string[] | undefined;
892
895
  }>>;
893
896
  address: z.ZodOptional<z.ZodObject<{
894
897
  country: z.ZodOptional<z.ZodString>;
@@ -1504,6 +1507,7 @@ export declare const OrderSchema: z.ZodObject<{
1504
1507
  } | undefined;
1505
1508
  paymentType?: "none" | "external" | "j5" | undefined;
1506
1509
  organizationId?: string | null | undefined;
1510
+ organizationIds?: string[] | undefined;
1507
1511
  } | undefined;
1508
1512
  emailOnInvoice?: string | undefined;
1509
1513
  phoneNumberOnInvoice?: string | undefined;
@@ -1776,6 +1780,7 @@ export declare const OrderSchema: z.ZodObject<{
1776
1780
  } | undefined;
1777
1781
  paymentType?: "none" | "external" | "j5" | undefined;
1778
1782
  organizationId?: string | null | undefined;
1783
+ organizationIds?: string[] | undefined;
1779
1784
  } | undefined;
1780
1785
  emailOnInvoice?: string | undefined;
1781
1786
  phoneNumberOnInvoice?: string | undefined;
@@ -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;AAkBxB,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkDtB,CAAC;AAEH,MAAM,MAAM,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC"}
@@ -39,7 +39,10 @@ export declare const ProfileSchema: z.ZodObject<{
39
39
  createdDate: z.ZodNumber;
40
40
  lastActivityDate: z.ZodNumber;
41
41
  paymentType: z.ZodOptional<z.ZodEnum<["external", "j5", "none"]>>;
42
+ /** @deprecated Use organizationIds instead */
42
43
  organizationId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
44
+ /** Array of organization IDs this user belongs to */
45
+ organizationIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
43
46
  }, "strip", z.ZodTypeAny, {
44
47
  type: "Profile";
45
48
  id: string;
@@ -65,6 +68,7 @@ export declare const ProfileSchema: z.ZodObject<{
65
68
  } | undefined;
66
69
  paymentType?: "none" | "external" | "j5" | undefined;
67
70
  organizationId?: string | null | undefined;
71
+ organizationIds?: string[] | undefined;
68
72
  }, {
69
73
  type: "Profile";
70
74
  id: string;
@@ -90,6 +94,7 @@ export declare const ProfileSchema: z.ZodObject<{
90
94
  } | undefined;
91
95
  paymentType?: "none" | "external" | "j5" | undefined;
92
96
  organizationId?: string | null | undefined;
97
+ organizationIds?: string[] | undefined;
93
98
  }>;
94
99
  export type TProfile = z.infer<typeof ProfileSchema>;
95
100
  //# 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;AAKxB,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkBxB,CAAC;AAEH,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC"}
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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAiBzB,8CAA8C;;IAE9C,qDAAqD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAEpD,CAAC;AAEH,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC"}
@@ -19,5 +19,8 @@ export const ProfileSchema = z.object({
19
19
  createdDate: z.number(),
20
20
  lastActivityDate: z.number(), //todo
21
21
  paymentType: PaymentTypeSchema.optional(),
22
+ /** @deprecated Use organizationIds instead */
22
23
  organizationId: z.string().optional().nullable(),
24
+ /** Array of organization IDs this user belongs to */
25
+ organizationIds: z.array(z.string()).optional(),
23
26
  });