@voyant-travel/finance 0.157.0 → 0.158.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/voyant.js CHANGED
@@ -1,9 +1,9 @@
1
- import { defineExtension, defineModule, requirePort } from "@voyant-travel/core/project";
1
+ import { actionLedgerFinanceDriftRuntimePort } from "@voyant-travel/action-ledger/runtime-port";
2
+ import { bookingsFinanceRuntimePort } from "@voyant-travel/bookings/runtime-port";
3
+ import { defineExtension, defineModule, providePort, requirePort, } from "@voyant-travel/core/project";
2
4
  import { financeAccommodationsPaymentPolicyRuntimePort, financeCheckoutPaymentStartersRuntimePort, financeCruisesPaymentPolicyRuntimePort, financeDistributionPaymentPolicyRuntimePort, financeHostRuntimePort, financeInventoryPaymentPolicyRuntimePort, financeInvoiceSettlementPollerRuntimePort, financeNotificationsRuntimePort, financeOperatorSettingsRuntimePort, } from "./runtime-port.js";
3
- const financeAdminRuntime = {
4
- entry: "@voyant-travel/finance-react/admin",
5
- export: "createFinanceAdminExtension",
6
- };
5
+ import { financeVoyantAdmin } from "./voyant-admin.js";
6
+ import { bookingConfirmedPayloadSchema, bookingContractDocumentRequestedPayloadSchema, bookingCreatedPayloadSchema, bookingCreateRejectedPayloadSchema, bookingDualCreatedPayloadSchema, bookingPaymentSchedulePaidPayloadSchema, invoiceDocumentGeneratedPayloadSchema, invoiceIssuedPayloadSchema, invoicePaymentRecordedPayloadSchema, invoiceProformaConvertedPayloadSchema, invoiceRenderedPayloadSchema, invoiceSettledPayloadSchema, invoiceVoidedPayloadSchema, paymentCompletedPayloadSchema, } from "./voyant-event-schemas.js";
7
7
  /** Import-cheap deployment declaration owned by the finance package. */
