@jsdev_ninja/core 0.14.7 → 0.14.9

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,97 @@
1
+ import { z } from "zod";
2
+ export declare const BudgetTransactionTypeSchema: z.ZodEnum<["delivery_note", "payment_received", "credit_note", "debit_note", "order_created", "order_cancelled", "order_refunded"]>;
3
+ export declare const PaymentMethodSchema: z.ZodEnum<["check", "bank_transfer", "cash", "credit_card", "other"]>;
4
+ export declare const BudgetTransactionSchema: z.ZodObject<{
5
+ id: z.ZodString;
6
+ type: z.ZodEnum<["delivery_note", "payment_received", "credit_note", "debit_note", "order_created", "order_cancelled", "order_refunded"]>;
7
+ debt: z.ZodNumber;
8
+ runningBalance: z.ZodNumber;
9
+ orderId: z.ZodNullable<z.ZodString>;
10
+ orderTotal: z.ZodNullable<z.ZodNumber>;
11
+ deliveryNoteId: z.ZodNullable<z.ZodString>;
12
+ deliveryNoteNumber: z.ZodNullable<z.ZodString>;
13
+ billingAccountId: z.ZodNullable<z.ZodString>;
14
+ billingAccountName: z.ZodNullable<z.ZodString>;
15
+ billingAccountNumber: z.ZodNullable<z.ZodString>;
16
+ paymentReference: z.ZodNullable<z.ZodString>;
17
+ paymentDate: z.ZodNullable<z.ZodNumber>;
18
+ paymentMethod: z.ZodNullable<z.ZodEnum<["check", "bank_transfer", "cash", "credit_card", "other"]>>;
19
+ note: z.ZodNullable<z.ZodString>;
20
+ createdAt: z.ZodNumber;
21
+ createdBy: z.ZodString;
22
+ }, "strip", z.ZodTypeAny, {
23
+ type: "delivery_note" | "payment_received" | "credit_note" | "debit_note" | "order_created" | "order_cancelled" | "order_refunded";
24
+ id: string;
25
+ createdAt: number;
26
+ createdBy: string;
27
+ debt: number;
28
+ runningBalance: number;
29
+ orderId: string | null;
30
+ orderTotal: number | null;
31
+ deliveryNoteId: string | null;
32
+ deliveryNoteNumber: string | null;
33
+ billingAccountId: string | null;
34
+ billingAccountName: string | null;
35
+ billingAccountNumber: string | null;
36
+ paymentReference: string | null;
37
+ paymentDate: number | null;
38
+ paymentMethod: "check" | "bank_transfer" | "cash" | "credit_card" | "other" | null;
39
+ note: string | null;
40
+ }, {
41
+ type: "delivery_note" | "payment_received" | "credit_note" | "debit_note" | "order_created" | "order_cancelled" | "order_refunded";
42
+ id: string;
43
+ createdAt: number;
44
+ createdBy: string;
45
+ debt: number;
46
+ runningBalance: number;
47
+ orderId: string | null;
48
+ orderTotal: number | null;
49
+ deliveryNoteId: string | null;
50
+ deliveryNoteNumber: string | null;
51
+ billingAccountId: string | null;
52
+ billingAccountName: string | null;
53
+ billingAccountNumber: string | null;
54
+ paymentReference: string | null;
55
+ paymentDate: number | null;
56
+ paymentMethod: "check" | "bank_transfer" | "cash" | "credit_card" | "other" | null;
57
+ note: string | null;
58
+ }>;
59
+ export declare const BudgetAccountSchema: z.ZodObject<{
60
+ id: z.ZodString;
61
+ organizationId: z.ZodString;
62
+ organizationName: z.ZodString;
63
+ companyId: z.ZodString;
64
+ storeId: z.ZodString;
65
+ totalDebits: z.ZodNumber;
66
+ totalCredits: z.ZodNumber;
67
+ balance: z.ZodNumber;
68
+ currency: z.ZodLiteral<"ILS">;
69
+ updatedAt: z.ZodNumber;
70
+ }, "strip", z.ZodTypeAny, {
71
+ id: string;
72
+ companyId: string;
73
+ storeId: string;
74
+ currency: "ILS";
75
+ organizationId: string;
76
+ updatedAt: number;
77
+ organizationName: string;
78
+ totalDebits: number;
79
+ totalCredits: number;
80
+ balance: number;
81
+ }, {
82
+ id: string;
83
+ companyId: string;
84
+ storeId: string;
85
+ currency: "ILS";
86
+ organizationId: string;
87
+ updatedAt: number;
88
+ organizationName: string;
89
+ totalDebits: number;
90
+ totalCredits: number;
91
+ balance: number;
92
+ }>;
93
+ export type TBudgetTransactionType = z.infer<typeof BudgetTransactionTypeSchema>;
94
+ export type TPaymentMethod = z.infer<typeof PaymentMethodSchema>;
95
+ export type TBudgetTransaction = z.infer<typeof BudgetTransactionSchema>;
96
+ export type TBudgetAccount = z.infer<typeof BudgetAccountSchema>;
97
+ //# sourceMappingURL=Budget.d.ts.map
@@ -0,0 +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,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"}
@@ -0,0 +1,47 @@
1
+ import { z } from "zod";
2
+ export const BudgetTransactionTypeSchema = z.enum([
3
+ "delivery_note",
4
+ "payment_received",
5
+ "credit_note",
6
+ "debit_note",
7
+ "order_created", // legacy — no longer used for new transactions
8
+ "order_cancelled", // legacy
9
+ "order_refunded", // legacy
10
+ ]);
11
+ export const PaymentMethodSchema = z.enum(["check", "bank_transfer", "cash", "credit_card", "other"]);
12
+ export const BudgetTransactionSchema = z.object({
13
+ id: z.string(),
14
+ type: BudgetTransactionTypeSchema,
15
+ // positive = debt added (delivery note / debit note), negative = debt reduced (payment / credit)
16
+ debt: z.number(),
17
+ runningBalance: z.number(),
18
+ // order reference
19
+ orderId: z.string().nullable(),
20
+ orderTotal: z.number().nullable(),
21
+ // delivery note reference (for delivery_note type)
22
+ deliveryNoteId: z.string().nullable(),
23
+ deliveryNoteNumber: z.string().nullable(),
24
+ // billing account snapshot (if order had one)
25
+ billingAccountId: z.string().nullable(),
26
+ billingAccountName: z.string().nullable(),
27
+ billingAccountNumber: z.string().nullable(),
28
+ // payment details (for payment_received type — entered by admin)
29
+ paymentReference: z.string().nullable(), // check number, bank transfer ref, etc.
30
+ paymentDate: z.number().nullable(), // timestamp
31
+ paymentMethod: PaymentMethodSchema.nullable(),
32
+ note: z.string().nullable(),
33
+ createdAt: z.number(),
34
+ createdBy: z.string(), // userId or "system"
35
+ });
36
+ export const BudgetAccountSchema = z.object({
37
+ id: z.string(), // organizationId
38
+ organizationId: z.string(),
39
+ organizationName: z.string(),
40
+ companyId: z.string(),
41
+ storeId: z.string(),
42
+ totalDebits: z.number(), // sum of delivery note amounts
43
+ totalCredits: z.number(), // sum of payments received
44
+ balance: z.number(), // totalDebits - totalCredits (positive = owes money)
45
+ currency: z.literal("ILS"),
46
+ updatedAt: z.number(),
47
+ });
@@ -17,4 +17,5 @@ export * from "./Payment";
17
17
  export * from "./Supplier";
