@powerhousedao/contributor-billing 0.0.33 → 0.0.35
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/document-models/invoice/gen/actions.d.ts +3 -1
- package/dist/document-models/invoice/gen/actions.d.ts.map +1 -1
- package/dist/document-models/invoice/gen/actions.js +1 -0
- package/dist/document-models/invoice/gen/creators.d.ts +1 -0
- package/dist/document-models/invoice/gen/creators.d.ts.map +1 -1
- package/dist/document-models/invoice/gen/creators.js +1 -0
- package/dist/document-models/invoice/gen/document-model.d.ts.map +1 -1
- package/dist/document-models/invoice/gen/document-model.js +167 -50
- package/dist/document-models/invoice/gen/general/actions.d.ts +4 -6
- package/dist/document-models/invoice/gen/general/actions.d.ts.map +1 -1
- package/dist/document-models/invoice/gen/general/creators.d.ts +4 -6
- package/dist/document-models/invoice/gen/general/creators.d.ts.map +1 -1
- package/dist/document-models/invoice/gen/general/creators.js +2 -4
- package/dist/document-models/invoice/gen/general/object.d.ts +3 -5
- package/dist/document-models/invoice/gen/general/object.d.ts.map +1 -1
- package/dist/document-models/invoice/gen/general/object.js +6 -12
- package/dist/document-models/invoice/gen/general/operations.d.ts +3 -5
- package/dist/document-models/invoice/gen/general/operations.d.ts.map +1 -1
- package/dist/document-models/invoice/gen/object.d.ts +3 -1
- package/dist/document-models/invoice/gen/object.d.ts.map +1 -1
- package/dist/document-models/invoice/gen/object.js +8 -1
- package/dist/document-models/invoice/gen/reducer.d.ts.map +1 -1
- package/dist/document-models/invoice/gen/reducer.js +56 -15
- package/dist/document-models/invoice/gen/schema/types.d.ts +89 -23
- package/dist/document-models/invoice/gen/schema/types.d.ts.map +1 -1
- package/dist/document-models/invoice/gen/schema/zod.d.ts +21 -7
- package/dist/document-models/invoice/gen/schema/zod.d.ts.map +1 -1
- package/dist/document-models/invoice/gen/schema/zod.js +124 -28
- package/dist/document-models/invoice/gen/transitions/actions.d.ts +16 -0
- package/dist/document-models/invoice/gen/transitions/actions.d.ts.map +1 -0
- package/dist/document-models/invoice/gen/transitions/actions.js +1 -0
- package/dist/document-models/invoice/gen/transitions/creators.d.ts +15 -0
- package/dist/document-models/invoice/gen/transitions/creators.d.ts.map +1 -0
- package/dist/document-models/invoice/gen/transitions/creators.js +14 -0
- package/dist/document-models/invoice/gen/transitions/error.d.ts +2 -0
- package/dist/document-models/invoice/gen/transitions/error.d.ts.map +1 -0
- package/dist/document-models/invoice/gen/transitions/error.js +1 -0
- package/dist/document-models/invoice/gen/transitions/object.d.ts +18 -0
- package/dist/document-models/invoice/gen/transitions/object.d.ts.map +1 -0
- package/dist/document-models/invoice/gen/transitions/object.js +40 -0
- package/dist/document-models/invoice/gen/transitions/operations.d.ts +18 -0
- package/dist/document-models/invoice/gen/transitions/operations.d.ts.map +1 -0
- package/dist/document-models/invoice/gen/transitions/operations.js +1 -0
- package/dist/document-models/invoice/gen/utils.d.ts.map +1 -1
- package/dist/document-models/invoice/gen/utils.js +10 -6
- package/dist/document-models/invoice/index.d.ts +14 -4
- package/dist/document-models/invoice/index.d.ts.map +1 -1
- package/dist/document-models/invoice/src/reducers/general.d.ts.map +1 -1
- package/dist/document-models/invoice/src/reducers/general.js +26 -42
- package/dist/document-models/invoice/src/reducers/transitions.d.ts +8 -0
- package/dist/document-models/invoice/src/reducers/transitions.d.ts.map +1 -0
- package/dist/document-models/invoice/src/reducers/transitions.js +162 -0
- package/dist/document-models/invoice/src/tests/general.test.js +10 -31
- package/dist/document-models/invoice/src/tests/transitions.test.d.ts +6 -0
- package/dist/document-models/invoice/src/tests/transitions.test.d.ts.map +1 -0
- package/dist/document-models/invoice/src/tests/transitions.test.js +506 -0
- package/dist/document-models/invoice/utils/statusTransitions.d.ts +13 -0
- package/dist/document-models/invoice/utils/statusTransitions.d.ts.map +1 -0
- package/dist/document-models/invoice/utils/statusTransitions.js +13 -0
- package/dist/editors/billing-statement/lineItemTags/tagMapping.js +64 -64
- package/dist/editors/contributor-billing/components/DriveExplorer.d.ts.map +1 -1
- package/dist/editors/contributor-billing/components/DriveExplorer.js +3 -2
- package/dist/editors/contributor-billing/components/InvoiceTable/HeaderControls.d.ts +3 -2
- package/dist/editors/contributor-billing/components/InvoiceTable/HeaderControls.d.ts.map +1 -1
- package/dist/editors/contributor-billing/components/InvoiceTable/HeaderControls.js +27 -3
- package/dist/editors/contributor-billing/components/InvoiceTable/InvoiceTable.d.ts +4 -4
- package/dist/editors/contributor-billing/components/InvoiceTable/InvoiceTable.d.ts.map +1 -1
- package/dist/editors/contributor-billing/components/InvoiceTable/InvoiceTable.js +91 -21
- package/dist/editors/contributor-billing/components/InvoiceTable/InvoiceTableRow.js +1 -1
- package/dist/editors/invoice/components/confirmationModal.d.ts +14 -0
- package/dist/editors/invoice/components/confirmationModal.d.ts.map +1 -0
- package/dist/editors/invoice/components/confirmationModal.js +7 -0
- package/dist/editors/invoice/components/selectField.d.ts.map +1 -1
- package/dist/editors/invoice/components/selectField.js +109 -112
- package/dist/editors/invoice/components/statusModalComponents.d.ts +52 -0
- package/dist/editors/invoice/components/statusModalComponents.d.ts.map +1 -0
- package/dist/editors/invoice/components/statusModalComponents.js +78 -0
- package/dist/editors/invoice/editor.d.ts +1 -1
- package/dist/editors/invoice/editor.d.ts.map +1 -1
- package/dist/editors/invoice/editor.js +153 -158
- package/dist/editors/invoice/ingestUBL.d.ts.map +1 -1
- package/dist/editors/invoice/ingestUBL.js +0 -3
- package/dist/editors/invoice/invoiceToGnosis.d.ts.map +1 -1
- package/dist/editors/invoice/invoiceToGnosis.js +4 -3
- package/dist/editors/invoice/lineItemTags/tagMapping.d.ts.map +1 -1
- package/dist/editors/invoice/lineItemTags/tagMapping.js +65 -64
- package/dist/editors/invoice/requestFinance.d.ts +1 -0
- package/dist/editors/invoice/requestFinance.d.ts.map +1 -1
- package/dist/editors/invoice/requestFinance.js +9 -2
- package/dist/editors/invoice/validation/validationHandler.d.ts +4 -0
- package/dist/editors/invoice/validation/validationHandler.d.ts.map +1 -0
- package/dist/editors/invoice/validation/validationHandler.js +117 -0
- package/dist/scripts/contributor-billing/createXeroCsv.d.ts +8 -0
- package/dist/scripts/contributor-billing/createXeroCsv.d.ts.map +1 -0
- package/dist/scripts/contributor-billing/createXeroCsv.js +209 -0
- package/dist/style.css +164 -18
- package/dist/subgraphs/invoice/resolvers.d.ts.map +1 -1
- package/dist/subgraphs/invoice/resolvers.js +92 -22
- package/dist/subgraphs/invoice/schema.d.ts.map +1 -1
- package/dist/subgraphs/invoice/schema.js +181 -57
- package/package.json +1 -1
|
@@ -3,6 +3,16 @@ export const isDefinedNonNullAny = (v) => v !== undefined && v !== null;
|
|
|
3
3
|
export const definedNonNullAnySchema = z
|
|
4
4
|
.any()
|
|
5
5
|
.refine((v) => isDefinedNonNullAny(v));
|
|
6
|
+
export const ClosureReasonSchema = z.enum([
|
|
7
|
+
"CANCELLED",
|
|
8
|
+
"OVERPAID",
|
|
9
|
+
"UNDERPAID",
|
|
10
|
+
]);
|
|
11
|
+
export const ClosureReasonInputSchema = z.enum([
|
|
12
|
+
"CANCELLED",
|
|
13
|
+
"OVERPAID",
|
|
14
|
+
"UNDERPAID",
|
|
15
|
+
]);
|
|
6
16
|
export const InvoiceAccountTypeSchema = z.enum([
|
|
7
17
|
"CHECKING",
|
|
8
18
|
"SAVINGS",
|
|
@@ -17,16 +27,21 @@ export const InvoiceAccountTypeInputSchema = z.enum([
|
|
|
17
27
|
]);
|
|
18
28
|
export const StatusSchema = z.enum([
|
|
19
29
|
"ACCEPTED",
|
|
20
|
-
"AWAITINGPAYMENT",
|
|
21
30
|
"CANCELLED",
|
|
22
31
|
"DRAFT",
|
|
23
32
|
"ISSUED",
|
|
33
|
+
"PAYMENTCLOSED",
|
|
24
34
|
"PAYMENTISSUE",
|
|
25
35
|
"PAYMENTRECEIVED",
|
|
26
36
|
"PAYMENTSCHEDULED",
|
|
27
37
|
"PAYMENTSENT",
|
|
28
38
|
"REJECTED",
|
|
29
39
|
]);
|
|
40
|
+
export function AcceptInputSchema() {
|
|
41
|
+
return z.object({
|
|
42
|
+
payAfter: z.string().datetime().nullish(),
|
|
43
|
+
});
|
|
44
|
+
}
|
|
30
45
|
export function AddLineItemInputSchema() {
|
|
31
46
|
return z.object({
|
|
32
47
|
currency: z.string(),
|
|
@@ -40,10 +55,14 @@ export function AddLineItemInputSchema() {
|
|
|
40
55
|
unitPriceTaxIncl: z.number(),
|
|
41
56
|
});
|
|
42
57
|
}
|
|
43
|
-
export function
|
|
58
|
+
export function AddPaymentInputSchema() {
|
|
44
59
|
return z.object({
|
|
60
|
+
confirmed: z.boolean(),
|
|
45
61
|
id: z.string(),
|
|
46
|
-
|
|
62
|
+
issue: z.string().nullish(),
|
|
63
|
+
paymentDate: z.string().datetime().nullish(),
|
|
64
|
+
processorRef: z.string().nullish(),
|
|
65
|
+
txnRef: z.string().nullish(),
|
|
47
66
|
});
|
|
48
67
|
}
|
|
49
68
|
export function AddressSchema() {
|
|
@@ -72,6 +91,22 @@ export function BankSchema() {
|
|
|
72
91
|
name: z.string(),
|
|
73
92
|
});
|
|
74
93
|
}
|
|
94
|
+
export function CancelInputSchema() {
|
|
95
|
+
return z.object({
|
|
96
|
+
_placeholder: z.string().nullish(),
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
export function ClosePaymentInputSchema() {
|
|
100
|
+
return z.object({
|
|
101
|
+
closureReason: z.lazy(() => ClosureReasonInputSchema.nullish()),
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
export function ConfirmPaymentInputSchema() {
|
|
105
|
+
return z.object({
|
|
106
|
+
amount: z.number(),
|
|
107
|
+
id: z.string(),
|
|
108
|
+
});
|
|
109
|
+
}
|
|
75
110
|
export function ContactInfoSchema() {
|
|
76
111
|
return z.object({
|
|
77
112
|
__typename: z.literal("ContactInfo").optional(),
|
|
@@ -84,15 +119,9 @@ export function DeleteLineItemInputSchema() {
|
|
|
84
119
|
id: z.string(),
|
|
85
120
|
});
|
|
86
121
|
}
|
|
87
|
-
export function DeleteRefInputSchema() {
|
|
88
|
-
return z.object({
|
|
89
|
-
id: z.string(),
|
|
90
|
-
});
|
|
91
|
-
}
|
|
92
122
|
export function EditInvoiceInputSchema() {
|
|
93
123
|
return z.object({
|
|
94
124
|
currency: z.string().nullish(),
|
|
95
|
-
dateDelivered: z.string().nullish(),
|
|
96
125
|
dateDue: z.string().nullish(),
|
|
97
126
|
dateIssued: z.string().nullish(),
|
|
98
127
|
invoiceNo: z.string().nullish(),
|
|
@@ -222,14 +251,12 @@ export function EditPayerWalletInputSchema() {
|
|
|
222
251
|
}
|
|
223
252
|
export function EditPaymentDataInputSchema() {
|
|
224
253
|
return z.object({
|
|
225
|
-
|
|
226
|
-
txnHash: z.string().nullish(),
|
|
227
|
-
});
|
|
228
|
-
}
|
|
229
|
-
export function EditRefInputSchema() {
|
|
230
|
-
return z.object({
|
|
254
|
+
confirmed: z.boolean(),
|
|
231
255
|
id: z.string(),
|
|
232
|
-
|
|
256
|
+
issue: z.string().nullish(),
|
|
257
|
+
paymentDate: z.string().datetime().nullish(),
|
|
258
|
+
processorRef: z.string().nullish(),
|
|
259
|
+
txnRef: z.string().nullish(),
|
|
233
260
|
});
|
|
234
261
|
}
|
|
235
262
|
export function EditStatusInputSchema() {
|
|
@@ -237,6 +264,13 @@ export function EditStatusInputSchema() {
|
|
|
237
264
|
status: StatusSchema,
|
|
238
265
|
});
|
|
239
266
|
}
|
|
267
|
+
export function ExportedDataSchema() {
|
|
268
|
+
return z.object({
|
|
269
|
+
__typename: z.literal("ExportedData").optional(),
|
|
270
|
+
exportedLineItems: z.array(z.array(z.string())),
|
|
271
|
+
timestamp: z.string().datetime(),
|
|
272
|
+
});
|
|
273
|
+
}
|
|
240
274
|
export function IntermediaryBankSchema() {
|
|
241
275
|
return z.object({
|
|
242
276
|
__typename: z.literal("IntermediaryBank").optional(),
|
|
@@ -269,23 +303,24 @@ export function InvoiceLineItemSchema() {
|
|
|
269
303
|
export function InvoiceStateSchema() {
|
|
270
304
|
return z.object({
|
|
271
305
|
__typename: z.literal("InvoiceState").optional(),
|
|
306
|
+
closureReason: ClosureReasonSchema.nullable(),
|
|
272
307
|
currency: z.string(),
|
|
273
|
-
dateDelivered: z.string().nullable(),
|
|
274
|
-
dateDue: z.string(),
|
|
275
|
-
dateIssued: z.string(),
|
|
276
|
-
exported:
|
|
308
|
+
dateDelivered: z.string().datetime().nullable(),
|
|
309
|
+
dateDue: z.string().datetime(),
|
|
310
|
+
dateIssued: z.string().datetime(),
|
|
311
|
+
exported: ExportedDataSchema().nullable(),
|
|
277
312
|
invoiceNo: z.string(),
|
|
278
313
|
invoiceTags: z.array(InvoiceTagSchema()),
|
|
279
314
|
issuer: LegalEntitySchema(),
|
|
280
315
|
lineItems: z.array(InvoiceLineItemSchema()),
|
|
281
316
|
notes: z.string().nullable(),
|
|
317
|
+
payAfter: z.string().datetime().nullable(),
|
|
282
318
|
payer: LegalEntitySchema(),
|
|
283
|
-
|
|
284
|
-
|
|
319
|
+
payments: z.array(PaymentSchema()),
|
|
320
|
+
rejections: z.array(RejectionSchema()),
|
|
285
321
|
status: StatusSchema,
|
|
286
322
|
totalPriceTaxExcl: z.number(),
|
|
287
323
|
totalPriceTaxIncl: z.number(),
|
|
288
|
-
txnHash: z.string().nullable(),
|
|
289
324
|
});
|
|
290
325
|
}
|
|
291
326
|
export function InvoiceTagSchema() {
|
|
@@ -305,6 +340,12 @@ export function InvoiceWalletSchema() {
|
|
|
305
340
|
rpc: z.string().nullable(),
|
|
306
341
|
});
|
|
307
342
|
}
|
|
343
|
+
export function IssueInputSchema() {
|
|
344
|
+
return z.object({
|
|
345
|
+
dateIssued: z.string(),
|
|
346
|
+
invoiceNo: z.string(),
|
|
347
|
+
});
|
|
348
|
+
}
|
|
308
349
|
export function LegalEntitySchema() {
|
|
309
350
|
return z.object({
|
|
310
351
|
__typename: z.literal("LegalEntity").optional(),
|
|
@@ -334,6 +375,18 @@ export function LegalEntityTaxIdSchema() {
|
|
|
334
375
|
taxId: z.string(),
|
|
335
376
|
});
|
|
336
377
|
}
|
|
378
|
+
export function PaymentSchema() {
|
|
379
|
+
return z.object({
|
|
380
|
+
__typename: z.literal("Payment").optional(),
|
|
381
|
+
amount: z.number().nullable(),
|
|
382
|
+
confirmed: z.boolean(),
|
|
383
|
+
id: z.string(),
|
|
384
|
+
issue: z.string().nullable(),
|
|
385
|
+
paymentDate: z.string().datetime().nullable(),
|
|
386
|
+
processorRef: z.string().nullable(),
|
|
387
|
+
txnRef: z.string().nullable(),
|
|
388
|
+
});
|
|
389
|
+
}
|
|
337
390
|
export function PaymentRoutingSchema() {
|
|
338
391
|
return z.object({
|
|
339
392
|
__typename: z.literal("PaymentRouting").optional(),
|
|
@@ -341,16 +394,59 @@ export function PaymentRoutingSchema() {
|
|
|
341
394
|
wallet: InvoiceWalletSchema().nullable(),
|
|
342
395
|
});
|
|
343
396
|
}
|
|
344
|
-
export function
|
|
397
|
+
export function ReapprovePaymentInputSchema() {
|
|
398
|
+
return z.object({
|
|
399
|
+
_placeholder: z.string().nullish(),
|
|
400
|
+
});
|
|
401
|
+
}
|
|
402
|
+
export function RegisterPaymentTxInputSchema() {
|
|
345
403
|
return z.object({
|
|
346
|
-
__typename: z.literal("Ref").optional(),
|
|
347
404
|
id: z.string(),
|
|
348
|
-
|
|
405
|
+
timestamp: z.string().datetime(),
|
|
406
|
+
txRef: z.string(),
|
|
407
|
+
});
|
|
408
|
+
}
|
|
409
|
+
export function ReinstateInputSchema() {
|
|
410
|
+
return z.object({
|
|
411
|
+
_placeholder: z.string().nullish(),
|
|
412
|
+
});
|
|
413
|
+
}
|
|
414
|
+
export function RejectInputSchema() {
|
|
415
|
+
return z.object({
|
|
416
|
+
final: z.boolean(),
|
|
417
|
+
id: z.string(),
|
|
418
|
+
reason: z.string(),
|
|
419
|
+
});
|
|
420
|
+
}
|
|
421
|
+
export function RejectionSchema() {
|
|
422
|
+
return z.object({
|
|
423
|
+
__typename: z.literal("Rejection").optional(),
|
|
424
|
+
final: z.boolean(),
|
|
425
|
+
id: z.string(),
|
|
426
|
+
reason: z.string(),
|
|
427
|
+
});
|
|
428
|
+
}
|
|
429
|
+
export function ReportPaymentIssueInputSchema() {
|
|
430
|
+
return z.object({
|
|
431
|
+
id: z.string(),
|
|
432
|
+
issue: z.string(),
|
|
433
|
+
});
|
|
434
|
+
}
|
|
435
|
+
export function ResetInputSchema() {
|
|
436
|
+
return z.object({
|
|
437
|
+
_placeholder: z.string().nullish(),
|
|
438
|
+
});
|
|
439
|
+
}
|
|
440
|
+
export function SchedulePaymentInputSchema() {
|
|
441
|
+
return z.object({
|
|
442
|
+
id: z.string(),
|
|
443
|
+
processorRef: z.string(),
|
|
349
444
|
});
|
|
350
445
|
}
|
|
351
|
-
export function
|
|
446
|
+
export function SetExportedDataInputSchema() {
|
|
352
447
|
return z.object({
|
|
353
|
-
|
|
448
|
+
exportedLineItems: z.array(z.array(z.string())),
|
|
449
|
+
timestamp: z.string().datetime(),
|
|
354
450
|
});
|
|
355
451
|
}
|
|
356
452
|
export function SetInvoiceTagInputSchema() {
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type BaseAction } from "document-model";
|
|
2
|
+
import type { CancelInput, IssueInput, ResetInput, RejectInput, AcceptInput, ReinstateInput, SchedulePaymentInput, ReapprovePaymentInput, RegisterPaymentTxInput, ReportPaymentIssueInput, ConfirmPaymentInput, ClosePaymentInput } from "../types.js";
|
|
3
|
+
export type CancelAction = BaseAction<"CANCEL", CancelInput, "global">;
|
|
4
|
+
export type IssueAction = BaseAction<"ISSUE", IssueInput, "global">;
|
|
5
|
+
export type ResetAction = BaseAction<"RESET", ResetInput, "global">;
|
|
6
|
+
export type RejectAction = BaseAction<"REJECT", RejectInput, "global">;
|
|
7
|
+
export type AcceptAction = BaseAction<"ACCEPT", AcceptInput, "global">;
|
|
8
|
+
export type ReinstateAction = BaseAction<"REINSTATE", ReinstateInput, "global">;
|
|
9
|
+
export type SchedulePaymentAction = BaseAction<"SCHEDULE_PAYMENT", SchedulePaymentInput, "global">;
|
|
10
|
+
export type ReapprovePaymentAction = BaseAction<"REAPPROVE_PAYMENT", ReapprovePaymentInput, "global">;
|
|
11
|
+
export type RegisterPaymentTxAction = BaseAction<"REGISTER_PAYMENT_TX", RegisterPaymentTxInput, "global">;
|
|
12
|
+
export type ReportPaymentIssueAction = BaseAction<"REPORT_PAYMENT_ISSUE", ReportPaymentIssueInput, "global">;
|
|
13
|
+
export type ConfirmPaymentAction = BaseAction<"CONFIRM_PAYMENT", ConfirmPaymentInput, "global">;
|
|
14
|
+
export type ClosePaymentAction = BaseAction<"CLOSE_PAYMENT", ClosePaymentInput, "global">;
|
|
15
|
+
export type InvoiceTransitionsAction = CancelAction | IssueAction | ResetAction | RejectAction | AcceptAction | ReinstateAction | SchedulePaymentAction | ReapprovePaymentAction | RegisterPaymentTxAction | ReportPaymentIssueAction | ConfirmPaymentAction | ClosePaymentAction;
|
|
16
|
+
//# sourceMappingURL=actions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../../../../../document-models/invoice/gen/transitions/actions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,KAAK,EACV,WAAW,EACX,UAAU,EACV,UAAU,EACV,WAAW,EACX,WAAW,EACX,cAAc,EACd,oBAAoB,EACpB,qBAAqB,EACrB,sBAAsB,EACtB,uBAAuB,EACvB,mBAAmB,EACnB,iBAAiB,EAClB,MAAM,aAAa,CAAC;AAErB,MAAM,MAAM,YAAY,GAAG,UAAU,CAAC,QAAQ,EAAE,WAAW,EAAE,QAAQ,CAAC,CAAC;AACvE,MAAM,MAAM,WAAW,GAAG,UAAU,CAAC,OAAO,EAAE,UAAU,EAAE,QAAQ,CAAC,CAAC;AACpE,MAAM,MAAM,WAAW,GAAG,UAAU,CAAC,OAAO,EAAE,UAAU,EAAE,QAAQ,CAAC,CAAC;AACpE,MAAM,MAAM,YAAY,GAAG,UAAU,CAAC,QAAQ,EAAE,WAAW,EAAE,QAAQ,CAAC,CAAC;AACvE,MAAM,MAAM,YAAY,GAAG,UAAU,CAAC,QAAQ,EAAE,WAAW,EAAE,QAAQ,CAAC,CAAC;AACvE,MAAM,MAAM,eAAe,GAAG,UAAU,CAAC,WAAW,EAAE,cAAc,EAAE,QAAQ,CAAC,CAAC;AAChF,MAAM,MAAM,qBAAqB,GAAG,UAAU,CAC5C,kBAAkB,EAClB,oBAAoB,EACpB,QAAQ,CACT,CAAC;AACF,MAAM,MAAM,sBAAsB,GAAG,UAAU,CAC7C,mBAAmB,EACnB,qBAAqB,EACrB,QAAQ,CACT,CAAC;AACF,MAAM,MAAM,uBAAuB,GAAG,UAAU,CAC9C,qBAAqB,EACrB,sBAAsB,EACtB,QAAQ,CACT,CAAC;AACF,MAAM,MAAM,wBAAwB,GAAG,UAAU,CAC/C,sBAAsB,EACtB,uBAAuB,EACvB,QAAQ,CACT,CAAC;AACF,MAAM,MAAM,oBAAoB,GAAG,UAAU,CAC3C,iBAAiB,EACjB,mBAAmB,EACnB,QAAQ,CACT,CAAC;AACF,MAAM,MAAM,kBAAkB,GAAG,UAAU,CACzC,eAAe,EACf,iBAAiB,EACjB,QAAQ,CACT,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAChC,YAAY,GACZ,WAAW,GACX,WAAW,GACX,YAAY,GACZ,YAAY,GACZ,eAAe,GACf,qBAAqB,GACrB,sBAAsB,GACtB,uBAAuB,GACvB,wBAAwB,GACxB,oBAAoB,GACpB,kBAAkB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type CancelInput, type IssueInput, type ResetInput, type RejectInput, type AcceptInput, type ReinstateInput, type SchedulePaymentInput, type ReapprovePaymentInput, type RegisterPaymentTxInput, type ReportPaymentIssueInput, type ConfirmPaymentInput, type ClosePaymentInput } from "../types.js";
|
|
2
|
+
import { type CancelAction, type IssueAction, type ResetAction, type RejectAction, type AcceptAction, type ReinstateAction, type SchedulePaymentAction, type ReapprovePaymentAction, type RegisterPaymentTxAction, type ReportPaymentIssueAction, type ConfirmPaymentAction, type ClosePaymentAction } from "./actions.js";
|
|
3
|
+
export declare const cancel: (input: CancelInput) => CancelAction;
|
|
4
|
+
export declare const issue: (input: IssueInput) => IssueAction;
|
|
5
|
+
export declare const reset: (input: ResetInput) => ResetAction;
|
|
6
|
+
export declare const reject: (input: RejectInput) => RejectAction;
|
|
7
|
+
export declare const accept: (input: AcceptInput) => AcceptAction;
|
|
8
|
+
export declare const reinstate: (input: ReinstateInput) => ReinstateAction;
|
|
9
|
+
export declare const schedulePayment: (input: SchedulePaymentInput) => SchedulePaymentAction;
|
|
10
|
+
export declare const reapprovePayment: (input: ReapprovePaymentInput) => ReapprovePaymentAction;
|
|
11
|
+
export declare const registerPaymentTx: (input: RegisterPaymentTxInput) => RegisterPaymentTxAction;
|
|
12
|
+
export declare const reportPaymentIssue: (input: ReportPaymentIssueInput) => ReportPaymentIssueAction;
|
|
13
|
+
export declare const confirmPayment: (input: ConfirmPaymentInput) => ConfirmPaymentAction;
|
|
14
|
+
export declare const closePayment: (input: ClosePaymentInput) => ClosePaymentAction;
|
|
15
|
+
//# sourceMappingURL=creators.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"creators.d.ts","sourceRoot":"","sources":["../../../../../document-models/invoice/gen/transitions/creators.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,KAAK,UAAU,EACf,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,KAAK,cAAc,EACnB,KAAK,oBAAoB,EACzB,KAAK,qBAAqB,EAC1B,KAAK,sBAAsB,EAC3B,KAAK,uBAAuB,EAC5B,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACvB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,KAAK,YAAY,EACjB,KAAK,YAAY,EACjB,KAAK,eAAe,EACpB,KAAK,qBAAqB,EAC1B,KAAK,sBAAsB,EAC3B,KAAK,uBAAuB,EAC5B,KAAK,wBAAwB,EAC7B,KAAK,oBAAoB,EACzB,KAAK,kBAAkB,EACxB,MAAM,cAAc,CAAC;AAEtB,eAAO,MAAM,MAAM,GAAI,OAAO,WAAW,iBAOtC,CAAC;AAEJ,eAAO,MAAM,KAAK,GAAI,OAAO,UAAU,gBAOpC,CAAC;AAEJ,eAAO,MAAM,KAAK,GAAI,OAAO,UAAU,gBAOpC,CAAC;AAEJ,eAAO,MAAM,MAAM,GAAI,OAAO,WAAW,iBAOtC,CAAC;AAEJ,eAAO,MAAM,MAAM,GAAI,OAAO,WAAW,iBAOtC,CAAC;AAEJ,eAAO,MAAM,SAAS,GAAI,OAAO,cAAc,oBAO5C,CAAC;AAEJ,eAAO,MAAM,eAAe,GAAI,OAAO,oBAAoB,0BAOxD,CAAC;AAEJ,eAAO,MAAM,gBAAgB,GAAI,OAAO,qBAAqB,2BAO1D,CAAC;AAEJ,eAAO,MAAM,iBAAiB,GAAI,OAAO,sBAAsB,4BAO5D,CAAC;AAEJ,eAAO,MAAM,kBAAkB,GAAI,OAAO,uBAAuB,6BAO9D,CAAC;AAEJ,eAAO,MAAM,cAAc,GAAI,OAAO,mBAAmB,yBAOtD,CAAC;AAEJ,eAAO,MAAM,YAAY,GAAI,OAAO,iBAAiB,uBAOlD,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { createAction } from "document-model";
|
|
2
|
+
import { z, } from "../types.js";
|
|
3
|
+
export const cancel = (input) => createAction("CANCEL", { ...input }, undefined, z.CancelInputSchema, "global");
|
|
4
|
+
export const issue = (input) => createAction("ISSUE", { ...input }, undefined, z.IssueInputSchema, "global");
|
|
5
|
+
export const reset = (input) => createAction("RESET", { ...input }, undefined, z.ResetInputSchema, "global");
|
|
6
|
+
export const reject = (input) => createAction("REJECT", { ...input }, undefined, z.RejectInputSchema, "global");
|
|
7
|
+
export const accept = (input) => createAction("ACCEPT", { ...input }, undefined, z.AcceptInputSchema, "global");
|
|
8
|
+
export const reinstate = (input) => createAction("REINSTATE", { ...input }, undefined, z.ReinstateInputSchema, "global");
|
|
9
|
+
export const schedulePayment = (input) => createAction("SCHEDULE_PAYMENT", { ...input }, undefined, z.SchedulePaymentInputSchema, "global");
|
|
10
|
+
export const reapprovePayment = (input) => createAction("REAPPROVE_PAYMENT", { ...input }, undefined, z.ReapprovePaymentInputSchema, "global");
|
|
11
|
+
export const registerPaymentTx = (input) => createAction("REGISTER_PAYMENT_TX", { ...input }, undefined, z.RegisterPaymentTxInputSchema, "global");
|
|
12
|
+
export const reportPaymentIssue = (input) => createAction("REPORT_PAYMENT_ISSUE", { ...input }, undefined, z.ReportPaymentIssueInputSchema, "global");
|
|
13
|
+
export const confirmPayment = (input) => createAction("CONFIRM_PAYMENT", { ...input }, undefined, z.ConfirmPaymentInputSchema, "global");
|
|
14
|
+
export const closePayment = (input) => createAction("CLOSE_PAYMENT", { ...input }, undefined, z.ClosePaymentInputSchema, "global");
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../../../../../document-models/invoice/gen/transitions/error.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,MAAM,IAAK,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const errors = {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { BaseDocumentClass } from "document-model";
|
|
2
|
+
import { type CancelInput, type IssueInput, type ResetInput, type RejectInput, type AcceptInput, type ReinstateInput, type SchedulePaymentInput, type ReapprovePaymentInput, type RegisterPaymentTxInput, type ReportPaymentIssueInput, type ConfirmPaymentInput, type ClosePaymentInput, type InvoiceState, type InvoiceLocalState } from "../types.js";
|
|
3
|
+
import { type InvoiceAction } from "../actions.js";
|
|
4
|
+
export default class Invoice_Transitions extends BaseDocumentClass<InvoiceState, InvoiceLocalState, InvoiceAction> {
|
|
5
|
+
cancel(input: CancelInput): this;
|
|
6
|
+
issue(input: IssueInput): this;
|
|
7
|
+
reset(input: ResetInput): this;
|
|
8
|
+
reject(input: RejectInput): this;
|
|
9
|
+
accept(input: AcceptInput): this;
|
|
10
|
+
reinstate(input: ReinstateInput): this;
|
|
11
|
+
schedulePayment(input: SchedulePaymentInput): this;
|
|
12
|
+
reapprovePayment(input: ReapprovePaymentInput): this;
|
|
13
|
+
registerPaymentTx(input: RegisterPaymentTxInput): this;
|
|
14
|
+
reportPaymentIssue(input: ReportPaymentIssueInput): this;
|
|
15
|
+
confirmPayment(input: ConfirmPaymentInput): this;
|
|
16
|
+
closePayment(input: ClosePaymentInput): this;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=object.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"object.d.ts","sourceRoot":"","sources":["../../../../../document-models/invoice/gen/transitions/object.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EACL,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,KAAK,UAAU,EACf,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,KAAK,cAAc,EACnB,KAAK,oBAAoB,EACzB,KAAK,qBAAqB,EAC1B,KAAK,sBAAsB,EAC3B,KAAK,uBAAuB,EAC5B,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,KAAK,YAAY,EACjB,KAAK,iBAAiB,EACvB,MAAM,aAAa,CAAC;AAerB,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,eAAe,CAAC;AAEnD,MAAM,CAAC,OAAO,OAAO,mBAAoB,SAAQ,iBAAiB,CAChE,YAAY,EACZ,iBAAiB,EACjB,aAAa,CACd;IACQ,MAAM,CAAC,KAAK,EAAE,WAAW;IAIzB,KAAK,CAAC,KAAK,EAAE,UAAU;IAIvB,KAAK,CAAC,KAAK,EAAE,UAAU;IAIvB,MAAM,CAAC,KAAK,EAAE,WAAW;IAIzB,MAAM,CAAC,KAAK,EAAE,WAAW;IAIzB,SAAS,CAAC,KAAK,EAAE,cAAc;IAI/B,eAAe,CAAC,KAAK,EAAE,oBAAoB;IAI3C,gBAAgB,CAAC,KAAK,EAAE,qBAAqB;IAI7C,iBAAiB,CAAC,KAAK,EAAE,sBAAsB;IAI/C,kBAAkB,CAAC,KAAK,EAAE,uBAAuB;IAIjD,cAAc,CAAC,KAAK,EAAE,mBAAmB;IAIzC,YAAY,CAAC,KAAK,EAAE,iBAAiB;CAG7C"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { BaseDocumentClass } from "document-model";
|
|
2
|
+
import { cancel, issue, reset, reject, accept, reinstate, schedulePayment, reapprovePayment, registerPaymentTx, reportPaymentIssue, confirmPayment, closePayment, } from "./creators.js";
|
|
3
|
+
export default class Invoice_Transitions extends BaseDocumentClass {
|
|
4
|
+
cancel(input) {
|
|
5
|
+
return this.dispatch(cancel(input));
|
|
6
|
+
}
|
|
7
|
+
issue(input) {
|
|
8
|
+
return this.dispatch(issue(input));
|
|
9
|
+
}
|
|
10
|
+
reset(input) {
|
|
11
|
+
return this.dispatch(reset(input));
|
|
12
|
+
}
|
|
13
|
+
reject(input) {
|
|
14
|
+
return this.dispatch(reject(input));
|
|
15
|
+
}
|
|
16
|
+
accept(input) {
|
|
17
|
+
return this.dispatch(accept(input));
|
|
18
|
+
}
|
|
19
|
+
reinstate(input) {
|
|
20
|
+
return this.dispatch(reinstate(input));
|
|
21
|
+
}
|
|
22
|
+
schedulePayment(input) {
|
|
23
|
+
return this.dispatch(schedulePayment(input));
|
|
24
|
+
}
|
|
25
|
+
reapprovePayment(input) {
|
|
26
|
+
return this.dispatch(reapprovePayment(input));
|
|
27
|
+
}
|
|
28
|
+
registerPaymentTx(input) {
|
|
29
|
+
return this.dispatch(registerPaymentTx(input));
|
|
30
|
+
}
|
|
31
|
+
reportPaymentIssue(input) {
|
|
32
|
+
return this.dispatch(reportPaymentIssue(input));
|
|
33
|
+
}
|
|
34
|
+
confirmPayment(input) {
|
|
35
|
+
return this.dispatch(confirmPayment(input));
|
|
36
|
+
}
|
|
37
|
+
closePayment(input) {
|
|
38
|
+
return this.dispatch(closePayment(input));
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { type SignalDispatch } from "document-model";
|
|
2
|
+
import { type CancelAction, type IssueAction, type ResetAction, type RejectAction, type AcceptAction, type ReinstateAction, type SchedulePaymentAction, type ReapprovePaymentAction, type RegisterPaymentTxAction, type ReportPaymentIssueAction, type ConfirmPaymentAction, type ClosePaymentAction } from "./actions.js";
|
|
3
|
+
import { type InvoiceState } from "../types.js";
|
|
4
|
+
export interface InvoiceTransitionsOperations {
|
|
5
|
+
cancelOperation: (state: InvoiceState, action: CancelAction, dispatch?: SignalDispatch) => void;
|
|
6
|
+
issueOperation: (state: InvoiceState, action: IssueAction, dispatch?: SignalDispatch) => void;
|
|
7
|
+
resetOperation: (state: InvoiceState, action: ResetAction, dispatch?: SignalDispatch) => void;
|
|
8
|
+
rejectOperation: (state: InvoiceState, action: RejectAction, dispatch?: SignalDispatch) => void;
|
|
9
|
+
acceptOperation: (state: InvoiceState, action: AcceptAction, dispatch?: SignalDispatch) => void;
|
|
10
|
+
reinstateOperation: (state: InvoiceState, action: ReinstateAction, dispatch?: SignalDispatch) => void;
|
|
11
|
+
schedulePaymentOperation: (state: InvoiceState, action: SchedulePaymentAction, dispatch?: SignalDispatch) => void;
|
|
12
|
+
reapprovePaymentOperation: (state: InvoiceState, action: ReapprovePaymentAction, dispatch?: SignalDispatch) => void;
|
|
13
|
+
registerPaymentTxOperation: (state: InvoiceState, action: RegisterPaymentTxAction, dispatch?: SignalDispatch) => void;
|
|
14
|
+
reportPaymentIssueOperation: (state: InvoiceState, action: ReportPaymentIssueAction, dispatch?: SignalDispatch) => void;
|
|
15
|
+
confirmPaymentOperation: (state: InvoiceState, action: ConfirmPaymentAction, dispatch?: SignalDispatch) => void;
|
|
16
|
+
closePaymentOperation: (state: InvoiceState, action: ClosePaymentAction, dispatch?: SignalDispatch) => void;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=operations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operations.d.ts","sourceRoot":"","sources":["../../../../../document-models/invoice/gen/transitions/operations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,KAAK,YAAY,EACjB,KAAK,YAAY,EACjB,KAAK,eAAe,EACpB,KAAK,qBAAqB,EAC1B,KAAK,sBAAsB,EAC3B,KAAK,uBAAuB,EAC5B,KAAK,wBAAwB,EAC7B,KAAK,oBAAoB,EACzB,KAAK,kBAAkB,EACxB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD,MAAM,WAAW,4BAA4B;IAC3C,eAAe,EAAE,CACf,KAAK,EAAE,YAAY,EACnB,MAAM,EAAE,YAAY,EACpB,QAAQ,CAAC,EAAE,cAAc,KACtB,IAAI,CAAC;IACV,cAAc,EAAE,CACd,KAAK,EAAE,YAAY,EACnB,MAAM,EAAE,WAAW,EACnB,QAAQ,CAAC,EAAE,cAAc,KACtB,IAAI,CAAC;IACV,cAAc,EAAE,CACd,KAAK,EAAE,YAAY,EACnB,MAAM,EAAE,WAAW,EACnB,QAAQ,CAAC,EAAE,cAAc,KACtB,IAAI,CAAC;IACV,eAAe,EAAE,CACf,KAAK,EAAE,YAAY,EACnB,MAAM,EAAE,YAAY,EACpB,QAAQ,CAAC,EAAE,cAAc,KACtB,IAAI,CAAC;IACV,eAAe,EAAE,CACf,KAAK,EAAE,YAAY,EACnB,MAAM,EAAE,YAAY,EACpB,QAAQ,CAAC,EAAE,cAAc,KACtB,IAAI,CAAC;IACV,kBAAkB,EAAE,CAClB,KAAK,EAAE,YAAY,EACnB,MAAM,EAAE,eAAe,EACvB,QAAQ,CAAC,EAAE,cAAc,KACtB,IAAI,CAAC;IACV,wBAAwB,EAAE,CACxB,KAAK,EAAE,YAAY,EACnB,MAAM,EAAE,qBAAqB,EAC7B,QAAQ,CAAC,EAAE,cAAc,KACtB,IAAI,CAAC;IACV,yBAAyB,EAAE,CACzB,KAAK,EAAE,YAAY,EACnB,MAAM,EAAE,sBAAsB,EAC9B,QAAQ,CAAC,EAAE,cAAc,KACtB,IAAI,CAAC;IACV,0BAA0B,EAAE,CAC1B,KAAK,EAAE,YAAY,EACnB,MAAM,EAAE,uBAAuB,EAC/B,QAAQ,CAAC,EAAE,cAAc,KACtB,IAAI,CAAC;IACV,2BAA2B,EAAE,CAC3B,KAAK,EAAE,YAAY,EACnB,MAAM,EAAE,wBAAwB,EAChC,QAAQ,CAAC,EAAE,cAAc,KACtB,IAAI,CAAC;IACV,uBAAuB,EAAE,CACvB,KAAK,EAAE,YAAY,EACnB,MAAM,EAAE,oBAAoB,EAC5B,QAAQ,CAAC,EAAE,cAAc,KACtB,IAAI,CAAC;IACV,qBAAqB,EAAE,CACrB,KAAK,EAAE,YAAY,EACnB,MAAM,EAAE,kBAAkB,EAC1B,QAAQ,CAAC,EAAE,cAAc,KACtB,IAAI,CAAC;CACX"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../document-models/invoice/gen/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,kBAAkB,EAOxB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,KAAK,eAAe,EACpB,KAAK,YAAY,EACjB,KAAK,iBAAiB,EACvB,MAAM,YAAY,CAAC;AAGpB,eAAO,MAAM,kBAAkB,EAAE,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../document-models/invoice/gen/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,kBAAkB,EAOxB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,KAAK,eAAe,EACpB,KAAK,YAAY,EACjB,KAAK,iBAAiB,EACvB,MAAM,YAAY,CAAC;AAGpB,eAAO,MAAM,kBAAkB,EAAE,YA8IhC,CAAC;AACF,eAAO,MAAM,iBAAiB,EAAE,iBAAsB,CAAC;AAEvD,QAAA,MAAM,KAAK,EAAE,kBAAkB,CAAC,eAAe,CAgC9C,CAAC;AAEF,eAAe,KAAK,CAAC"}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { baseCreateDocument, baseCreateExtendedState, baseSaveToFile, baseSaveToFileHandle, baseLoadFromFile, baseLoadFromInput, } from "document-model";
|
|
2
2
|
import { reducer } from "./reducer.js";
|
|
3
3
|
export const initialGlobalState = {
|
|
4
|
+
closureReason: null,
|
|
4
5
|
invoiceNo: "",
|
|
5
6
|
dateIssued: "",
|
|
6
7
|
dateDue: "",
|
|
7
|
-
dateDelivered:
|
|
8
|
+
dateDelivered: null,
|
|
9
|
+
payAfter: null,
|
|
8
10
|
status: "DRAFT",
|
|
9
|
-
refs: [],
|
|
10
11
|
issuer: {
|
|
11
12
|
id: null,
|
|
12
13
|
name: "",
|
|
@@ -133,11 +134,14 @@ export const initialGlobalState = {
|
|
|
133
134
|
lineItems: [],
|
|
134
135
|
totalPriceTaxExcl: 0,
|
|
135
136
|
totalPriceTaxIncl: 0,
|
|
137
|
+
notes: null,
|
|
136
138
|
invoiceTags: [],
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
139
|
+
rejections: [],
|
|
140
|
+
payments: [],
|
|
141
|
+
exported: {
|
|
142
|
+
timestamp: "",
|
|
143
|
+
exportedLineItems: [],
|
|
144
|
+
},
|
|
141
145
|
};
|
|
142
146
|
export const initialLocalState = {};
|
|
143
147
|
const utils = {
|
|
@@ -19,11 +19,9 @@ declare const utils: {
|
|
|
19
19
|
declare const actions: {
|
|
20
20
|
editInvoice: (input: import("./gen/index.js").EditInvoiceInput) => import("./gen/index.js").EditInvoiceAction;
|
|
21
21
|
editStatus: (input: import("./gen/index.js").EditStatusInput) => import("./gen/index.js").EditStatusAction;
|
|
22
|
-
addRef: (input: import("./gen/index.js").AddRefInput) => import("./gen/index.js").AddRefAction;
|
|
23
|
-
editRef: (input: import("./gen/index.js").EditRefInput) => import("./gen/index.js").EditRefAction;
|
|
24
|
-
deleteRef: (input: import("./gen/index.js").DeleteRefInput) => import("./gen/index.js").DeleteRefAction;
|
|
25
22
|
editPaymentData: (input: import("./gen/index.js").EditPaymentDataInput) => import("./gen/index.js").EditPaymentDataAction;
|
|
26
|
-
|
|
23
|
+
setExportedData: (input: import("./gen/index.js").SetExportedDataInput) => import("./gen/index.js").SetExportedDataAction;
|
|
24
|
+
addPayment: (input: import("./gen/index.js").AddPaymentInput) => import("./gen/index.js").AddPaymentAction;
|
|
27
25
|
editIssuer: (input: import("./gen/index.js").EditIssuerInput) => import("./gen/index.js").EditIssuerAction;
|
|
28
26
|
editIssuerBank: (input: import("./gen/index.js").EditIssuerBankInput) => import("./gen/index.js").EditIssuerBankAction;
|
|
29
27
|
editIssuerWallet: (input: import("./gen/index.js").EditIssuerWalletInput) => import("./gen/index.js").EditIssuerWalletAction;
|
|
@@ -35,6 +33,18 @@ declare const actions: {
|
|
|
35
33
|
deleteLineItem: (input: import("./gen/index.js").DeleteLineItemInput) => import("./gen/index.js").DeleteLineItemAction;
|
|
36
34
|
setLineItemTag: (input: import("./gen/index.js").SetLineItemTagInput) => import("./gen/index.js").SetLineItemTagAction;
|
|
37
35
|
setInvoiceTag: (input: import("./gen/index.js").SetInvoiceTagInput) => import("./gen/index.js").SetInvoiceTagAction;
|
|
36
|
+
cancel: (input: import("./gen/index.js").CancelInput) => import("./gen/index.js").CancelAction;
|
|
37
|
+
issue: (input: import("./gen/index.js").IssueInput) => import("./gen/index.js").IssueAction;
|
|
38
|
+
reset: (input: import("./gen/index.js").ResetInput) => import("./gen/index.js").ResetAction;
|
|
39
|
+
reject: (input: import("./gen/index.js").RejectInput) => import("./gen/index.js").RejectAction;
|
|
40
|
+
accept: (input: import("./gen/index.js").AcceptInput) => import("./gen/index.js").AcceptAction;
|
|
41
|
+
reinstate: (input: import("./gen/index.js").ReinstateInput) => import("./gen/index.js").ReinstateAction;
|
|
42
|
+
schedulePayment: (input: import("./gen/index.js").SchedulePaymentInput) => import("./gen/index.js").SchedulePaymentAction;
|
|
43
|
+
reapprovePayment: (input: import("./gen/index.js").ReapprovePaymentInput) => import("./gen/index.js").ReapprovePaymentAction;
|
|
44
|
+
registerPaymentTx: (input: import("./gen/index.js").RegisterPaymentTxInput) => import("./gen/index.js").RegisterPaymentTxAction;
|
|
45
|
+
reportPaymentIssue: (input: import("./gen/index.js").ReportPaymentIssueInput) => import("./gen/index.js").ReportPaymentIssueAction;
|
|
46
|
+
confirmPayment: (input: import("./gen/index.js").ConfirmPaymentInput) => import("./gen/index.js").ConfirmPaymentAction;
|
|
47
|
+
closePayment: (input: import("./gen/index.js").ClosePaymentInput) => import("./gen/index.js").ClosePaymentAction;
|
|
38
48
|
};
|
|
39
49
|
export declare const module: DocumentModelModule<InvoiceDocument>;
|
|
40
50
|
export { reducer, actions, utils, documentModel };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../document-models/invoice/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAEL,KAAK,mBAAmB,EACzB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAGxD,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEtD,QAAA,MAAM,KAAK;;;;;;;;;CAAkC,CAAC;AAC9C,QAAA,MAAM,OAAO;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../document-models/invoice/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAEL,KAAK,mBAAmB,EACzB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAGxD,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEtD,QAAA,MAAM,KAAK;;;;;;;;;CAAkC,CAAC;AAC9C,QAAA,MAAM,OAAO;kBALmB,gDAChB;iBAIoB,+CAElC;sBASO,oDACN;sBAC4J,oDAA2B;iBAAuL,+CAAsB;iBAhBhY,+CAAqB;qBAKY,mDACpC;uBAUkB,qDAA4B;gBAAyL,8CAAqB;oBAAuK,kDAAyB;sBAAsL,oDAA2B;kBAjBjpB,gDAAsB;mBAIuB,iDAEhC;qBASY,mDACN;qBACwJ,mDAA0B;oBAAwL,kDAAyB;aAJ/Y,2CAAkB;YAIiC,0CAAiB;YAAkJ,0CAAiB;aAAmJ,2CAAkB;aAAsJ,2CAAkB;gBAAyJ,8CAAqB;sBAAwK,oDAA2B;uBAA4L,qDAA4B;wBAAgM,sDAA6B;yBAAqM,uDAA8B;qBAAoM,mDAA0B;mBAAqL,iDAAwB;CAb17D,CAAC;AAEtD,eAAO,MAAM,MAAM,EAAE,mBAAmB,CAAC,eAAe,CAKvD,CAAC;AAEF,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,CAAC;AAElD,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"general.d.ts","sourceRoot":"","sources":["../../../../../document-models/invoice/src/reducers/general.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAC;AAEhF,eAAO,MAAM,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"general.d.ts","sourceRoot":"","sources":["../../../../../document-models/invoice/src/reducers/general.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAC;AAEhF,eAAO,MAAM,OAAO,EAAE,wBAkErB,CAAC"}
|
|
@@ -8,8 +8,6 @@ export const reducer = {
|
|
|
8
8
|
try {
|
|
9
9
|
const newState = { ...state };
|
|
10
10
|
newState.currency = action.input.currency ?? state.currency;
|
|
11
|
-
newState.dateDelivered =
|
|
12
|
-
action.input.dateDelivered ?? state.dateDelivered;
|
|
13
11
|
newState.dateDue = action.input.dateDue ?? state.dateDue;
|
|
14
12
|
newState.dateIssued = action.input.dateIssued ?? state.dateIssued;
|
|
15
13
|
newState.invoiceNo = action.input.invoiceNo ?? state.invoiceNo;
|
|
@@ -28,59 +26,45 @@ export const reducer = {
|
|
|
28
26
|
console.error(e);
|
|
29
27
|
}
|
|
30
28
|
},
|
|
31
|
-
|
|
32
|
-
try {
|
|
33
|
-
if (!action.input.id)
|
|
34
|
-
throw new Error("No input.id");
|
|
35
|
-
if (!action.input.value)
|
|
36
|
-
throw new Error("No input.value");
|
|
37
|
-
if (state.refs.find((r) => r.id == action.input.id))
|
|
38
|
-
throw new Error("Ref already exists with provided input.id");
|
|
39
|
-
state.refs.push(action.input);
|
|
40
|
-
}
|
|
41
|
-
catch (e) {
|
|
42
|
-
console.error(e);
|
|
43
|
-
}
|
|
44
|
-
},
|
|
45
|
-
editRefOperation(state, action, dispatch) {
|
|
46
|
-
try {
|
|
47
|
-
if (!action.input.id)
|
|
48
|
-
throw new Error("No input.id");
|
|
49
|
-
if (!action.input.value)
|
|
50
|
-
throw new Error("No input.value");
|
|
51
|
-
let ref = state.refs.find((r) => r.id == action.input.id);
|
|
52
|
-
if (!ref)
|
|
53
|
-
throw new Error("Ref not found with provided input.id");
|
|
54
|
-
ref = action.input;
|
|
55
|
-
}
|
|
56
|
-
catch (e) {
|
|
57
|
-
console.error(e);
|
|
58
|
-
}
|
|
59
|
-
},
|
|
60
|
-
deleteRefOperation(state, action, dispatch) {
|
|
29
|
+
editPaymentDataOperation(state, action, dispatch) {
|
|
61
30
|
try {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
31
|
+
const payment = state.payments.find((payment) => payment.id === action.input.id);
|
|
32
|
+
if (payment) {
|
|
33
|
+
payment.processorRef = action.input.processorRef ?? payment.processorRef;
|
|
34
|
+
payment.paymentDate = action.input.paymentDate ?? payment.paymentDate;
|
|
35
|
+
payment.txnRef = action.input.txnRef ?? payment.txnRef;
|
|
36
|
+
payment.confirmed = action.input.confirmed ?? payment.confirmed;
|
|
37
|
+
payment.issue = action.input.issue ?? payment.issue;
|
|
38
|
+
}
|
|
65
39
|
}
|
|
66
40
|
catch (e) {
|
|
67
41
|
console.error(e);
|
|
68
42
|
}
|
|
69
43
|
},
|
|
70
|
-
|
|
44
|
+
addPaymentOperation(state, action, dispatch) {
|
|
71
45
|
try {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
46
|
+
const payment = {
|
|
47
|
+
id: action.input.id,
|
|
48
|
+
processorRef: action.input.processorRef ?? "",
|
|
49
|
+
paymentDate: action.input.paymentDate ?? "",
|
|
50
|
+
txnRef: action.input.txnRef ?? "",
|
|
51
|
+
confirmed: action.input.confirmed ?? false,
|
|
52
|
+
issue: action.input.issue ?? "",
|
|
53
|
+
amount: 0,
|
|
54
|
+
};
|
|
55
|
+
state.payments.push(payment);
|
|
76
56
|
}
|
|
77
57
|
catch (e) {
|
|
78
58
|
console.error(e);
|
|
79
59
|
}
|
|
80
60
|
},
|
|
81
|
-
|
|
61
|
+
setExportedDataOperation(state, action, dispatch) {
|
|
82
62
|
try {
|
|
83
|
-
|
|
63
|
+
const exportedData = {
|
|
64
|
+
timestamp: action.input.timestamp,
|
|
65
|
+
exportedLineItems: action.input.exportedLineItems,
|
|
66
|
+
};
|
|
67
|
+
state.exported = exportedData;
|
|
84
68
|
}
|
|
85
69
|
catch (e) {
|
|
86
70
|
console.error(e);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This is a scaffold file meant for customization:
|
|
3
|
+
* - modify it by implementing the reducer functions
|
|
4
|
+
* - delete the file and run the code generator again to have it reset
|
|
5
|
+
*/
|
|
6
|
+
import type { InvoiceTransitionsOperations } from "../../gen/transitions/operations.js";
|
|
7
|
+
export declare const reducer: InvoiceTransitionsOperations;
|
|
8
|
+
//# sourceMappingURL=transitions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transitions.d.ts","sourceRoot":"","sources":["../../../../../document-models/invoice/src/reducers/transitions.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,qCAAqC,CAAC;AAGxF,eAAO,MAAM,OAAO,EAAE,4BA4IrB,CAAC"}
|