@voyant-travel/finance 0.138.2 → 0.138.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/checkout-routes.d.ts +37 -0
- package/dist/checkout-routes.d.ts.map +1 -1
- package/dist/checkout-routes.js +34 -9
- package/dist/routes-booking-billing.d.ts +34 -10
- package/dist/routes-booking-billing.d.ts.map +1 -1
- package/dist/routes-booking-billing.js +47 -19
- package/dist/routes-booking-reads.d.ts +4 -3
- package/dist/routes-booking-reads.d.ts.map +1 -1
- package/dist/routes-public.d.ts +8 -6
- package/dist/routes-public.d.ts.map +1 -1
- package/dist/routes.d.ts +38 -13
- package/dist/routes.d.ts.map +1 -1
- package/dist/service-booking-guarantees.d.ts.map +1 -1
- package/dist/service-booking-guarantees.js +28 -3
- package/dist/service-booking-item-billing.d.ts.map +1 -1
- package/dist/service-booking-item-billing.js +26 -1
- package/dist/service-invoice-core.d.ts.map +1 -1
- package/dist/service-invoice-core.js +24 -2
- package/dist/service-invoice-from-booking.d.ts.map +1 -1
- package/dist/service-invoice-from-booking.js +2 -1
- package/dist/service-invoice-payments.d.ts.map +1 -1
- package/dist/service-invoice-payments.js +4 -1
- package/dist/service-issue.d.ts.map +1 -1
- package/dist/service-issue.js +10 -1
- package/dist/service-payment-sessions.d.ts.map +1 -1
- package/dist/service-payment-sessions.js +16 -1
- package/dist/service-public.d.ts.map +1 -1
- package/dist/service-public.js +67 -33
- package/dist/service-shared.d.ts +1 -0
- package/dist/service-shared.d.ts.map +1 -1
- package/dist/service-shared.js +5 -0
- package/package.json +5 -5
package/dist/routes.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../src/routes.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AAI7D,OAAO,EAAE,6BAA6B,EAAE,sBAAsB,EAAE,MAAM,qBAAq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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4BAwBa,CAAA;AAEvC,MAAM,MAAM,aAAa,GAAG,OAAO,aAAa,CAAA;AAChD,MAAM,MAAM,mBAAmB,GAAG,OAAO,mBAAmB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service-booking-guarantees.d.ts","sourceRoot":"","sources":["../src/service-booking-guarantees.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,2BAA2B,EAC3B,sCAAsC,EACtC,qBAAqB,EACrB,kBAAkB,EAClB,2BAA2B,EAC5B,MAAM,qBAAqB,CAAA;
|
|
1
|
+
{"version":3,"file":"service-booking-guarantees.d.ts","sourceRoot":"","sources":["../src/service-booking-guarantees.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,2BAA2B,EAC3B,sCAAsC,EACtC,qBAAqB,EACrB,kBAAkB,EAClB,2BAA2B,EAC5B,MAAM,qBAAqB,CAAA;AAgB5B,eAAO,MAAM,8BAA8B;8BACf,kBAAkB,aAAa,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;+BASzD,kBAAkB,aACX,MAAM,QACX,2BAA2B,YACxB,qBAAqB;;;;;;;;;;;;;;;;;;;;iDA6D1B,kBAAkB,eACT,MAAM,QACb,sCAAsC,YACnC,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;+BAgE1B,kBAAkB,eACT,MAAM,QACb,2BAA2B,YACxB,qBAAqB;;;;;;;;;;;;;;;;;;;;+BA2C1B,kBAAkB,eACT,MAAM,YACV,qBAAqB;;;CA2EjC,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { financePaymentProcessingService } from "./service-payment-processing.js";
|
|
2
|
-
import { appendActionLedgerMutation, bookingGuarantees, bookings, buildBookingGuaranteeCreateActionLedgerInput, buildBookingGuaranteeDeleteActionLedgerInput, buildBookingGuaranteeUpdateActionLedgerInput, desc, eq, toTimestamp, } from "./service-shared.js";
|
|
2
|
+
import { and, appendActionLedgerMutation, bookingGuarantees, bookings, buildBookingGuaranteeCreateActionLedgerInput, buildBookingGuaranteeDeleteActionLedgerInput, buildBookingGuaranteeUpdateActionLedgerInput, desc, eq, ne, PaymentValidationError, toTimestamp, } from "./service-shared.js";
|
|
3
3
|
export const financeBookingGuaranteeService = {
|
|
4
4
|
listBookingGuarantees(db, bookingId) {
|
|
5
5
|
return db
|
|
@@ -128,6 +128,16 @@ export const financeBookingGuaranteeService = {
|
|
|
128
128
|
return row ?? null;
|
|
129
129
|
},
|
|
130
130
|
async deleteBookingGuarantee(db, guaranteeId, runtime = {}) {
|
|
131
|
+
function assertCanDeleteGuarantee(guarantee) {
|
|
132
|
+
if (guarantee.status === "active") {
|
|
133
|
+
throw new PaymentValidationError("Active guarantees must be released, cancelled, failed, or expired before deletion", { field: "status", status: guarantee.status, guaranteeId: guarantee.id }, { code: "active_guarantee_delete_forbidden" });
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
function assertDeleteSucceeded(row, guaranteeId) {
|
|
137
|
+
if (!row) {
|
|
138
|
+
throw new PaymentValidationError("Active guarantees must be released, cancelled, failed, or expired before deletion", { field: "status", status: "active", guaranteeId }, { code: "active_guarantee_delete_forbidden" });
|
|
139
|
+
}
|
|
140
|
+
}
|
|
131
141
|
const actionLedgerContext = runtime.actionLedgerContext;
|
|
132
142
|
if (actionLedgerContext) {
|
|
133
143
|
return db.transaction(async (tx) => {
|
|
@@ -139,15 +149,30 @@ export const financeBookingGuaranteeService = {
|
|
|
139
149
|
if (!existing) {
|
|
140
150
|
return null;
|
|
141
151
|
}
|
|
142
|
-
|
|
152
|
+
assertCanDeleteGuarantee(existing);
|
|
153
|
+
const [deleted] = await tx
|
|
154
|
+
.delete(bookingGuarantees)
|
|
155
|
+
.where(and(eq(bookingGuarantees.id, guaranteeId), ne(bookingGuarantees.status, "active")))
|
|
156
|
+
.returning({ id: bookingGuarantees.id });
|
|
157
|
+
assertDeleteSucceeded(deleted, guaranteeId);
|
|
143
158
|
await appendActionLedgerMutation(tx, buildBookingGuaranteeDeleteActionLedgerInput(actionLedgerContext, { guarantee: existing }, { authorizationSource: runtime.actionLedgerAuthorizationSource }));
|
|
144
159
|
return { id: existing.id };
|
|
145
160
|
});
|
|
146
161
|
}
|
|
162
|
+
const [existing] = await db
|
|
163
|
+
.select()
|
|
164
|
+
.from(bookingGuarantees)
|
|
165
|
+
.where(eq(bookingGuarantees.id, guaranteeId))
|
|
166
|
+
.limit(1);
|
|
167
|
+
if (!existing) {
|
|
168
|
+
return null;
|
|
169
|
+
}
|
|
170
|
+
assertCanDeleteGuarantee(existing);
|
|
147
171
|
const [row] = await db
|
|
148
172
|
.delete(bookingGuarantees)
|
|
149
|
-
.where(eq(bookingGuarantees.id, guaranteeId))
|
|
173
|
+
.where(and(eq(bookingGuarantees.id, guaranteeId), ne(bookingGuarantees.status, "active")))
|
|
150
174
|
.returning({ id: bookingGuarantees.id });
|
|
175
|
+
assertDeleteSucceeded(row, guaranteeId);
|
|
151
176
|
return row ?? null;
|
|
152
177
|
},
|
|
153
178
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service-booking-item-billing.d.ts","sourceRoot":"","sources":["../src/service-booking-item-billing.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,gCAAgC,EAChC,6BAA6B,EAC7B,kBAAkB,EAClB,gCAAgC,EAChC,6BAA6B,EAC9B,MAAM,qBAAqB,CAAA;
|
|
1
|
+
{"version":3,"file":"service-booking-item-billing.d.ts","sourceRoot":"","sources":["../src/service-booking-item-billing.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,gCAAgC,EAChC,6BAA6B,EAC7B,kBAAkB,EAClB,gCAAgC,EAChC,6BAA6B,EAC9B,MAAM,qBAAqB,CAAA;AAmD5B,eAAO,MAAM,gCAAgC;gCACf,kBAAkB,iBAAiB,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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+1,19 @@
|
|
|
1
|
-
import { asc, bookingItemCommissions, bookingItems, bookingItemTaxLines, desc, eq, } from "./service-shared.js";
|
|
1
|
+
import { asc, bookingItemCommissions, bookingItems, bookingItemTaxLines, desc, eq, PaymentValidationError, } from "./service-shared.js";
|
|
2
|
+
function validateBookingItemCommissionState(data) {
|
|
3
|
+
const commissionModel = data.commissionModel ?? "percentage";
|
|
4
|
+
if (commissionModel === "percentage" && data.rateBasisPoints == null) {
|
|
5
|
+
throw new PaymentValidationError("Percentage commissions require rateBasisPoints", { field: "rateBasisPoints", commissionModel }, { code: "invalid_commission_basis" });
|
|
6
|
+
}
|
|
7
|
+
if (commissionModel === "fixed" && (data.amountCents == null || !data.currency)) {
|
|
8
|
+
throw new PaymentValidationError("Fixed commissions require amountCents and currency", {
|
|
9
|
+
field: data.amountCents == null ? "amountCents" : "currency",
|
|
10
|
+
commissionModel,
|
|
11
|
+
}, { code: "invalid_commission_basis" });
|
|
12
|
+
}
|
|
13
|
+
if (data.status === "paid" && !data.paidAt) {
|
|
14
|
+
throw new PaymentValidationError("Paid commissions require paidAt settlement metadata", { field: "paidAt", status: data.status }, { code: "missing_commission_settlement_metadata" });
|
|
15
|
+
}
|
|
16
|
+
}
|
|
2
17
|
export const financeBookingItemBillingService = {
|
|
3
18
|
listBookingItemTaxLines(db, bookingItemId) {
|
|
4
19
|
return db
|
|
@@ -53,6 +68,7 @@ export const financeBookingItemBillingService = {
|
|
|
53
68
|
if (!bookingItem) {
|
|
54
69
|
return null;
|
|
55
70
|
}
|
|
71
|
+
validateBookingItemCommissionState(data);
|
|
56
72
|
const [row] = await db
|
|
57
73
|
.insert(bookingItemCommissions)
|
|
58
74
|
.values({ ...data, bookingItemId })
|
|
@@ -60,6 +76,15 @@ export const financeBookingItemBillingService = {
|
|
|
60
76
|
return row ?? null;
|
|
61
77
|
},
|
|
62
78
|
async updateBookingItemCommission(db, commissionId, data) {
|
|
79
|
+
const [existing] = await db
|
|
80
|
+
.select()
|
|
81
|
+
.from(bookingItemCommissions)
|
|
82
|
+
.where(eq(bookingItemCommissions.id, commissionId))
|
|
83
|
+
.limit(1);
|
|
84
|
+
if (!existing) {
|
|
85
|
+
return null;
|
|
86
|
+
}
|
|
87
|
+
validateBookingItemCommissionState({ ...existing, ...data });
|
|
63
88
|
const [row] = await db
|
|
64
89
|
.update(bookingItemCommissions)
|
|
65
90
|
.set({ ...data, updatedAt: new Date() })
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service-invoice-core.d.ts","sourceRoot":"","sources":["../src/service-invoice-core.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,kBAAkB,EAClB,qBAAqB,EACrB,gBAAgB,EAEhB,kBAAkB,EAClB,kBAAkB,EAClB,gBAAgB,EACjB,MAAM,qBAAqB,CAAA;
|
|
1
|
+
{"version":3,"file":"service-invoice-core.d.ts","sourceRoot":"","sources":["../src/service-invoice-core.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,kBAAkB,EAClB,qBAAqB,EACrB,gBAAgB,EAEhB,kBAAkB,EAClB,kBAAkB,EAClB,gBAAgB,EACjB,MAAM,qBAAqB,CAAA;AA6B5B,eAAO,MAAM,yBAAyB;qBACb,kBAAkB,SAAS,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sBAmH1C,kBAAkB,QAAQ,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uBAK3C,kBAAkB,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sBAqBjD,kBAAkB,MAClB,MAAM,QACJ,kBAAkB,YACf,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sBAoDR,kBAAkB,MAAM,MAAM,YAAW,qBAAqB;;;;;;;oBAgDhF,kBAAkB,MAClB,MAAM,UACH,gBAAgB,YACd,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4IjC,CAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { and, appendActionLedgerMutation, asc, buildInvoiceDeleteActionLedgerInput, buildInvoiceUpdateActionLedgerInput, creditNotes, desc, eq, gte, InvoiceNumberConflictError, ilike, inArray, invoiceExternalRefs, invoiceLineItems, invoiceNumberSeries, invoices, isInvoiceNumberUniqueConstraintError, isNotNull, lte, ne, or, payments, readStringMetadata, sql, } from "./service-shared.js";
|
|
1
|
+
import { and, appendActionLedgerMutation, asc, buildInvoiceDeleteActionLedgerInput, buildInvoiceUpdateActionLedgerInput, creditNotes, desc, eq, gte, InvoiceNumberConflictError, ilike, inArray, invoiceExternalRefs, invoiceLineItems, invoiceNumberSeries, invoices, isInvoiceNumberUniqueConstraintError, isNotNull, lte, ne, or, payments, readStringMetadata, sql, touchLinkedBookingUpdatedAt, } from "./service-shared.js";
|
|
2
2
|
export const financeInvoiceCoreService = {
|
|
3
3
|
async listInvoices(db, query) {
|
|
4
4
|
const conditions = [];
|
|
@@ -100,6 +100,7 @@ export const financeInvoiceCoreService = {
|
|
|
100
100
|
},
|
|
101
101
|
async createInvoice(db, data) {
|
|
102
102
|
const [row] = await db.insert(invoices).values(data).returning();
|
|
103
|
+
await touchLinkedBookingUpdatedAt(db, row?.bookingId);
|
|
103
104
|
return row;
|
|
104
105
|
},
|
|
105
106
|
async getInvoiceById(db, id) {
|
|
@@ -123,6 +124,14 @@ export const financeInvoiceCoreService = {
|
|
|
123
124
|
};
|
|
124
125
|
},
|
|
125
126
|
async updateInvoice(db, id, data, runtime = {}) {
|
|
127
|
+
const readExistingBookingId = async (reader) => {
|
|
128
|
+
const [existing] = await reader
|
|
129
|
+
.select({ bookingId: invoices.bookingId })
|
|
130
|
+
.from(invoices)
|
|
131
|
+
.where(eq(invoices.id, id))
|
|
132
|
+
.limit(1);
|
|
133
|
+
return existing?.bookingId ?? null;
|
|
134
|
+
};
|
|
126
135
|
const updateInvoiceRow = (writer) => writer
|
|
127
136
|
.update(invoices)
|
|
128
137
|
.set({ ...data, updatedAt: new Date() })
|
|
@@ -132,14 +141,18 @@ export const financeInvoiceCoreService = {
|
|
|
132
141
|
const actionLedgerContext = runtime.actionLedgerContext;
|
|
133
142
|
if (actionLedgerContext) {
|
|
134
143
|
return await db.transaction(async (tx) => {
|
|
144
|
+
const previousBookingId = await readExistingBookingId(tx);
|
|
135
145
|
const [row] = await updateInvoiceRow(tx);
|
|
136
146
|
if (row) {
|
|
147
|
+
await touchInvoiceBookingLinks(tx, previousBookingId, row.bookingId);
|
|
137
148
|
await appendActionLedgerMutation(tx, buildInvoiceUpdateActionLedgerInput(actionLedgerContext, { invoice: row, changes: data }, { authorizationSource: runtime.actionLedgerAuthorizationSource }));
|
|
138
149
|
}
|
|
139
150
|
return row ?? null;
|
|
140
151
|
});
|
|
141
152
|
}
|
|
153
|
+
const previousBookingId = await readExistingBookingId(db);
|
|
142
154
|
const [row] = await updateInvoiceRow(db);
|
|
155
|
+
await touchInvoiceBookingLinks(db, previousBookingId, row?.bookingId);
|
|
143
156
|
return row ?? null;
|
|
144
157
|
}
|
|
145
158
|
catch (error) {
|
|
@@ -161,12 +174,13 @@ export const financeInvoiceCoreService = {
|
|
|
161
174
|
return { status: "not_draft" };
|
|
162
175
|
}
|
|
163
176
|
await tx.delete(invoices).where(eq(invoices.id, id));
|
|
177
|
+
await touchLinkedBookingUpdatedAt(tx, existing.bookingId);
|
|
164
178
|
await appendActionLedgerMutation(tx, buildInvoiceDeleteActionLedgerInput(actionLedgerContext, { invoice: existing }, { authorizationSource: runtime.actionLedgerAuthorizationSource }));
|
|
165
179
|
return { status: "deleted" };
|
|
166
180
|
});
|
|
167
181
|
}
|
|
168
182
|
const [existing] = await db
|
|
169
|
-
.select({ id: invoices.id, status: invoices.status })
|
|
183
|
+
.select({ id: invoices.id, status: invoices.status, bookingId: invoices.bookingId })
|
|
170
184
|
.from(invoices)
|
|
171
185
|
.where(eq(invoices.id, id))
|
|
172
186
|
.limit(1);
|
|
@@ -177,6 +191,7 @@ export const financeInvoiceCoreService = {
|
|
|
177
191
|
return { status: "not_draft" };
|
|
178
192
|
}
|
|
179
193
|
await db.delete(invoices).where(eq(invoices.id, id));
|
|
194
|
+
await touchLinkedBookingUpdatedAt(db, existing.bookingId);
|
|
180
195
|
return { status: "deleted" };
|
|
181
196
|
},
|
|
182
197
|
async voidInvoice(db, id, input = {}, runtime = {}) {
|
|
@@ -239,6 +254,7 @@ export const financeInvoiceCoreService = {
|
|
|
239
254
|
if (!invoice) {
|
|
240
255
|
return { status: "not_found" };
|
|
241
256
|
}
|
|
257
|
+
await touchLinkedBookingUpdatedAt(tx, invoice.bookingId);
|
|
242
258
|
const actionLedgerContext = runtime.actionLedgerContext;
|
|
243
259
|
if (actionLedgerContext) {
|
|
244
260
|
await appendActionLedgerMutation(tx, buildInvoiceUpdateActionLedgerInput(actionLedgerContext, { invoice, changes: actionLedgerChanges }, { authorizationSource: runtime.actionLedgerAuthorizationSource }));
|
|
@@ -288,3 +304,9 @@ export const financeInvoiceCoreService = {
|
|
|
288
304
|
return result;
|
|
289
305
|
},
|
|
290
306
|
};
|
|
307
|
+
async function touchInvoiceBookingLinks(db, previousBookingId, nextBookingId) {
|
|
308
|
+
await touchLinkedBookingUpdatedAt(db, nextBookingId);
|
|
309
|
+
if (previousBookingId && previousBookingId !== nextBookingId) {
|
|
310
|
+
await touchLinkedBookingUpdatedAt(db, previousBookingId);
|
|
311
|
+
}
|
|
312
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service-invoice-from-booking.d.ts","sourceRoot":"","sources":["../src/service-invoice-from-booking.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,6BAA6B,EAC7B,qBAAqB,EACrB,sBAAsB,EACtB,kBAAkB,EACnB,MAAM,qBAAqB,CAAA;
|
|
1
|
+
{"version":3,"file":"service-invoice-from-booking.d.ts","sourceRoot":"","sources":["../src/service-invoice-from-booking.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,6BAA6B,EAC7B,qBAAqB,EACrB,sBAAsB,EACtB,kBAAkB,EACnB,MAAM,qBAAqB,CAAA;AAuG5B,eAAO,MAAM,gCAAgC;iCAErC,kBAAkB,QAChB,6BAA6B,eACtB,sBAAsB,YAC1B,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+PjC,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { financeInvoiceNumberingService } from "./service-invoice-numbering.js";
|
|
2
|
-
import { assertInvoiceFromBookingOverrideTotals, bookingItemCommissions, bookingItemTaxLines, bookingItemToInvoiceLine, bookingPaymentScheduleToInvoiceLine, eq, InvoiceFromBookingValidationError, InvoiceLineItemsPersistenceError, InvoiceNumberAllocationError, InvoiceNumberConflictError, invoiceExternalRefs, invoiceFromBookingExternalRefValues, invoiceFromBookingOverrideLineItems, invoiceLineItems, invoiceScopeForType, invoices, isInvoiceNumberUniqueConstraintError, normalizeCurrencyCode, or, pendingExternalInvoiceNumber, resolveBookingInvoiceBaseAmount, resolveFxMoneyBaseAmount, resolveInvoiceFromBookingDueDate, resolveInvoiceLineDescriptions, resolvePaymentScheduleDisplayItem, } from "./service-shared.js";
|
|
2
|
+
import { assertInvoiceFromBookingOverrideTotals, bookingItemCommissions, bookingItemTaxLines, bookingItemToInvoiceLine, bookingPaymentScheduleToInvoiceLine, eq, InvoiceFromBookingValidationError, InvoiceLineItemsPersistenceError, InvoiceNumberAllocationError, InvoiceNumberConflictError, invoiceExternalRefs, invoiceFromBookingExternalRefValues, invoiceFromBookingOverrideLineItems, invoiceLineItems, invoiceScopeForType, invoices, isInvoiceNumberUniqueConstraintError, normalizeCurrencyCode, or, pendingExternalInvoiceNumber, resolveBookingInvoiceBaseAmount, resolveFxMoneyBaseAmount, resolveInvoiceFromBookingDueDate, resolveInvoiceLineDescriptions, resolvePaymentScheduleDisplayItem, touchLinkedBookingUpdatedAt, } from "./service-shared.js";
|
|
3
3
|
async function resolveInvoiceNumberForBooking(db, data) {
|
|
4
4
|
const scope = invoiceScopeForType(data.invoiceType);
|
|
5
5
|
if (data.invoiceNumber) {
|
|
@@ -255,6 +255,7 @@ export const financeInvoiceFromBookingService = {
|
|
|
255
255
|
if (insertedLineItems.length !== lineItemValues.length) {
|
|
256
256
|
throw new InvoiceLineItemsPersistenceError(invoice.id, lineItemValues.length, insertedLineItems.length);
|
|
257
257
|
}
|
|
258
|
+
await touchLinkedBookingUpdatedAt(tx, booking.id);
|
|
258
259
|
return invoice;
|
|
259
260
|
});
|
|
260
261
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service-invoice-payments.d.ts","sourceRoot":"","sources":["../src/service-invoice-payments.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,kBAAkB,EAClB,qBAAqB,EAErB,gBAAgB,EAChB,kBAAkB,EAElB,iBAAiB,EACjB,kBAAkB,EACnB,MAAM,qBAAqB,CAAA;
|
|
1
|
+
{"version":3,"file":"service-invoice-payments.d.ts","sourceRoot":"","sources":["../src/service-invoice-payments.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,kBAAkB,EAClB,qBAAqB,EAErB,gBAAgB,EAChB,kBAAkB,EAElB,iBAAiB,EACjB,kBAAkB,EACnB,MAAM,qBAAqB,CAAA;AAyB5B,eAAO,MAAM,4BAA4B;qBACtB,kBAAkB,aAAa,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAQ5B,kBAAkB,SAAS,gBAAgB;cAS5C,iBAAiB,EAAE;;;;;IAuJ5C;;;;;OAKG;uBACsB,kBAAkB,MAAM,MAAM,GAAG,OAAO,CAAC,iBAAiB,GAAG,IAAI,CAAC;sBA4ErF,kBAAkB,aACX,MAAM,QACX,kBAAkB,YACf,qBAAqB;;;;;;;;;;;;;;;;;;;sBA0H1B,kBAAkB,MAClB,MAAM,QACJ,kBAAkB,YACf,qBAAqB;;;;;;;;;;;;;;;;;;;sBAyFR,kBAAkB,MAAM,MAAM,YAAW,qBAAqB;;;;;;;;;;;;;;;;;;;CAmCvF,CAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { and, appendActionLedgerMutation, assertInvoiceAcceptsNewPayment, assertPaymentCanSettleInvoice, buildPaymentDeleteActionLedgerInput, buildPaymentUpdateActionLedgerInput, buildRecordPaymentActionLedgerInput, desc, eq, getPaymentFromReplayedLedgerEntry, invoices, mapRawPayment, newId, paymentSettlementAmountSql, payments, recomputeInvoiceTotalsAfterPaymentChange, resolveFxMoneyBaseAmount, shouldNormalizeBaseAmount, sql, toRows, } from "./service-shared.js";
|
|
1
|
+
import { and, appendActionLedgerMutation, assertInvoiceAcceptsNewPayment, assertPaymentCanSettleInvoice, buildPaymentDeleteActionLedgerInput, buildPaymentUpdateActionLedgerInput, buildRecordPaymentActionLedgerInput, desc, eq, getPaymentFromReplayedLedgerEntry, invoices, mapRawPayment, newId, paymentSettlementAmountSql, payments, recomputeInvoiceTotalsAfterPaymentChange, resolveFxMoneyBaseAmount, shouldNormalizeBaseAmount, sql, toRows, touchLinkedBookingUpdatedAt, } from "./service-shared.js";
|
|
2
2
|
export const financeInvoicePaymentService = {
|
|
3
3
|
listPayments(db, invoiceId) {
|
|
4
4
|
return db
|
|
@@ -313,6 +313,7 @@ export const financeInvoicePaymentService = {
|
|
|
313
313
|
.update(invoices)
|
|
314
314
|
.set({ paidCents, balanceDueCents, status: newStatus, updatedAt: new Date() })
|
|
315
315
|
.where(eq(invoices.id, invoiceId));
|
|
316
|
+
await touchLinkedBookingUpdatedAt(tx, invoice.bookingId);
|
|
316
317
|
if (payment.status === "completed") {
|
|
317
318
|
recordedPaymentEvent = {
|
|
318
319
|
invoiceId: invoice.id,
|
|
@@ -399,6 +400,7 @@ export const financeInvoicePaymentService = {
|
|
|
399
400
|
return null;
|
|
400
401
|
}
|
|
401
402
|
await recomputeInvoiceTotalsAfterPaymentChange(tx, invoice);
|
|
403
|
+
await touchLinkedBookingUpdatedAt(tx, invoice.bookingId);
|
|
402
404
|
if (runtime.actionLedgerContext) {
|
|
403
405
|
await appendActionLedgerMutation(tx, buildPaymentUpdateActionLedgerInput(runtime.actionLedgerContext, { invoice, payment, changes: data }, { authorizationSource: runtime.actionLedgerAuthorizationSource }));
|
|
404
406
|
}
|
|
@@ -421,6 +423,7 @@ export const financeInvoicePaymentService = {
|
|
|
421
423
|
}
|
|
422
424
|
await tx.delete(payments).where(eq(payments.id, id));
|
|
423
425
|
await recomputeInvoiceTotalsAfterPaymentChange(tx, invoice);
|
|
426
|
+
await touchLinkedBookingUpdatedAt(tx, invoice.bookingId);
|
|
424
427
|
if (runtime.actionLedgerContext) {
|
|
425
428
|
await appendActionLedgerMutation(tx, buildPaymentDeleteActionLedgerInput(runtime.actionLedgerContext, { invoice, payment: existing }, { authorizationSource: runtime.actionLedgerAuthorizationSource }));
|
|
426
429
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service-issue.d.ts","sourceRoot":"","sources":["../src/service-issue.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAKjE,OAAO,EAEL,uBAAuB,EAGvB,QAAQ,EAET,MAAM,aAAa,CAAA;AACpB,OAAO,EAEL,KAAK,6BAA6B,EAClC,KAAK,qBAAqB,EAE1B,KAAK,sBAAsB,
|
|
1
|
+
{"version":3,"file":"service-issue.d.ts","sourceRoot":"","sources":["../src/service-issue.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAKjE,OAAO,EAEL,uBAAuB,EAGvB,QAAQ,EAET,MAAM,aAAa,CAAA;AACpB,OAAO,EAEL,KAAK,6BAA6B,EAClC,KAAK,qBAAqB,EAE1B,KAAK,sBAAsB,EAG5B,MAAM,cAAc,CAAA;AAErB;;;;;;;;GAQG;AAEH,MAAM,WAAW,mBAAoB,SAAQ,qBAAqB;CAAG;AAErE,UAAU,+BAA+B;IACvC,EAAE,EAAE,MAAM,CAAA;IACV,aAAa,EAAE,MAAM,CAAA;CACtB;AAED,MAAM,WAAW,kBAAkB;IACjC,SAAS,EAAE,MAAM,CAAA;IACjB,aAAa,EAAE,MAAM,CAAA;IACrB,WAAW,EAAE,SAAS,GAAG,UAAU,GAAG,aAAa,CAAA;IACnD,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;IACxB,UAAU,EAAE,MAAM,CAAA;IAClB,QAAQ,EAAE,MAA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BAA6B,EACpC,WAAW,EAAE,sBAAsB,EACnC,OAAO,GAAE,mBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UA0ClC;AAiCD,wBAAsB,uBAAuB,CAC3C,EAAE,EAAE,kBAAkB,EACtB,OAAO,EAAE,OAAO,QAAQ,CAAC,YAAY,EACrC,OAAO,GAAE,mBAAwB,GAChC,OAAO,CAAC,kBAAkB,CAAC,CAiF7B;AAoHD;;;;;;;;;;;GAWG;AACH,wBAAsB,wBAAwB,CAC5C,EAAE,EAAE,kBAAkB,EACtB,UAAU,EAAE,MAAM,EAClB,OAAO,GAAE;IACP,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,OAAO,CAAC,EAAE,MAAM,CAAA;CACZ,EACN,OAAO,GAAE,mBAAwB,GAChC,OAAO,CACN;IAAE,MAAM,EAAE,IAAI,CAAC;IAAC,OAAO,EAAE,OAAO,QAAQ,CAAC,YAAY,CAAA;CAAE,GACvD;IAAE,MAAM,EAAE,WAAW,CAAA;CAAE,GACvB;IAAE,MAAM,EAAE,cAAc,CAAA;CAAE,GAC1B;IAAE,MAAM,EAAE,mBAAmB,CAAC;IAAC,OAAO,EAAE,+BAA+B,GAAG,IAAI,CAAA;CAAE,GAChF;IAAE,MAAM,EAAE,0BAA0B,CAAC;IAAC,OAAO,EAAE,+BAA+B,CAAA;CAAE,CACnF,CA4JA"}
|
package/dist/service-issue.js
CHANGED
|
@@ -6,7 +6,7 @@ import { resolveBookingSellTaxRate } from "./booking-tax.js";
|
|
|
6
6
|
import { resolveInvoiceFxContext } from "./invoice-fx.js";
|
|
7
7
|
import { isInvoiceNumberUniqueConstraintError } from "./invoice-number-errors.js";
|
|
8
8
|
import { bookingItemTaxLines, bookingPaymentSchedules, invoiceLineItems, invoiceNumberSeries, invoices, payments, } from "./schema.js";
|
|
9
|
-
import { buildInvoiceIssuedActionLedgerInput, financeService, InvoiceNumberConflictError, } from "./service.js";
|
|
9
|
+
import { buildInvoiceIssuedActionLedgerInput, financeService, InvoiceNumberConflictError, touchLinkedBookingUpdatedAt, } from "./service.js";
|
|
10
10
|
const TAX_REGIME_CODES = new Set([
|
|
11
11
|
"standard",
|
|
12
12
|
"reduced",
|
|
@@ -40,12 +40,16 @@ export async function issueInvoiceFromBooking(db, input, bookingData, runtime =
|
|
|
40
40
|
? await db.transaction(async (tx) => {
|
|
41
41
|
const [row] = await updateIssuedInvoice(tx);
|
|
42
42
|
if (row) {
|
|
43
|
+
await touchLinkedBookingUpdatedAt(tx, row.bookingId);
|
|
43
44
|
await appendActionLedgerMutation(tx, await buildInvoiceIssuedActionLedgerInput(actionLedgerContext, { invoice: row }, { authorizationSource: runtime.actionLedgerAuthorizationSource }));
|
|
44
45
|
}
|
|
45
46
|
return row;
|
|
46
47
|
})
|
|
47
48
|
: (await updateIssuedInvoice(db))[0];
|
|
48
49
|
const row = issued ?? draft;
|
|
50
|
+
if (!actionLedgerContext) {
|
|
51
|
+
await touchLinkedBookingUpdatedAt(db, row.bookingId);
|
|
52
|
+
}
|
|
49
53
|
await emitIssued(db, runtime, ISSUED_EVENT, row, { skipExternalSync: input.skipExternalSync });
|
|
50
54
|
return row;
|
|
51
55
|
}
|
|
@@ -70,12 +74,16 @@ export async function issueProformaFromBooking(db, input, bookingData, runtime =
|
|
|
70
74
|
? await db.transaction(async (tx) => {
|
|
71
75
|
const [row] = await updateIssuedInvoice(tx);
|
|
72
76
|
if (row) {
|
|
77
|
+
await touchLinkedBookingUpdatedAt(tx, row.bookingId);
|
|
73
78
|
await appendActionLedgerMutation(tx, await buildInvoiceIssuedActionLedgerInput(actionLedgerContext, { invoice: row }, { authorizationSource: runtime.actionLedgerAuthorizationSource }));
|
|
74
79
|
}
|
|
75
80
|
return row;
|
|
76
81
|
})
|
|
77
82
|
: (await updateIssuedInvoice(db))[0];
|
|
78
83
|
const row = issued ?? draft;
|
|
84
|
+
if (!actionLedgerContext) {
|
|
85
|
+
await touchLinkedBookingUpdatedAt(db, row.bookingId);
|
|
86
|
+
}
|
|
79
87
|
await emitIssued(db, runtime, PROFORMA_ISSUED_EVENT, row, {
|
|
80
88
|
skipExternalSync: input.skipExternalSync,
|
|
81
89
|
});
|
|
@@ -398,6 +406,7 @@ export async function convertProformaToInvoice(db, proformaId, options = {}, run
|
|
|
398
406
|
updatedAt: now,
|
|
399
407
|
})
|
|
400
408
|
.where(eq(invoices.id, lockedProforma.id));
|
|
409
|
+
await touchLinkedBookingUpdatedAt(tx, inserted.bookingId, now);
|
|
401
410
|
return { status: "ok", invoice: inserted, proforma: lockedProforma };
|
|
402
411
|
})
|
|
403
412
|
.catch((error) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service-payment-sessions.d.ts","sourceRoot":"","sources":["../src/service-payment-sessions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,yBAAyB,EACzB,yBAAyB,EACzB,yBAAyB,EACzB,uBAAuB,EACvB,qBAAqB,EACrB,uCAAuC,EACvC,uBAAuB,EACvB,kBAAkB,EAClB,yBAAyB,EAC1B,MAAM,qBAAqB,CAAA;
|
|
1
|
+
{"version":3,"file":"service-payment-sessions.d.ts","sourceRoot":"","sources":["../src/service-payment-sessions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,yBAAyB,EACzB,yBAAyB,EACzB,yBAAyB,EACzB,uBAAuB,EACvB,qBAAqB,EACrB,uCAAuC,EACvC,uBAAuB,EACvB,kBAAkB,EAClB,yBAAyB,EAC1B,MAAM,qBAAqB,CAAA;AAyD5B,eAAO,MAAM,4BAA4B;4BACT,kBAAkB,SAAS,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8BA6ChD,kBAAkB,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6BAMxD,kBAAkB,QAChB,yBAAyB,YACtB,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6BAmE1B,kBAAkB,MAClB,MAAM,QACJ,yBAAyB,YACtB,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2CAgE1B,kBAAkB,MAClB,MAAM,QACJ,uCAAuC,YACpC,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2BAqD1B,kBAAkB,MAClB,MAAM,QACJ,uBAAuB,YACpB,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6BAkD1B,kBAAkB,MAClB,MAAM,QACJ,yBAAyB,YACtB,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6BA6C1B,kBAAkB,MAClB,MAAM,QACJ,yBAAyB,YACtB,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2CjC,CAAA"}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import { and, appendActionLedgerMutation, buildPaymentSessionCancelledActionLedgerInput, buildPaymentSessionCreateActionLedgerInput, buildPaymentSessionExpiredActionLedgerInput, buildPaymentSessionFailedActionLedgerInput, buildPaymentSessionRequiresRedirectActionLedgerInput, buildPaymentSessionUpdateActionLedgerInput, derivePaymentSessionTarget, desc, eq, paginate, paymentSessions, sql, toTimestamp, } from "./service-shared.js";
|
|
1
|
+
import { and, appendActionLedgerMutation, buildPaymentSessionCancelledActionLedgerInput, buildPaymentSessionCreateActionLedgerInput, buildPaymentSessionExpiredActionLedgerInput, buildPaymentSessionFailedActionLedgerInput, buildPaymentSessionRequiresRedirectActionLedgerInput, buildPaymentSessionUpdateActionLedgerInput, derivePaymentSessionTarget, desc, eq, paginate, paymentSessions, sql, toTimestamp, touchLinkedBookingUpdatedAt, } from "./service-shared.js";
|
|
2
|
+
async function touchPaymentSessionBooking(db, session) {
|
|
3
|
+
await touchLinkedBookingUpdatedAt(db, session?.bookingId);
|
|
4
|
+
}
|
|
2
5
|
function derivePaymentSessionTargetColumns(data) {
|
|
3
6
|
const explicitTarget = "target" in data ? data.target : undefined;
|
|
4
7
|
if (!explicitTarget)
|
|
@@ -105,6 +108,7 @@ export const financePaymentSessionService = {
|
|
|
105
108
|
const [row] = await db.transaction(async (tx) => {
|
|
106
109
|
const created = await createSession(tx);
|
|
107
110
|
if (created[0]) {
|
|
111
|
+
await touchPaymentSessionBooking(tx, created[0]);
|
|
108
112
|
await appendActionLedgerMutation(tx, await buildPaymentSessionCreateActionLedgerInput(actionLedgerContext, { session: created[0] }, { authorizationSource: runtime.actionLedgerAuthorizationSource }));
|
|
109
113
|
}
|
|
110
114
|
return created;
|
|
@@ -112,6 +116,7 @@ export const financePaymentSessionService = {
|
|
|
112
116
|
return row ?? null;
|
|
113
117
|
}
|
|
114
118
|
const [row] = await createSession(db);
|
|
119
|
+
await touchPaymentSessionBooking(db, row);
|
|
115
120
|
return row ?? null;
|
|
116
121
|
},
|
|
117
122
|
async updatePaymentSession(db, id, data, runtime = {}) {
|
|
@@ -147,6 +152,7 @@ export const financePaymentSessionService = {
|
|
|
147
152
|
const [row] = await db.transaction(async (tx) => {
|
|
148
153
|
const updated = await updateSession(tx);
|
|
149
154
|
if (updated[0]) {
|
|
155
|
+
await touchPaymentSessionBooking(tx, updated[0]);
|
|
150
156
|
await appendActionLedgerMutation(tx, buildPaymentSessionUpdateActionLedgerInput(actionLedgerContext, { session: updated[0], changes: data }, { authorizationSource: runtime.actionLedgerAuthorizationSource }));
|
|
151
157
|
}
|
|
152
158
|
return updated;
|
|
@@ -154,6 +160,7 @@ export const financePaymentSessionService = {
|
|
|
154
160
|
return row ?? null;
|
|
155
161
|
}
|
|
156
162
|
const [row] = await updateSession(db);
|
|
163
|
+
await touchPaymentSessionBooking(db, row);
|
|
157
164
|
return row ?? null;
|
|
158
165
|
},
|
|
159
166
|
async markPaymentSessionRequiresRedirect(db, id, data, runtime = {}) {
|
|
@@ -182,6 +189,7 @@ export const financePaymentSessionService = {
|
|
|
182
189
|
const [row] = await db.transaction(async (tx) => {
|
|
183
190
|
const updated = await markRequiresRedirect(tx);
|
|
184
191
|
if (updated[0]) {
|
|
192
|
+
await touchPaymentSessionBooking(tx, updated[0]);
|
|
185
193
|
await appendActionLedgerMutation(tx, buildPaymentSessionRequiresRedirectActionLedgerInput(actionLedgerContext, { session: updated[0], changes: data }, { authorizationSource: runtime.actionLedgerAuthorizationSource }));
|
|
186
194
|
}
|
|
187
195
|
return updated;
|
|
@@ -189,6 +197,7 @@ export const financePaymentSessionService = {
|
|
|
189
197
|
return row ?? null;
|
|
190
198
|
}
|
|
191
199
|
const [row] = await markRequiresRedirect(db);
|
|
200
|
+
await touchPaymentSessionBooking(db, row);
|
|
192
201
|
return row ?? null;
|
|
193
202
|
},
|
|
194
203
|
async failPaymentSession(db, id, data, runtime = {}) {
|
|
@@ -214,6 +223,7 @@ export const financePaymentSessionService = {
|
|
|
214
223
|
const [row] = await db.transaction(async (tx) => {
|
|
215
224
|
const updated = await failSession(tx);
|
|
216
225
|
if (updated[0]) {
|
|
226
|
+
await touchPaymentSessionBooking(tx, updated[0]);
|
|
217
227
|
await appendActionLedgerMutation(tx, buildPaymentSessionFailedActionLedgerInput(actionLedgerContext, { session: updated[0], changes: data }, { authorizationSource: runtime.actionLedgerAuthorizationSource }));
|
|
218
228
|
}
|
|
219
229
|
return updated;
|
|
@@ -221,6 +231,7 @@ export const financePaymentSessionService = {
|
|
|
221
231
|
return row ?? null;
|
|
222
232
|
}
|
|
223
233
|
const [row] = await failSession(db);
|
|
234
|
+
await touchPaymentSessionBooking(db, row);
|
|
224
235
|
return row ?? null;
|
|
225
236
|
},
|
|
226
237
|
async cancelPaymentSession(db, id, data, runtime = {}) {
|
|
@@ -241,6 +252,7 @@ export const financePaymentSessionService = {
|
|
|
241
252
|
const [row] = await db.transaction(async (tx) => {
|
|
242
253
|
const updated = await cancelSession(tx);
|
|
243
254
|
if (updated[0]) {
|
|
255
|
+
await touchPaymentSessionBooking(tx, updated[0]);
|
|
244
256
|
await appendActionLedgerMutation(tx, buildPaymentSessionCancelledActionLedgerInput(actionLedgerContext, { session: updated[0], changes: data }, { authorizationSource: runtime.actionLedgerAuthorizationSource }));
|
|
245
257
|
}
|
|
246
258
|
return updated;
|
|
@@ -248,6 +260,7 @@ export const financePaymentSessionService = {
|
|
|
248
260
|
return row ?? null;
|
|
249
261
|
}
|
|
250
262
|
const [row] = await cancelSession(db);
|
|
263
|
+
await touchPaymentSessionBooking(db, row);
|
|
251
264
|
return row ?? null;
|
|
252
265
|
},
|
|
253
266
|
async expirePaymentSession(db, id, data, runtime = {}) {
|
|
@@ -268,6 +281,7 @@ export const financePaymentSessionService = {
|
|
|
268
281
|
const [row] = await db.transaction(async (tx) => {
|
|
269
282
|
const updated = await expireSession(tx);
|
|
270
283
|
if (updated[0]) {
|
|
284
|
+
await touchPaymentSessionBooking(tx, updated[0]);
|
|
271
285
|
await appendActionLedgerMutation(tx, buildPaymentSessionExpiredActionLedgerInput(actionLedgerContext, { session: updated[0], changes: data }, { authorizationSource: runtime.actionLedgerAuthorizationSource }));
|
|
272
286
|
}
|
|
273
287
|
return updated;
|
|
@@ -275,6 +289,7 @@ export const financePaymentSessionService = {
|
|
|
275
289
|
return row ?? null;
|
|
276
290
|
}
|
|
277
291
|
const [row] = await expireSession(db);
|
|
292
|
+
await touchPaymentSessionBooking(db, row);
|
|
278
293
|
return row ?? null;
|
|
279
294
|
},
|
|
280
295
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service-public.d.ts","sourceRoot":"","sources":["../src/service-public.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;
|
|
1
|
+
{"version":3,"file":"service-public.d.ts","sourceRoot":"","sources":["../src/service-public.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAajE,OAA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