@voyantjs/finance 0.52.2 → 0.52.4
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/action-ledger-drift.d.ts +29 -0
- package/dist/action-ledger-drift.d.ts.map +1 -0
- package/dist/action-ledger-drift.js +163 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/routes-action-ledger.d.ts +181 -0
- package/dist/routes-action-ledger.d.ts.map +1 -0
- package/dist/routes-action-ledger.js +142 -0
- package/dist/routes-documents.d.ts +8 -8
- package/dist/routes-public.d.ts +48 -48
- package/dist/routes-settlement.d.ts +1 -1
- package/dist/routes-shared.d.ts +12 -0
- package/dist/routes-shared.d.ts.map +1 -1
- package/dist/routes.d.ts +224 -224
- package/dist/routes.d.ts.map +1 -1
- package/dist/routes.js +252 -46
- package/dist/schema.d.ts +22 -22
- package/dist/service-action-ledger-accounting.d.ts +77 -0
- package/dist/service-action-ledger-accounting.d.ts.map +1 -0
- package/dist/service-action-ledger-accounting.js +307 -0
- package/dist/service-action-ledger-booking-payments.d.ts +48 -0
- package/dist/service-action-ledger-booking-payments.d.ts.map +1 -0
- package/dist/service-action-ledger-booking-payments.js +178 -0
- package/dist/service-action-ledger-payment-authorizations.d.ts +48 -0
- package/dist/service-action-ledger-payment-authorizations.d.ts.map +1 -0
- package/dist/service-action-ledger-payment-authorizations.js +209 -0
- package/dist/service-action-ledger-payment-sessions.d.ts +83 -0
- package/dist/service-action-ledger-payment-sessions.d.ts.map +1 -0
- package/dist/service-action-ledger-payment-sessions.js +294 -0
- package/dist/service-action-ledger-supplier-payments.d.ts +21 -0
- package/dist/service-action-ledger-supplier-payments.d.ts.map +1 -0
- package/dist/service-action-ledger-supplier-payments.js +70 -0
- package/dist/service-action-ledger.d.ts +6 -0
- package/dist/service-action-ledger.d.ts.map +1 -0
- package/dist/service-action-ledger.js +5 -0
- package/dist/service-booking-create.d.ts +12 -12
- package/dist/service-bookings-dual-create.d.ts +12 -12
- package/dist/service-issue.d.ts +15 -12
- package/dist/service-issue.d.ts.map +1 -1
- package/dist/service-issue.js +24 -3
- package/dist/service-public.d.ts +13 -13
- package/dist/service-vouchers.d.ts +10 -10
- package/dist/service.d.ts +291 -279
- package/dist/service.d.ts.map +1 -1
- package/dist/service.js +731 -234
- package/dist/validation-billing.d.ts +37 -37
- package/dist/validation-payments.d.ts +102 -102
- package/dist/validation-public.d.ts +45 -45
- package/dist/validation-shared.d.ts +32 -32
- package/dist/validation-vouchers.d.ts +2 -2
- package/package.json +13 -7
package/dist/service-issue.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type ActionLedgerRequestContextValues } from "@voyantjs/action-ledger";
|
|
1
2
|
import type { EventBus } from "@voyantjs/core";
|
|
2
3
|
import type { PostgresJsDatabase } from "drizzle-orm/postgres-js";
|
|
3
4
|
import { invoices } from "./schema.js";
|
|
@@ -13,6 +14,8 @@ import { type CreateInvoiceFromBookingInput, type InvoiceFromBookingData } from
|
|
|
13
14
|
*/
|
|
14
15
|
export interface InvoiceIssueRuntime {
|
|
15
16
|
eventBus?: EventBus;
|
|
17
|
+
actionLedgerContext?: ActionLedgerRequestContextValues;
|
|
18
|
+
actionLedgerAuthorizationSource?: string | null;
|
|
16
19
|
}
|
|
17
20
|
export interface InvoiceIssuedEvent {
|
|
18
21
|
invoiceId: string;
|
|
@@ -53,17 +56,14 @@ export interface InvoiceIssuedLineItem {
|
|
|
53
56
|
*/
|
|
54
57
|
export declare function issueInvoiceFromBooking(db: PostgresJsDatabase, input: CreateInvoiceFromBookingInput, bookingData: InvoiceFromBookingData, runtime?: InvoiceIssueRuntime): Promise<{
|
|
55
58
|
id: string;
|
|
56
|
-
|
|
57
|
-
updatedAt: Date;
|
|
59
|
+
status: "draft" | "sent" | "partially_paid" | "paid" | "overdue" | "void";
|
|
58
60
|
organizationId: string | null;
|
|
59
|
-
|
|
60
|
-
issueDate: string;
|
|
61
|
+
createdAt: Date;
|
|
61
62
|
currency: string;
|
|
62
63
|
notes: string | null;
|
|
64
|
+
updatedAt: Date;
|
|
63
65
|
bookingId: string;
|
|
64
66
|
personId: string | null;
|
|
65
|
-
baseCurrency: string | null;
|
|
66
|
-
fxRateSetId: string | null;
|
|
67
67
|
invoiceNumber: string;
|
|
68
68
|
invoiceType: "invoice" | "proforma" | "credit_note";
|
|
69
69
|
convertedFromInvoiceId: string | null;
|
|
@@ -72,6 +72,8 @@ export declare function issueInvoiceFromBooking(db: PostgresJsDatabase, input: C
|
|
|
72
72
|
templateId: string | null;
|
|
73
73
|
taxRegimeId: string | null;
|
|
74
74
|
language: string | null;
|
|
75
|
+
baseCurrency: string | null;
|
|
76
|
+
fxRateSetId: string | null;
|
|
75
77
|
subtotalCents: number;
|
|
76
78
|
baseSubtotalCents: number | null;
|
|
77
79
|
taxCents: number;
|
|
@@ -84,6 +86,7 @@ export declare function issueInvoiceFromBooking(db: PostgresJsDatabase, input: C
|
|
|
84
86
|
baseBalanceDueCents: number | null;
|
|
85
87
|
commissionPercent: number | null;
|
|
86
88
|
commissionAmountCents: number | null;
|
|
89
|
+
issueDate: string;
|
|
87
90
|
dueDate: string;
|
|
88
91
|
} | null>;
|
|
89
92
|
/**
|
|
@@ -94,17 +97,14 @@ export declare function issueInvoiceFromBooking(db: PostgresJsDatabase, input: C
|
|
|
94
97
|
*/
|
|
95
98
|
export declare function issueProformaFromBooking(db: PostgresJsDatabase, input: CreateInvoiceFromBookingInput, bookingData: InvoiceFromBookingData, runtime?: InvoiceIssueRuntime): Promise<{
|
|
96
99
|
id: string;
|
|
97
|
-
|
|
98
|
-
updatedAt: Date;
|
|
100
|
+
status: "draft" | "sent" | "partially_paid" | "paid" | "overdue" | "void";
|
|
99
101
|
organizationId: string | null;
|
|
100
|
-
|
|
101
|
-
issueDate: string;
|
|
102
|
+
createdAt: Date;
|
|
102
103
|
currency: string;
|
|
103
104
|
notes: string | null;
|
|
105
|
+
updatedAt: Date;
|
|
104
106
|
bookingId: string;
|
|
105
107
|
personId: string | null;
|
|
106
|
-
baseCurrency: string | null;
|
|
107
|
-
fxRateSetId: string | null;
|
|
108
108
|
invoiceNumber: string;
|
|
109
109
|
invoiceType: "invoice" | "proforma" | "credit_note";
|
|
110
110
|
convertedFromInvoiceId: string | null;
|
|
@@ -113,6 +113,8 @@ export declare function issueProformaFromBooking(db: PostgresJsDatabase, input:
|
|
|
113
113
|
templateId: string | null;
|
|
114
114
|
taxRegimeId: string | null;
|
|
115
115
|
language: string | null;
|
|
116
|
+
baseCurrency: string | null;
|
|
117
|
+
fxRateSetId: string | null;
|
|
116
118
|
subtotalCents: number;
|
|
117
119
|
baseSubtotalCents: number | null;
|
|
118
120
|
taxCents: number;
|
|
@@ -125,6 +127,7 @@ export declare function issueProformaFromBooking(db: PostgresJsDatabase, input:
|
|
|
125
127
|
baseBalanceDueCents: number | null;
|
|
126
128
|
commissionPercent: number | null;
|
|
127
129
|
commissionAmountCents: number | null;
|
|
130
|
+
issueDate: string;
|
|
128
131
|
dueDate: string;
|
|
129
132
|
} | null>;
|
|
130
133
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service-issue.d.ts","sourceRoot":"","sources":["../src/service-issue.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"service-issue.d.ts","sourceRoot":"","sources":["../src/service-issue.ts"],"names":[],"mappings":"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"}
|
package/dist/service-issue.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import { appendActionLedgerMutation, } from "@voyantjs/action-ledger";
|
|
1
2
|
import { bookings } from "@voyantjs/bookings/schema";
|
|
2
3
|
import { asc, eq } from "drizzle-orm";
|
|
3
4
|
import { invoiceLineItems, invoices, payments } from "./schema.js";
|
|
4
|
-
import { financeService, } from "./service.js";
|
|
5
|
+
import { buildInvoiceIssuedActionLedgerInput, financeService, } from "./service.js";
|
|
5
6
|
const ISSUED_EVENT = "invoice.issued";
|
|
6
7
|
const PROFORMA_ISSUED_EVENT = "invoice.proforma.issued";
|
|
7
8
|
/**
|
|
@@ -14,11 +15,21 @@ export async function issueInvoiceFromBooking(db, input, bookingData, runtime =
|
|
|
14
15
|
const draft = await financeService.createInvoiceFromBooking(db, input, bookingData);
|
|
15
16
|
if (!draft)
|
|
16
17
|
return null;
|
|
17
|
-
const
|
|
18
|
+
const updateIssuedInvoice = (writer) => writer
|
|
18
19
|
.update(invoices)
|
|
19
20
|
.set({ status: "sent", updatedAt: new Date() })
|
|
20
21
|
.where(eq(invoices.id, draft.id))
|
|
21
22
|
.returning();
|
|
23
|
+
const actionLedgerContext = runtime.actionLedgerContext;
|
|
24
|
+
const issued = actionLedgerContext
|
|
25
|
+
? await db.transaction(async (tx) => {
|
|
26
|
+
const [row] = await updateIssuedInvoice(tx);
|
|
27
|
+
if (row) {
|
|
28
|
+
await appendActionLedgerMutation(tx, await buildInvoiceIssuedActionLedgerInput(actionLedgerContext, { invoice: row }, { authorizationSource: runtime.actionLedgerAuthorizationSource }));
|
|
29
|
+
}
|
|
30
|
+
return row;
|
|
31
|
+
})
|
|
32
|
+
: (await updateIssuedInvoice(db))[0];
|
|
22
33
|
const row = issued ?? draft;
|
|
23
34
|
await emitIssued(db, runtime, ISSUED_EVENT, row);
|
|
24
35
|
return row;
|
|
@@ -33,11 +44,21 @@ export async function issueProformaFromBooking(db, input, bookingData, runtime =
|
|
|
33
44
|
const draft = await financeService.createInvoiceFromBooking(db, input, bookingData);
|
|
34
45
|
if (!draft)
|
|
35
46
|
return null;
|
|
36
|
-
const
|
|
47
|
+
const updateIssuedInvoice = (writer) => writer
|
|
37
48
|
.update(invoices)
|
|
38
49
|
.set({ invoiceType: "proforma", status: "sent", updatedAt: new Date() })
|
|
39
50
|
.where(eq(invoices.id, draft.id))
|
|
40
51
|
.returning();
|
|
52
|
+
const actionLedgerContext = runtime.actionLedgerContext;
|
|
53
|
+
const issued = actionLedgerContext
|
|
54
|
+
? await db.transaction(async (tx) => {
|
|
55
|
+
const [row] = await updateIssuedInvoice(tx);
|
|
56
|
+
if (row) {
|
|
57
|
+
await appendActionLedgerMutation(tx, await buildInvoiceIssuedActionLedgerInput(actionLedgerContext, { invoice: row }, { authorizationSource: runtime.actionLedgerAuthorizationSource }));
|
|
58
|
+
}
|
|
59
|
+
return row;
|
|
60
|
+
})
|
|
61
|
+
: (await updateIssuedInvoice(db))[0];
|
|
41
62
|
const row = issued ?? draft;
|
|
42
63
|
await emitIssued(db, runtime, PROFORMA_ISSUED_EVENT, row);
|
|
43
64
|
return row;
|
package/dist/service-public.d.ts
CHANGED
|
@@ -13,8 +13,8 @@ export declare const publicFinanceService: {
|
|
|
13
13
|
id: string;
|
|
14
14
|
label: string;
|
|
15
15
|
provider: string | null;
|
|
16
|
-
instrumentType: "
|
|
17
|
-
status: "
|
|
16
|
+
instrumentType: "credit_card" | "debit_card" | "cash" | "wallet" | "direct_bill" | "voucher" | "other" | "bank_account";
|
|
17
|
+
status: "expired" | "active" | "inactive" | "revoked" | "failed_verification";
|
|
18
18
|
brand: string | null;
|
|
19
19
|
last4: string | null;
|
|
20
20
|
expiryMonth: number | null;
|
|
@@ -24,7 +24,7 @@ export declare const publicFinanceService: {
|
|
|
24
24
|
schedules: {
|
|
25
25
|
id: string;
|
|
26
26
|
scheduleType: "other" | "deposit" | "installment" | "balance" | "hold";
|
|
27
|
-
status: "
|
|
27
|
+
status: "expired" | "cancelled" | "pending" | "paid" | "due" | "waived";
|
|
28
28
|
dueDate: string;
|
|
29
29
|
currency: string;
|
|
30
30
|
amountCents: number;
|
|
@@ -33,8 +33,8 @@ export declare const publicFinanceService: {
|
|
|
33
33
|
guarantees: {
|
|
34
34
|
id: string;
|
|
35
35
|
bookingPaymentScheduleId: string | null;
|
|
36
|
-
guaranteeType: "
|
|
37
|
-
status: "
|
|
36
|
+
guaranteeType: "bank_transfer" | "credit_card" | "voucher" | "other" | "deposit" | "preauth" | "card_on_file" | "agency_letter";
|
|
37
|
+
status: "failed" | "expired" | "cancelled" | "pending" | "active" | "released";
|
|
38
38
|
currency: string | null;
|
|
39
39
|
amountCents: number | null;
|
|
40
40
|
provider: string | null;
|
|
@@ -56,7 +56,7 @@ export declare const publicFinanceService: {
|
|
|
56
56
|
invoiceId: string | null;
|
|
57
57
|
bookingPaymentScheduleId: string | null;
|
|
58
58
|
bookingGuaranteeId: string | null;
|
|
59
|
-
status: "
|
|
59
|
+
status: "failed" | "expired" | "cancelled" | "pending" | "processing" | "paid" | "requires_redirect" | "authorized";
|
|
60
60
|
provider: string | null;
|
|
61
61
|
providerSessionId: string | null;
|
|
62
62
|
providerPaymentId: string | null;
|
|
@@ -64,7 +64,7 @@ export declare const publicFinanceService: {
|
|
|
64
64
|
clientReference: string | null;
|
|
65
65
|
currency: string;
|
|
66
66
|
amountCents: number;
|
|
67
|
-
paymentMethod: "
|
|
67
|
+
paymentMethod: "bank_transfer" | "credit_card" | "debit_card" | "cash" | "cheque" | "wallet" | "direct_bill" | "voucher" | "other" | null;
|
|
68
68
|
payerEmail: string | null;
|
|
69
69
|
payerName: string | null;
|
|
70
70
|
redirectUrl: string | null;
|
|
@@ -85,7 +85,7 @@ export declare const publicFinanceService: {
|
|
|
85
85
|
invoiceId: string | null;
|
|
86
86
|
bookingPaymentScheduleId: string | null;
|
|
87
87
|
bookingGuaranteeId: string | null;
|
|
88
|
-
status: "
|
|
88
|
+
status: "failed" | "expired" | "cancelled" | "pending" | "processing" | "paid" | "requires_redirect" | "authorized";
|
|
89
89
|
provider: string | null;
|
|
90
90
|
providerSessionId: string | null;
|
|
91
91
|
providerPaymentId: string | null;
|
|
@@ -93,7 +93,7 @@ export declare const publicFinanceService: {
|
|
|
93
93
|
clientReference: string | null;
|
|
94
94
|
currency: string;
|
|
95
95
|
amountCents: number;
|
|
96
|
-
paymentMethod: "
|
|
96
|
+
paymentMethod: "bank_transfer" | "credit_card" | "debit_card" | "cash" | "cheque" | "wallet" | "direct_bill" | "voucher" | "other" | null;
|
|
97
97
|
payerEmail: string | null;
|
|
98
98
|
payerName: string | null;
|
|
99
99
|
redirectUrl: string | null;
|
|
@@ -113,7 +113,7 @@ export declare const publicFinanceService: {
|
|
|
113
113
|
invoiceId: string | null;
|
|
114
114
|
bookingPaymentScheduleId: string | null;
|
|
115
115
|
bookingGuaranteeId: string | null;
|
|
116
|
-
status: "
|
|
116
|
+
status: "failed" | "expired" | "cancelled" | "pending" | "processing" | "paid" | "requires_redirect" | "authorized";
|
|
117
117
|
provider: string | null;
|
|
118
118
|
providerSessionId: string | null;
|
|
119
119
|
providerPaymentId: string | null;
|
|
@@ -121,7 +121,7 @@ export declare const publicFinanceService: {
|
|
|
121
121
|
clientReference: string | null;
|
|
122
122
|
currency: string;
|
|
123
123
|
amountCents: number;
|
|
124
|
-
paymentMethod: "
|
|
124
|
+
paymentMethod: "bank_transfer" | "credit_card" | "debit_card" | "cash" | "cheque" | "wallet" | "direct_bill" | "voucher" | "other" | null;
|
|
125
125
|
payerEmail: string | null;
|
|
126
126
|
payerName: string | null;
|
|
127
127
|
redirectUrl: string | null;
|
|
@@ -141,7 +141,7 @@ export declare const publicFinanceService: {
|
|
|
141
141
|
invoiceId: string | null;
|
|
142
142
|
bookingPaymentScheduleId: string | null;
|
|
143
143
|
bookingGuaranteeId: string | null;
|
|
144
|
-
status: "
|
|
144
|
+
status: "failed" | "expired" | "cancelled" | "pending" | "processing" | "paid" | "requires_redirect" | "authorized";
|
|
145
145
|
provider: string | null;
|
|
146
146
|
providerSessionId: string | null;
|
|
147
147
|
providerPaymentId: string | null;
|
|
@@ -149,7 +149,7 @@ export declare const publicFinanceService: {
|
|
|
149
149
|
clientReference: string | null;
|
|
150
150
|
currency: string;
|
|
151
151
|
amountCents: number;
|
|
152
|
-
paymentMethod: "
|
|
152
|
+
paymentMethod: "bank_transfer" | "credit_card" | "debit_card" | "cash" | "cheque" | "wallet" | "direct_bill" | "voucher" | "other" | null;
|
|
153
153
|
payerEmail: string | null;
|
|
154
154
|
payerName: string | null;
|
|
155
155
|
redirectUrl: string | null;
|
|
@@ -25,7 +25,7 @@ export declare const vouchersService: {
|
|
|
25
25
|
id: string;
|
|
26
26
|
code: string;
|
|
27
27
|
seriesCode: string | null;
|
|
28
|
-
status: "
|
|
28
|
+
status: "expired" | "void" | "active" | "redeemed";
|
|
29
29
|
currency: string;
|
|
30
30
|
initialAmountCents: number;
|
|
31
31
|
remainingAmountCents: number;
|
|
@@ -58,7 +58,7 @@ export declare const vouchersService: {
|
|
|
58
58
|
id: string;
|
|
59
59
|
code: string;
|
|
60
60
|
seriesCode: string | null;
|
|
61
|
-
status: "
|
|
61
|
+
status: "expired" | "void" | "active" | "redeemed";
|
|
62
62
|
currency: string;
|
|
63
63
|
initialAmountCents: number;
|
|
64
64
|
remainingAmountCents: number;
|
|
@@ -76,29 +76,29 @@ export declare const vouchersService: {
|
|
|
76
76
|
} | null>;
|
|
77
77
|
create(db: PostgresJsDatabase, input: CreateVoucherInput, issuedByUserId?: string): Promise<{
|
|
78
78
|
id: string;
|
|
79
|
+
status: "expired" | "void" | "active" | "redeemed";
|
|
79
80
|
createdAt: Date;
|
|
80
|
-
updatedAt: Date;
|
|
81
81
|
expiresAt: Date | null;
|
|
82
|
-
status: "void" | "active" | "expired" | "redeemed";
|
|
83
|
-
currency: string;
|
|
84
|
-
notes: string | null;
|
|
85
82
|
code: string;
|
|
86
|
-
sourceType: "manual" | "refund" | "cancellation_credit" | "gift" | "promo";
|
|
87
83
|
seriesCode: string | null;
|
|
84
|
+
currency: string;
|
|
88
85
|
initialAmountCents: number;
|
|
89
86
|
remainingAmountCents: number;
|
|
90
87
|
issuedToPersonId: string | null;
|
|
91
88
|
issuedToOrganizationId: string | null;
|
|
89
|
+
sourceType: "manual" | "refund" | "cancellation_credit" | "gift" | "promo";
|
|
92
90
|
sourceBookingId: string | null;
|
|
93
91
|
sourcePaymentId: string | null;
|
|
94
92
|
validFrom: Date | null;
|
|
93
|
+
notes: string | null;
|
|
95
94
|
issuedByUserId: string | null;
|
|
95
|
+
updatedAt: Date;
|
|
96
96
|
} | null>;
|
|
97
97
|
update(db: PostgresJsDatabase, id: string, input: UpdateVoucherInput): Promise<{
|
|
98
98
|
id: string;
|
|
99
99
|
code: string;
|
|
100
100
|
seriesCode: string | null;
|
|
101
|
-
status: "
|
|
101
|
+
status: "expired" | "void" | "active" | "redeemed";
|
|
102
102
|
currency: string;
|
|
103
103
|
initialAmountCents: number;
|
|
104
104
|
remainingAmountCents: number;
|
|
@@ -126,7 +126,7 @@ export declare const vouchersService: {
|
|
|
126
126
|
id: string;
|
|
127
127
|
code: string;
|
|
128
128
|
seriesCode: string | null;
|
|
129
|
-
status: "
|
|
129
|
+
status: "expired" | "void" | "active" | "redeemed";
|
|
130
130
|
currency: string;
|
|
131
131
|
initialAmountCents: number;
|
|
132
132
|
remainingAmountCents: number;
|
|
@@ -145,8 +145,8 @@ export declare const vouchersService: {
|
|
|
145
145
|
redemption: {
|
|
146
146
|
id: string;
|
|
147
147
|
createdAt: Date;
|
|
148
|
-
bookingId: string;
|
|
149
148
|
voucherId: string;
|
|
149
|
+
bookingId: string;
|
|
150
150
|
paymentId: string | null;
|
|
151
151
|
amountCents: number;
|
|
152
152
|
createdByUserId: string | null;
|