@jsdev_ninja/core 0.23.0 → 0.24.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.
- package/dist/core.cjs +1 -1
- package/dist/core.cjs.map +1 -1
- package/dist/core.es.js +667 -634
- package/dist/core.es.js.map +1 -1
- package/dist/core.umd.js +1 -1
- package/dist/core.umd.js.map +1 -1
- package/dist/lib/entities/CreditNote.d.ts +75 -0
- package/dist/lib/entities/CreditNote.d.ts.map +1 -0
- package/dist/lib/entities/CreditNote.js +40 -0
- package/dist/lib/entities/OrganizationBalance.d.ts +8 -8
- package/dist/lib/entities/OrganizationBalance.js +2 -2
- package/dist/lib/entities/index.d.ts +1 -0
- package/dist/lib/entities/index.d.ts.map +1 -1
- package/dist/lib/entities/index.js +1 -0
- package/dist/lib/firebase-api/index.d.ts +3 -0
- package/dist/lib/firebase-api/index.d.ts.map +1 -1
- package/dist/lib/firebase-api/index.js +1 -0
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const CreditNoteSchema: z.ZodObject<{
|
|
3
|
+
/** = deterministic doc id, derived from idempotencyKey */
|
|
4
|
+
id: z.ZodString;
|
|
5
|
+
/** EZcount doc_number */
|
|
6
|
+
number: z.ZodString;
|
|
7
|
+
/** EZcount doc_uuid */
|
|
8
|
+
docUuid: z.ZodString;
|
|
9
|
+
/** EZcount pdf_link */
|
|
10
|
+
pdfLink: z.ZodString;
|
|
11
|
+
/** EZcount pdf_link_copy */
|
|
12
|
+
pdfLinkCopy: z.ZodOptional<z.ZodString>;
|
|
13
|
+
organizationId: z.ZodString;
|
|
14
|
+
billingAccountId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
15
|
+
/** Set when the credit note is linked to an existing invoice's order */
|
|
16
|
+
orderId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
17
|
+
invoiceDocUuid: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
18
|
+
invoiceNumber: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
19
|
+
/** Integer agorot (1 ILS = 100 agorot), always positive; gross amount incl. VAT */
|
|
20
|
+
amount: z.ZodNumber;
|
|
21
|
+
currency: z.ZodLiteral<"ILS">;
|
|
22
|
+
/** Hebrew reason label */
|
|
23
|
+
reason: z.ZodString;
|
|
24
|
+
note: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
25
|
+
/** Epoch millis */
|
|
26
|
+
creditDate: z.ZodNumber;
|
|
27
|
+
/** Epoch millis */
|
|
28
|
+
createdAt: z.ZodNumber;
|
|
29
|
+
/** Admin uid */
|
|
30
|
+
createdBy: z.ZodString;
|
|
31
|
+
companyId: z.ZodString;
|
|
32
|
+
storeId: z.ZodString;
|
|
33
|
+
}, "strip", z.ZodTypeAny, {
|
|
34
|
+
number: string;
|
|
35
|
+
id: string;
|
|
36
|
+
companyId: string;
|
|
37
|
+
storeId: string;
|
|
38
|
+
currency: "ILS";
|
|
39
|
+
amount: number;
|
|
40
|
+
organizationId: string;
|
|
41
|
+
createdAt: number;
|
|
42
|
+
createdBy: string;
|
|
43
|
+
docUuid: string;
|
|
44
|
+
pdfLink: string;
|
|
45
|
+
reason: string;
|
|
46
|
+
creditDate: number;
|
|
47
|
+
invoiceNumber?: string | null | undefined;
|
|
48
|
+
billingAccountId?: string | null | undefined;
|
|
49
|
+
pdfLinkCopy?: string | undefined;
|
|
50
|
+
orderId?: string | null | undefined;
|
|
51
|
+
invoiceDocUuid?: string | null | undefined;
|
|
52
|
+
note?: string | null | undefined;
|
|
53
|
+
}, {
|
|
54
|
+
number: string;
|
|
55
|
+
id: string;
|
|
56
|
+
companyId: string;
|
|
57
|
+
storeId: string;
|
|
58
|
+
currency: "ILS";
|
|
59
|
+
amount: number;
|
|
60
|
+
organizationId: string;
|
|
61
|
+
createdAt: number;
|
|
62
|
+
createdBy: string;
|
|
63
|
+
docUuid: string;
|
|
64
|
+
pdfLink: string;
|
|
65
|
+
reason: string;
|
|
66
|
+
creditDate: number;
|
|
67
|
+
invoiceNumber?: string | null | undefined;
|
|
68
|
+
billingAccountId?: string | null | undefined;
|
|
69
|
+
pdfLinkCopy?: string | undefined;
|
|
70
|
+
orderId?: string | null | undefined;
|
|
71
|
+
invoiceDocUuid?: string | null | undefined;
|
|
72
|
+
note?: string | null | undefined;
|
|
73
|
+
}>;
|
|
74
|
+
export type TCreditNote = z.infer<typeof CreditNoteSchema>;
|
|
75
|
+
//# sourceMappingURL=CreditNote.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CreditNote.d.ts","sourceRoot":"","sources":["../../../lib/entities/CreditNote.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAUxB,eAAO,MAAM,gBAAgB;IAC5B,0DAA0D;;IAE1D,yBAAyB;;IAEzB,uBAAuB;;IAEvB,uBAAuB;;IAEvB,4BAA4B;;;;IAI5B,wEAAwE;;;;IAIxE,mFAAmF;;;IAGnF,0BAA0B;;;IAG1B,mBAAmB;;IAEnB,mBAAmB;;IAEnB,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAIf,CAAC;AAEH,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
// ---------------------------------------------------------------------------
|
|
3
|
+
// Credit note (תעודת זיכוי) — EZcount doc_type 330, AR-only effect
|
|
4
|
+
// ---------------------------------------------------------------------------
|
|
5
|
+
//
|
|
6
|
+
// May be standalone (no linked invoice) or linked to an existing invoice.
|
|
7
|
+
// A credit note ONLY reduces the organization's AR balance (organizationBalance).
|
|
8
|
+
// It never touches the cash ledger module.
|
|
9
|
+
export const CreditNoteSchema = z.object({
|
|
10
|
+
/** = deterministic doc id, derived from idempotencyKey */
|
|
11
|
+
id: z.string().min(1),
|
|
12
|
+
/** EZcount doc_number */
|
|
13
|
+
number: z.string().min(1),
|
|
14
|
+
/** EZcount doc_uuid */
|
|
15
|
+
docUuid: z.string().min(1),
|
|
16
|
+
/** EZcount pdf_link */
|
|
17
|
+
pdfLink: z.string().min(1),
|
|
18
|
+
/** EZcount pdf_link_copy */
|
|
19
|
+
pdfLinkCopy: z.string().optional(),
|
|
20
|
+
organizationId: z.string().min(1),
|
|
21
|
+
billingAccountId: z.string().nullish(),
|
|
22
|
+
/** Set when the credit note is linked to an existing invoice's order */
|
|
23
|
+
orderId: z.string().nullish(),
|
|
24
|
+
invoiceDocUuid: z.string().nullish(),
|
|
25
|
+
invoiceNumber: z.string().nullish(),
|
|
26
|
+
/** Integer agorot (1 ILS = 100 agorot), always positive; gross amount incl. VAT */
|
|
27
|
+
amount: z.number().int().positive(),
|
|
28
|
+
currency: z.literal("ILS"),
|
|
29
|
+
/** Hebrew reason label */
|
|
30
|
+
reason: z.string().min(1),
|
|
31
|
+
note: z.string().nullish(),
|
|
32
|
+
/** Epoch millis */
|
|
33
|
+
creditDate: z.number().int().positive(),
|
|
34
|
+
/** Epoch millis */
|
|
35
|
+
createdAt: z.number().int().positive(),
|
|
36
|
+
/** Admin uid */
|
|
37
|
+
createdBy: z.string().min(1),
|
|
38
|
+
companyId: z.string().min(1),
|
|
39
|
+
storeId: z.string().min(1),
|
|
40
|
+
});
|
|
@@ -9,18 +9,18 @@ export declare const OrganizationBalanceEntrySchema: z.ZodObject<{
|
|
|
9
9
|
/** Integer agorot, always positive; sign carries direction */
|
|
10
10
|
amount: z.ZodNumber;
|
|
11
11
|
currency: z.ZodLiteral<"ILS">;
|
|
12
|
-
source: z.ZodEnum<["delivery_note", "ledger_payment", "manual", "order_reversal"]>;
|
|
12
|
+
source: z.ZodEnum<["delivery_note", "ledger_payment", "manual", "order_reversal", "credit_note"]>;
|
|
13
13
|
/** Present for document-sourced accruals */
|
|
14
14
|
document: z.ZodOptional<z.ZodObject<{
|
|
15
|
-
type: z.ZodEnum<["delivery_note", "invoice"]>;
|
|
15
|
+
type: z.ZodEnum<["delivery_note", "invoice", "credit_note"]>;
|
|
16
16
|
id: z.ZodString;
|
|
17
17
|
number: z.ZodOptional<z.ZodString>;
|
|
18
18
|
}, "strip", z.ZodTypeAny, {
|
|
19
|
-
type: "invoice" | "delivery_note";
|
|
19
|
+
type: "invoice" | "delivery_note" | "credit_note";
|
|
20
20
|
id: string;
|
|
21
21
|
number?: string | undefined;
|
|
22
22
|
}, {
|
|
23
|
-
type: "invoice" | "delivery_note";
|
|
23
|
+
type: "invoice" | "delivery_note" | "credit_note";
|
|
24
24
|
id: string;
|
|
25
25
|
number?: string | undefined;
|
|
26
26
|
}>>;
|
|
@@ -53,14 +53,14 @@ export declare const OrganizationBalanceEntrySchema: z.ZodObject<{
|
|
|
53
53
|
amount: number;
|
|
54
54
|
organizationId: string;
|
|
55
55
|
createdAt: number;
|
|
56
|
-
source: "manual" | "delivery_note" | "ledger_payment" | "order_reversal";
|
|
56
|
+
source: "manual" | "delivery_note" | "credit_note" | "ledger_payment" | "order_reversal";
|
|
57
57
|
sign: "+" | "-";
|
|
58
58
|
kind: "accrual" | "settlement" | "adjustment";
|
|
59
59
|
dedupKey: string;
|
|
60
60
|
billingAccountId?: string | null | undefined;
|
|
61
61
|
causedByEventId?: string | undefined;
|
|
62
62
|
document?: {
|
|
63
|
-
type: "invoice" | "delivery_note";
|
|
63
|
+
type: "invoice" | "delivery_note" | "credit_note";
|
|
64
64
|
id: string;
|
|
65
65
|
number?: string | undefined;
|
|
66
66
|
} | undefined;
|
|
@@ -76,14 +76,14 @@ export declare const OrganizationBalanceEntrySchema: z.ZodObject<{
|
|
|
76
76
|
amount: number;
|
|
77
77
|
organizationId: string;
|
|
78
78
|
createdAt: number;
|
|
79
|
-
source: "manual" | "delivery_note" | "ledger_payment" | "order_reversal";
|
|
79
|
+
source: "manual" | "delivery_note" | "credit_note" | "ledger_payment" | "order_reversal";
|
|
80
80
|
sign: "+" | "-";
|
|
81
81
|
kind: "accrual" | "settlement" | "adjustment";
|
|
82
82
|
dedupKey: string;
|
|
83
83
|
billingAccountId?: string | null | undefined;
|
|
84
84
|
causedByEventId?: string | undefined;
|
|
85
85
|
document?: {
|
|
86
|
-
type: "invoice" | "delivery_note";
|
|
86
|
+
type: "invoice" | "delivery_note" | "credit_note";
|
|
87
87
|
id: string;
|
|
88
88
|
number?: string | undefined;
|
|
89
89
|
} | undefined;
|
|
@@ -12,11 +12,11 @@ export const OrganizationBalanceEntrySchema = z.object({
|
|
|
12
12
|
/** Integer agorot, always positive; sign carries direction */
|
|
13
13
|
amount: z.number().int().positive(),
|
|
14
14
|
currency: z.literal("ILS"),
|
|
15
|
-
source: z.enum(["delivery_note", "ledger_payment", "manual", "order_reversal"]),
|
|
15
|
+
source: z.enum(["delivery_note", "ledger_payment", "manual", "order_reversal", "credit_note"]),
|
|
16
16
|
/** Present for document-sourced accruals */
|
|
17
17
|
document: z
|
|
18
18
|
.object({
|
|
19
|
-
type: z.enum(["delivery_note", "invoice"]),
|
|
19
|
+
type: z.enum(["delivery_note", "invoice", "credit_note"]),
|
|
20
20
|
id: z.string().min(1),
|
|
21
21
|
number: z.string().optional(),
|
|
22
22
|
})
|
|
@@ -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,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,mBAAmB,CAAC;AAClC,cAAc,UAAU,CAAC;AACzB,cAAc,uBAAuB,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,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,mBAAmB,CAAC;AAClC,cAAc,UAAU,CAAC;AACzB,cAAc,uBAAuB,CAAC;AACtC,cAAc,cAAc,CAAC"}
|
|
@@ -30,6 +30,7 @@ export declare const storeCollections: {
|
|
|
30
30
|
readonly duplicateChargeAlerts: "duplicateChargeAlerts";
|
|
31
31
|
readonly organizationBalance: "organizationBalance";
|
|
32
32
|
readonly organizationBalanceRollup: "organizationBalanceRollup";
|
|
33
|
+
readonly creditNotes: "creditNotes";
|
|
33
34
|
};
|
|
34
35
|
export declare const FirestoreApi: {
|
|
35
36
|
systemCollections: {
|
|
@@ -64,6 +65,7 @@ export declare const FirestoreApi: {
|
|
|
64
65
|
readonly duplicateChargeAlerts: "duplicateChargeAlerts";
|
|
65
66
|
readonly organizationBalance: "organizationBalance";
|
|
66
67
|
readonly organizationBalanceRollup: "organizationBalanceRollup";
|
|
68
|
+
readonly creditNotes: "creditNotes";
|
|
67
69
|
};
|
|
68
70
|
getPath: ({ companyId, storeId, collectionName, id, }: {
|
|
69
71
|
companyId: string;
|
|
@@ -116,6 +118,7 @@ export declare const FirebaseAPI: {
|
|
|
116
118
|
readonly duplicateChargeAlerts: "duplicateChargeAlerts";
|
|
117
119
|
readonly organizationBalance: "organizationBalance";
|
|
118
120
|
readonly organizationBalanceRollup: "organizationBalanceRollup";
|
|
121
|
+
readonly creditNotes: "creditNotes";
|
|
119
122
|
};
|
|
120
123
|
getPath: ({ companyId, storeId, collectionName, id, }: {
|
|
121
124
|
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
|
|
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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6BnB,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,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"}
|
|
@@ -30,6 +30,7 @@ export const storeCollections = {
|
|
|
30
30
|
duplicateChargeAlerts: "duplicateChargeAlerts",
|
|
31
31
|
organizationBalance: "organizationBalance",
|
|
32
32
|
organizationBalanceRollup: "organizationBalanceRollup",
|
|
33
|
+
creditNotes: "creditNotes",
|
|
33
34
|
};
|
|
34
35
|
export const FirestoreApi = {
|
|
35
36
|
systemCollections,
|