@voyant-travel/finance 0.194.0 → 0.194.1

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/README.md CHANGED
@@ -5,9 +5,13 @@ Finance module for Voyant. Invoices, payments, credit notes, supplier payments,
5
5
  ## Composed agent commands
6
6
 
7
7
  `create_booking` is owned by the Finance booking-create extension because that package
8
- already owns the atomic composer spanning product conversion, travelers, room/item
8
+ already owns the composer spanning product conversion, travelers, room/item
9
9
  lines, payment schedules, optional credits and group membership, invoices, ledger
10
10
  records, and post-commit events. The Tool is a structural adapter over that service.
11
+ Its selected action policy is handler-owned: the service records the canonical booking
12
+ id in the authoritative `booking.create` ledger entry, while the generic pre-dispatch
13
+ gate cannot know that id safely. The booking transaction commits before some finance
14
+ and document stages, so this command is not yet an exact-replay boundary.
11
15
 
12
16
  `issue_invoice_from_booking` creates and issues either an invoice or proforma through
13
17
  the same package-owned composer used by the HTTP route. Agent execution requires an
package/dist/tools.js CHANGED
@@ -177,7 +177,7 @@ export const createBookingTool = defineTool({
177
177
  capabilityVersion: "v1",
178
178
  name: "create_booking",
179
179
  aliases: ["bookings_create"],
180
- description: "Atomically create a booking from a product or slot with travelers, room/item lines, payment schedules, optional credit, group membership, and invoice documents.",
180
+ description: "Create a booking from a product or slot with travelers, room/item lines, payment schedules, optional credit, group membership, and invoice documents.",
181
181
  inputSchema: createBookingToolInputSchema,
182
182
  outputSchema: bookingCreateSummarySchema,
183
183
  requiredScopes: ["bookings:write", "finance:write"],
@@ -190,6 +190,11 @@ export const createBookingTool = defineTool({
190
190
  confirmationRequired: true,
191
191
  sideEffects: ["data-write", "external-booking", "payment"],
192
192
  },
193
+ // Finance records the authoritative booking.create action with the generated
194
+ // booking id inside the booking transaction. The generic gate cannot know
195
+ // that id before dispatch and would create a second, caller-invented ledger
196
+ // timeline.
197
+ actionPolicyEnforcement: "handler",
193
198
  async handler({ booking }, ctx) {
194
199
  const outcome = await finance(ctx).createBooking(booking);
195
200
  if (outcome.status !== "ok") {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@voyant-travel/finance",
3
- "version": "0.194.0",
3
+ "version": "0.194.1",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "exports": {
@@ -157,18 +157,18 @@
157
157
  "hono": "^4.12.27",
158
158
  "zod": "^4.4.3",
159
159
  "@voyant-travel/action-ledger": "^0.111.14",
160
- "@voyant-travel/bookings": "^0.194.0",
160
+ "@voyant-travel/bookings": "^0.194.1",
161
161
  "@voyant-travel/core": "^0.132.1",
162
- "@voyant-travel/db": "^0.118.1",
163
162
  "@voyant-travel/types": "^0.109.9",
164
163
  "@voyant-travel/finance-contracts": "^0.107.2",
164
+ "@voyant-travel/payments": "^0.6.1",
165
165
  "@voyant-travel/hono": "^0.134.1",
166
166
  "@voyant-travel/public-document-delivery": "^0.4.12",
167
- "@voyant-travel/payments": "^0.6.1",
168
167
  "@voyant-travel/reporting-contracts": "^0.3.2",
169
168
  "@voyant-travel/storage": "^0.113.3",
169
+ "@voyant-travel/tools": "^0.3.0",
170
170
  "@voyant-travel/utils": "^0.109.0",
171
- "@voyant-travel/tools": "^0.3.0"
171
+ "@voyant-travel/db": "^0.118.1"
172
172
  },
173
173
  "devDependencies": {
174
174
  "drizzle-kit": "^0.31.10",