18
18
  export * from "./SupplierInvoice";
19
19
  export * from "./Chatbot";
20
+ export * from "./Budget";
20
21
  //# 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;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,mBAAmB,CAAC;AAClC,cAAc,WAAW,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;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,mBAAmB,CAAC;AAClC,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC"}
@@ -17,3 +17,4 @@ export * from "./Payment";
17
17
  export * from "./Supplier";
18
18
  export * from "./SupplierInvoice";
19
19
  export * from "./Chatbot";
20
+ export * from "./Budget";
@@ -21,6 +21,8 @@ export declare const storeCollections: {
21
21
  readonly chatSessions: "chatSessions";
22
22
  readonly chatSessionMessages: "chatSessionMessages";
23
23
  readonly contactSubmissions: "contactSubmissions";
24
+ readonly budgetAccounts: "budgetAccounts";
25
+ readonly budgetTransactions: "budgetTransactions";
24
26
  };
25
27
  export declare const FirestoreApi: {
26
28
  systemCollections: {
@@ -46,6 +48,8 @@ export declare const FirestoreApi: {
46
48
  readonly chatSessions: "chatSessions";
47
49
  readonly chatSessionMessages: "chatSessionMessages";
48
50
  readonly contactSubmissions: "contactSubmissions";
51
+ readonly budgetAccounts: "budgetAccounts";
52
+ readonly budgetTransactions: "budgetTransactions";
49
53
  };
50
54
  getPath: ({ companyId, storeId, collectionName, id, }: {
51
55
  companyId: string;
@@ -89,6 +93,8 @@ export declare const FirebaseAPI: {
89
93
  readonly chatSessions: "chatSessions";
90
94
  readonly chatSessionMessages: "chatSessionMessages";
91
95
  readonly contactSubmissions: "contactSubmissions";
96
+ readonly budgetAccounts: "budgetAccounts";
97
+ readonly budgetTransactions: "budgetTransactions";
92
98
  };
93
99
  getPath: ({ companyId, storeId, collectionName, id, }: {
94
100
  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;;;;;;;;;;;;;;;;;;;CAmBnB,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;wFAUE;QACF,SAAS,EAAE,MAAM,CAAC;QAClB,OAAO,EAAE,MAAM,CAAC;QAChB,cAAc,EAAE,MAAM,OAAO,gBAAgB,CAAC;QAC9C,iBAAiB,EAAE,MAAM,OAAO,gBAAgB,CAAC;QACjD,EAAE,EAAE,MAAM,CAAC;QACX,KAAK,CAAC,EAAE,MAAM,CAAC;KACf;iCAI4B,MAAM,OAAO,gBAAgB;oCAIzC,MAAM,OAAO,gBAAgB,MACzC,MAAM,qBACS,MAAM,OAAO,gBAAgB;CAIjD,CAAC;AAEF,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;+DAtCpB;YACF,SAAS,EAAE,MAAM,CAAC;YAClB,OAAO,EAAE,M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CpB;YACF,SAAS,EAAE,MAAM,CAAC;YAClB,OAAO,EAAE,MAAM,CAAC;YAChB,cAAc,EAAE,MAAM,OAAO,gBAAgB,CAAC;YAC9C,EAAE,CAAC,EAAE,MAAM,CAAC;SACZ;4FAUE;YACF,SAAS,EAAE,MAAM,CAAC;YAClB,OAAO,EAAE,MAAM,CAAC;YAChB,cAAc,EAAE,MAAM,OAAO,gBAAgB,CAAC;YAC9C,iBAAiB,EAAE,MAAM,OAAO,gBAAgB,CAAC;YACjD,EAAE,EAAE,MAAM,CAAC;YACX,KAAK,CAAC,EAAE,MAAM,CAAC;SACf;qCAI4B,MAAM,OAAO,gBAAgB;wCAIzC,MAAM,OAAO,gBAAgB,MACzC,MAAM,qBACS,MAAM,OAAO,gBAAgB;;CAQjD,CAAC"}
@@ -21,6 +21,8 @@ export const storeCollections = {
21
21
  chatSessions: "chatSessions",
22
22
  chatSessionMessages: "chatSessionMessages",
23
23
  contactSubmissions: "contactSubmissions",
24
+ budgetAccounts: "budgetAccounts",
25
+ budgetTransactions: "budgetTransactions",
24
26
  };
25
27
  export const FirestoreApi = {
26
28
  systemCollections,