8
8
  export const financeVoyantModule = defineModule({
9
9
  id: "@voyant-travel/finance",
@@ -19,7 +19,14 @@ export const financeVoyantModule = defineModule({
19
19
  cardinality: "many",
20
20
  }),
21
21
  ],
22
- provides: { capabilities: ["finance.payment-sessions"] },
22
+ provides: {
23
+ capabilities: ["finance.payment-sessions"],
24
+ ports: [
25
+ providePort(actionLedgerFinanceDriftRuntimePort),
26
+ providePort(bookingsFinanceRuntimePort),
27
+ providePort(financeHostRuntimePort),
28
+ ],
29
+ },
23
30
  api: [
24
31
  {
25
32
  id: "@voyant-travel/finance#api.admin",
@@ -66,18 +73,22 @@ export const financeVoyantModule = defineModule({
66
73
  links: [
67
74
  {
68
75
  id: "@voyant-travel/finance#linkable.creditNote",
76
+ kind: "linkable",
69
77
  source: "@voyant-travel/finance/linkables",
70
78
  },
71
79
  {
72
80
  id: "@voyant-travel/finance#linkable.invoice",
81
+ kind: "linkable",
73
82
  source: "@voyant-travel/finance/linkables",
74
83
  },
75
84
  {
76
85
  id: "@voyant-travel/finance#linkable.invoiceTemplate",
86
+ kind: "linkable",
77
87
  source: "@voyant-travel/finance/linkables",
78
88
  },
79
89
  {
80
90
  id: "@voyant-travel/finance#linkable.supplierInvoice",
91
+ kind: "linkable",
81
92
  source: "@voyant-travel/finance/linkables",
82
93
  },
83
94
  ],
@@ -86,7 +97,7 @@ export const financeVoyantModule = defineModule({
86
97
  id: "@voyant-travel/finance#event.invoice.issued",
87
98
  eventType: "invoice.issued",
88
99
  version: "1.0.0",
89
- payloadSchema: { type: "object", additionalProperties: true },
100
+ payloadSchema: invoiceIssuedPayloadSchema,
90
101
  visibility: "internal",
91
102
  audit: { sourceModule: "finance", category: "domain" },
92
103
  },
@@ -94,7 +105,7 @@ export const financeVoyantModule = defineModule({
94
105
  id: "@voyant-travel/finance#event.invoice.proforma.issued",
95
106
  eventType: "invoice.proforma.issued",
96
107
  version: "1.0.0",
97
- payloadSchema: { type: "object", additionalProperties: true },
108
+ payloadSchema: invoiceIssuedPayloadSchema,
98
109
  visibility: "internal",
99
110
  audit: { sourceModule: "finance", category: "domain" },
100
111
  },
@@ -102,7 +113,7 @@ export const financeVoyantModule = defineModule({
102
113
  id: "@voyant-travel/finance#event.invoice.proforma.converted",
103
114
  eventType: "invoice.proforma.converted",
104
115
  version: "1.0.0",
105
- payloadSchema: { type: "object", additionalProperties: true },
116
+ payloadSchema: invoiceProformaConvertedPayloadSchema,
106
117
  visibility: "internal",
107
118
  audit: { sourceModule: "finance", category: "domain" },
108
119
  },
@@ -110,7 +121,7 @@ export const financeVoyantModule = defineModule({
110
121
  id: "@voyant-travel/finance#event.invoice.voided",
111
122
  eventType: "invoice.voided",
112
123
  version: "1.0.0",
113
- payloadSchema: { type: "object", additionalProperties: true },
124
+ payloadSchema: invoiceVoidedPayloadSchema,
114
125
  visibility: "internal",
115
126
  audit: { sourceModule: "finance", category: "domain" },
116
127
  },
@@ -118,7 +129,7 @@ export const financeVoyantModule = defineModule({
118
129
  id: "@voyant-travel/finance#event.invoice.settled",
119
130
  eventType: "invoice.settled",
120
131
  version: "1.0.0",
121
- payloadSchema: { type: "object", additionalProperties: true },
132
+ payloadSchema: invoiceSettledPayloadSchema,
122
133
  visibility: "internal",
123
134
  audit: { sourceModule: "finance", category: "domain" },
124
135
  },
@@ -126,7 +137,7 @@ export const financeVoyantModule = defineModule({
126
137
  id: "@voyant-travel/finance#event.invoice.rendered",
127
138
  eventType: "invoice.rendered",
128
139
  version: "1.0.0",
129
- payloadSchema: { type: "object", additionalProperties: true },
140
+ payloadSchema: invoiceRenderedPayloadSchema,
130
141
  visibility: "internal",
131
142
  audit: { sourceModule: "finance", category: "domain" },
132
143
  },
@@ -134,7 +145,7 @@ export const financeVoyantModule = defineModule({
134
145
  id: "@voyant-travel/finance#event.invoice.document.generated",
135
146
  eventType: "invoice.document.generated",
136
147
  version: "1.0.0",
137
- payloadSchema: { type: "object", additionalProperties: true },
148
+ payloadSchema: invoiceDocumentGeneratedPayloadSchema,
138
149
  visibility: "internal",
139
150
  audit: { sourceModule: "finance", category: "domain" },
140
151
  },
@@ -142,7 +153,7 @@ export const financeVoyantModule = defineModule({
142
153
  id: "@voyant-travel/finance#event.invoice.payment.recorded",
143
154
  eventType: "invoice.payment.recorded",
144
155
  version: "1.0.0",
145
- payloadSchema: { type: "object", additionalProperties: true },
156
+ payloadSchema: invoicePaymentRecordedPayloadSchema,
146
157
  visibility: "internal",
147
158
  audit: { sourceModule: "finance", category: "domain" },
148
159
  },
@@ -150,7 +161,7 @@ export const financeVoyantModule = defineModule({
150
161
  id: "@voyant-travel/finance#event.payment.completed",
151
162
  eventType: "payment.completed",
152
163
  version: "1.0.0",
153
- payloadSchema: { type: "object", additionalProperties: true },
164
+ payloadSchema: paymentCompletedPayloadSchema,
154
165
  visibility: "internal",
155
166
  audit: { sourceModule: "finance", category: "domain" },
156
167
  },
@@ -158,7 +169,7 @@ export const financeVoyantModule = defineModule({
158
169
  id: "@voyant-travel/finance#event.booking.created",
159
170
  eventType: "booking.created",
160
171
  version: "1.0.0",
161
- payloadSchema: { type: "object", additionalProperties: true },
172
+ payloadSchema: bookingCreatedPayloadSchema,
162
173
  visibility: "internal",
163
174
  audit: { sourceModule: "finance", category: "domain" },
164
175
  },
@@ -166,7 +177,7 @@ export const financeVoyantModule = defineModule({
166
177
  id: "@voyant-travel/finance#event.booking.confirmed",
167
178
  eventType: "booking.confirmed",
168
179
  version: "1.0.0",
169
- payloadSchema: { type: "object", additionalProperties: true },
180
+ payloadSchema: bookingConfirmedPayloadSchema,
170
181
  visibility: "internal",
171
182
  audit: { sourceModule: "finance", category: "domain" },
172
183
  },
@@ -174,7 +185,7 @@ export const financeVoyantModule = defineModule({
174
185
  id: "@voyant-travel/finance#event.booking.dual-created",
175
186
  eventType: "booking.dual-created",
176
187
  version: "1.0.0",
177
- payloadSchema: { type: "object", additionalProperties: true },
188
+ payloadSchema: bookingDualCreatedPayloadSchema,
178
189
  visibility: "internal",
179
190
  audit: { sourceModule: "finance", category: "domain" },
180
191
  },
@@ -182,7 +193,7 @@ export const financeVoyantModule = defineModule({
182
193
  id: "@voyant-travel/finance#event.booking-create.rejected",
183
194
  eventType: "booking_create.rejected",
184
195
  version: "1.0.0",
185
- payloadSchema: { type: "object", additionalProperties: true },
196
+ payloadSchema: bookingCreateRejectedPayloadSchema,
186
197
  visibility: "internal",
187
198
  audit: { sourceModule: "finance", category: "domain" },
188
199
  },
@@ -190,7 +201,7 @@ export const financeVoyantModule = defineModule({
190
201
  id: "@voyant-travel/finance#event.booking.contract-document.requested",
191
202
  eventType: "booking.contract_document.requested",
192
203
  version: "1.0.0",
193
- payloadSchema: { type: "object", additionalProperties: true },
204
+ payloadSchema: bookingContractDocumentRequestedPayloadSchema,
194
205
  visibility: "internal",
195
206
  audit: { sourceModule: "finance", category: "domain" },
196
207
  },
@@ -198,7 +209,7 @@ export const financeVoyantModule = defineModule({
198
209
  id: "@voyant-travel/finance#event.booking-payment-schedule.paid",
199
210
  eventType: "booking_payment_schedule.paid",
200
211
  version: "1.0.0",
201
- payloadSchema: { type: "object", additionalProperties: true },
212
+ payloadSchema: bookingPaymentSchedulePaidPayloadSchema,
202
213
  visibility: "internal",
203
214
  audit: { sourceModule: "finance", category: "domain" },
204
215
  },
@@ -219,12 +230,33 @@ export const financeVoyantModule = defineModule({
219
230
  {
220
231
  id: "@voyant-travel/finance#access.finance",
221
232
  resource: "finance",
222
- actions: ["read", "write", "refund", "void"],
223
- },
224
- {
225
- id: "@voyant-travel/finance#access.transactions",
226
- resource: "transactions",
227
- actions: ["read", "write"],
233
+ label: "Finance",
234
+ description: "Read and manage invoices, payments, credits, and settlements.",
235
+ actions: [
236
+ {
237
+ action: "read",
238
+ label: "Read finance records",
239
+ description: "Read invoices, payments, credits, and settlement state.",
240
+ },
241
+ {
242
+ action: "write",
243
+ label: "Manage finance records",
244
+ description: "Create and update invoices, payments, credits, and settlements.",
245
+ sensitive: true,
246
+ },
247
+ {
248
+ action: "refund",
249
+ label: "Refund payments",
250
+ description: "Issue financial refunds against eligible payments.",
251
+ sensitive: true,
252
+ },
253
+ {
254
+ action: "void",
255
+ label: "Void invoices",
256
+ description: "Irreversibly void an eligible invoice.",
257
+ sensitive: true,
258
+ },
259
+ ],
228
260
  },
229
261
  ],
230
262
  },
@@ -235,6 +267,7 @@ export const financeVoyantModule = defineModule({
235
267
  runtime: { entry: "@voyant-travel/finance/tools", export: "listInvoicesTool" },
236
268
  requiredScopes: ["finance:read"],
237
269
  context: ["finance"],
270
+ risk: "low",
238
271
  },
239
272
  {
240
273
  id: "@voyant-travel/finance#tool.get-invoice",
@@ -242,6 +275,7 @@ export const financeVoyantModule = defineModule({
242
275
  runtime: { entry: "@voyant-travel/finance/tools", export: "getInvoiceTool" },
243
276
  requiredScopes: ["finance:read"],
244
277
  context: ["finance"],
278
+ risk: "low",
245
279
  },
246
280
  {
247
281
  id: "@voyant-travel/finance#tool.void-invoice",
@@ -249,52 +283,35 @@ export const financeVoyantModule = defineModule({
249
283
  runtime: { entry: "@voyant-travel/finance/tools", export: "voidInvoiceTool" },
250
284
  requiredScopes: ["finance:void"],
251
285
  context: ["finance"],
286
+ risk: "critical",
252
287
  },
253
288
  ],
254
- admin: {
255
- compositionOrder: 40,
256
- runtime: {
257
- entry: "@voyant-travel/finance-react/admin",
258
- export: "createSelectedFinanceAdminExtension",
289
+ actions: [
290
+ {
291
+ id: "@voyant-travel/finance#action.void-invoice",
292
+ version: "v1",
293
+ kind: "execute",
294
+ targetType: "invoice",
295
+ resource: "finance",
296
+ action: "void",
297
+ requiredScopes: ["finance:void"],
298
+ risk: "critical",
299
+ ledger: "required",
300
+ approval: "required",
301
+ reversible: false,
302
+ from: { tools: ["@voyant-travel/finance#tool.void-invoice"] },
259
303
  },
260
- copy: [
261
- {
262
- id: "@voyant-travel/finance#admin.copy",
263
- namespace: "finance.admin",
264
- fallbackLocale: "en",
265
- runtime: {
266
- entry: "@voyant-travel/finance-react/i18n",
267
- export: "financeUiMessageDefinitions",
268
- },
304
+ ],
305
+ admin: financeVoyantAdmin,
306
+ presentations: [
307
+ {
308
+ id: "@voyant-travel/finance#presentation.public",
309
+ runtime: {
310
+ entry: "@voyant-travel/finance-react/public-routes",
311
+ export: "createFinancePublicRouteContribution",
269
312
  },
270
- ],
271
- routes: [
272
- ["index", "/finance"],
273
- ["invoices-index", "/finance/invoices"],
274
- ["invoices-detail", "/finance/invoices/$id"],
275
- ["invoice-number-series", "/finance/invoice-number-series"],
276
- ["payments-index", "/finance/payments"],
277
- ["payments-detail", "/finance/payments/$id"],
278
- ["supplier-invoices-index", "/finance/supplier-invoices"],
279
- ["supplier-invoices-detail", "/finance/supplier-invoices/$id"],
280
- ["profitability", "/finance/profitability"],
281
- ].map(([id, path]) => ({
282
- id: `@voyant-travel/finance#admin.route.${id}`,
283
- path,
284
- runtime: financeAdminRuntime,
285
- })),
286
- contributions: [
287
- ["booking-payment-controller", "booking.details.payment-controller"],
288
- ["booking-invoices", "booking.details.invoices-tab"],
289
- ["booking-pending-payment-sessions", "booking.details.finance-start"],
290
- ["booking-payment-policy", "booking.details.finance-end"],
291
- ["supplier-payment-policy", "supplier.details.payment-policy"],
292
- ].map(([id, slotId]) => ({
293
- id: `@voyant-travel/finance#admin.contribution.${id}`,
294
- slotId,
295
- runtime: financeAdminRuntime,
296
- })),
297
- },
313
+ },
314
+ ],
298
315
  lifecycle: {
299
316
  uninstall: { default: "retain-data", purge: "not-supported" },
300
317
  },
@@ -392,7 +409,7 @@ export const financeBookingScheduleVoyantPlugin = defineExtension({
392
409
  eventType: "booking.confirmed",
393
410
  source: "@voyant-travel/finance/booking-schedule-subscriber",
394
411
  runtime: {
395
- entry: "./booking-schedule-subscriber",
412
+ entry: "@voyant-travel/finance/booking-schedule-subscriber",
396
413
  export: "bookingScheduleConfirmedSubscriber",
397
414
  },
398
415
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@voyant-travel/finance",
3
- "version": "0.157.0",
3
+ "version": "0.158.0",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "exports": {
@@ -145,16 +145,16 @@
145
145
  "fflate": "^0.8.2",
146
146
  "hono": "^4.12.27",
147
147
  "zod": "^4.4.3",
148
- "@voyant-travel/action-ledger": "^0.108.4",
149
- "@voyant-travel/bookings": "^0.157.0",
150
- "@voyant-travel/core": "^0.122.1",
151
- "@voyant-travel/db": "^0.114.4",
152
- "@voyant-travel/types": "^0.109.1",
148
+ "@voyant-travel/action-ledger": "^0.108.5",
149
+ "@voyant-travel/bookings": "^0.158.0",
150
+ "@voyant-travel/core": "^0.122.2",
151
+ "@voyant-travel/db": "^0.114.5",
153
152
  "@voyant-travel/finance-contracts": "^0.106.1",
153
+ "@voyant-travel/types": "^0.109.2",
154
154
  "@voyant-travel/hono": "^0.126.3",
155
- "@voyant-travel/public-document-delivery": "^0.3.4",
156
- "@voyant-travel/storage": "^0.109.4",
155
+ "@voyant-travel/storage": "^0.110.0",
157
156
  "@voyant-travel/utils": "^0.107.1",
157
+ "@voyant-travel/public-document-delivery": "^0.3.5",
158
158
  "@voyant-travel/tools": "^0.2.1"
159
159
  },
160
160
  "devDependencies": {