@voyant-travel/finance 0.158.0 → 0.161.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/tools.d.ts CHANGED
@@ -1,17 +1,40 @@
1
1
  /**
2
- * Finance agent tools on the framework tool contract. Thin, read-only wrappers
3
- * over the existing finance service; the service is injected on the tool context
2
+ * Finance agent tools on the framework tool contract. Thin wrappers over the
3
+ * existing finance service; the service is injected on the tool context
4
4
  * by intersection so this module stays deployment-agnostic.
5
+ * Refunds are issued through the credit-note service after action approval.
5
6
  */
6
7
  import { type ToolContext } from "@voyant-travel/tools";
7
8
  import { z } from "zod";
9
+ import { type BookingCreateOutcome, bookingCreateSchema } from "./service-booking-create.js";
8
10
  import { invoiceListQuerySchema } from "./validation.js";
9
11
  export interface FinanceToolServices {
10
12
  listInvoices(query: z.infer<typeof invoiceListQuerySchema>): Promise<unknown>;
11
13
  getInvoiceById(id: string): Promise<unknown>;
14
+ getFinanceAggregates(query: {
15
+ range?: "this_month" | "last_month" | "year_to_date" | "all_time" | "custom";
16
+ from?: string;
17
+ to?: string;
18
+ outstandingTopLimit?: number;
19
+ }): Promise<unknown>;
12
20
  voidInvoice(id: string, input: {
13
21
  reason?: string;
14
22
  }): Promise<unknown>;
23
+ issueInvoiceRefund(input: {
24
+ invoiceId: string;
25
+ creditNoteNumber: string;
26
+ amountCents: number;
27
+ currency: string;
28
+ baseCurrency?: string | null;
29
+ baseAmountCents?: number | null;
30
+ fxRateSetId?: string | null;
31
+ reason: string;
32
+ notes?: string | null;
33
+ idempotencyKey: string;
34
+ approvalId?: string;
35
+ }): Promise<unknown>;
36
+ createBooking(input: z.infer<typeof bookingCreateSchema>): Promise<BookingCreateOutcome>;
37
+ issueInvoiceFromBooking(input: z.infer<typeof issueInvoiceFromBookingToolInputSchema>): Promise<unknown>;
15
38
  }
16
39
  export type FinanceToolContext = ToolContext & {
17
40
  finance?: FinanceToolServices;
@@ -37,6 +60,760 @@ export declare const voidInvoiceTool: import("@voyant-travel/tools").ToolDefinit
37
60
  id: string;
38
61
  reason?: string | undefined;
39
62
  }, unknown, FinanceToolContext>;
63
+ export declare const issueInvoiceRefundInputSchema: z.ZodObject<{
64
+ notes: z.ZodNullable<z.ZodOptional<z.ZodString>>;
65
+ currency: z.ZodString;
66
+ baseCurrency: z.ZodNullable<z.ZodOptional<z.ZodString>>;
67
+ fxRateSetId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
68
+ amountCents: z.ZodNumber;
69
+ baseAmountCents: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
70
+ creditNoteNumber: z.ZodString;
71
+ reason: z.ZodString;
72
+ invoiceId: z.ZodString;
73
+ idempotencyKey: z.ZodString;
74
+ approvalId: z.ZodOptional<z.ZodString>;
75
+ }, z.core.$strip>;
76
+ export declare const issueInvoiceRefundOutputSchema: z.ZodUnion<readonly [z.ZodObject<{
77
+ status: z.ZodLiteral<"approval_required">;
78
+ requestedAction: z.ZodObject<{
79
+ id: z.ZodString;
80
+ status: z.ZodString;
81
+ actionName: z.ZodString;
82
+ targetType: z.ZodString;
83
+ targetId: z.ZodString;
84
+ }, z.core.$strip>;
85
+ approval: z.ZodObject<{
86
+ id: z.ZodString;
87
+ status: z.ZodString;
88
+ requestedActionId: z.ZodString;
89
+ policyName: z.ZodString;
90
+ policyVersion: z.ZodString;
91
+ riskSnapshot: z.ZodString;
92
+ reasonCode: z.ZodString;
93
+ expiresAt: z.ZodNullable<z.ZodString>;
94
+ createdAt: z.ZodString;
95
+ }, z.core.$strip>;
96
+ replayed: z.ZodBoolean;
97
+ }, z.core.$strip>, z.ZodObject<{
98
+ status: z.ZodLiteral<"issued">;
99
+ creditNote: z.ZodObject<{
100
+ id: z.ZodString;
101
+ creditNoteNumber: z.ZodString;
102
+ invoiceId: z.ZodString;
103
+ status: z.ZodEnum<{
104
+ draft: "draft";
105
+ issued: "issued";
106
+ applied: "applied";
107
+ }>;
108
+ amountCents: z.ZodNumber;
109
+ currency: z.ZodString;
110
+ baseCurrency: z.ZodNullable<z.ZodString>;
111
+ baseAmountCents: z.ZodNullable<z.ZodNumber>;
112
+ fxRateSetId: z.ZodNullable<z.ZodString>;
113
+ reason: z.ZodString;
114
+ notes: z.ZodNullable<z.ZodString>;
115
+ createdAt: z.ZodString;
116
+ updatedAt: z.ZodString;
117
+ }, z.core.$strip>;
118
+ replayed: z.ZodBoolean;
119
+ }, z.core.$strip>]>;
120
+ export declare const issueInvoiceRefundTool: import("@voyant-travel/tools").ToolDefinition<{
121
+ currency: string;
122
+ amountCents: number;
123
+ creditNoteNumber: string;
124
+ reason: string;
125
+ invoiceId: string;
126
+ idempotencyKey: string;
127
+ notes?: string | null | undefined;
128
+ baseCurrency?: string | null | undefined;
129
+ fxRateSetId?: string | null | undefined;
130
+ baseAmountCents?: number | null | undefined;
131
+ approvalId?: string | undefined;
132
+ }, {
133
+ status: "approval_required";
134
+ requestedAction: {
135
+ id: string;
136
+ status: string;
137
+ actionName: string;
138
+ targetType: string;
139
+ targetId: string;
140
+ };
141
+ approval: {
142
+ id: string;
143
+ status: string;
144
+ requestedActionId: string;
145
+ policyName: string;
146
+ policyVersion: string;
147
+ riskSnapshot: string;
148
+ reasonCode: string;
149
+ expiresAt: string | null;
150
+ createdAt: string;
151
+ };
152
+ replayed: boolean;
153
+ } | {
154
+ status: "issued";
155
+ creditNote: {
156
+ id: string;
157
+ creditNoteNumber: string;
158
+ invoiceId: string;
159
+ status: "draft" | "issued" | "applied";
160
+ amountCents: number;
161
+ currency: string;
162
+ baseCurrency: string | null;
163
+ baseAmountCents: number | null;
164
+ fxRateSetId: string | null;
165
+ reason: string;
166
+ notes: string | null;
167
+ createdAt: string;
168
+ updatedAt: string;
169
+ };
170
+ replayed: boolean;
171
+ }, FinanceToolContext>;
172
+ export declare const createBookingToolInputSchema: z.ZodObject<{
173
+ booking: z.ZodObject<{
174
+ productId: z.ZodString;
175
+ optionId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
176
+ slotId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
177
+ availabilityHoldToken: z.ZodOptional<z.ZodString>;
178
+ bookingNumber: z.ZodString;
179
+ personId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
180
+ organizationId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
181
+ pax: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
182
+ internalNotes: z.ZodNullable<z.ZodOptional<z.ZodString>>;
183
+ sellAmountCentsOverride: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
184
+ catalogSellAmountCents: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
185
+ confirmedSellAmountCents: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
186
+ priceOverrideReason: z.ZodNullable<z.ZodOptional<z.ZodString>>;
187
+ initialStatus: z.ZodOptional<z.ZodEnum<{
188
+ draft: "draft";
189
+ on_hold: "on_hold";
190
+ awaiting_payment: "awaiting_payment";
191
+ confirmed: "confirmed";
192
+ in_progress: "in_progress";
193
+ completed: "completed";
194
+ expired: "expired";
195
+ cancelled: "cancelled";
196
+ }>>;
197
+ suppressNotifications: z.ZodOptional<z.ZodBoolean>;
198
+ allowDuplicate: z.ZodOptional<z.ZodBoolean>;
199
+ contactFirstName: z.ZodNullable<z.ZodOptional<z.ZodString>>;
200
+ contactLastName: z.ZodNullable<z.ZodOptional<z.ZodString>>;
201
+ contactEmail: z.ZodNullable<z.ZodOptional<z.ZodString>>;
202
+ contactPhone: z.ZodNullable<z.ZodOptional<z.ZodString>>;
203
+ contactPreferredLanguage: z.ZodNullable<z.ZodOptional<z.ZodString>>;
204
+ contactCountry: z.ZodNullable<z.ZodOptional<z.ZodString>>;
205
+ contactRegion: z.ZodNullable<z.ZodOptional<z.ZodString>>;
206
+ contactCity: z.ZodNullable<z.ZodOptional<z.ZodString>>;
207
+ contactAddressLine1: z.ZodNullable<z.ZodOptional<z.ZodString>>;
208
+ contactAddressLine2: z.ZodNullable<z.ZodOptional<z.ZodString>>;
209
+ contactPostalCode: z.ZodNullable<z.ZodOptional<z.ZodString>>;
210
+ travelers: z.ZodOptional<z.ZodArray<z.ZodObject<{
211
+ clientTravelerKey: z.ZodNullable<z.ZodOptional<z.ZodString>>;
212
+ firstName: z.ZodString;
213
+ lastName: z.ZodString;
214
+ email: z.ZodNullable<z.ZodOptional<z.ZodString>>;
215
+ phone: z.ZodNullable<z.ZodOptional<z.ZodString>>;
216
+ personId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
217
+ participantType: z.ZodDefault<z.ZodEnum<{
218
+ other: "other";
219
+ traveler: "traveler";
220
+ occupant: "occupant";
221
+ }>>;
222
+ travelerCategory: z.ZodNullable<z.ZodOptional<z.ZodEnum<{
223
+ other: "other";
224
+ adult: "adult";
225
+ child: "child";
226
+ infant: "infant";
227
+ senior: "senior";
228
+ }>>>;
229
+ preferredLanguage: z.ZodNullable<z.ZodOptional<z.ZodString>>;
230
+ specialRequests: z.ZodNullable<z.ZodOptional<z.ZodString>>;
231
+ roomUnitId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
232
+ isPrimary: z.ZodNullable<z.ZodOptional<z.ZodBoolean>>;
233
+ notes: z.ZodNullable<z.ZodOptional<z.ZodString>>;
234
+ }, z.core.$strip>>>;
235
+ itemLines: z.ZodOptional<z.ZodArray<z.ZodObject<{
236
+ clientLineKey: z.ZodNullable<z.ZodOptional<z.ZodString>>;
237
+ optionUnitId: z.ZodString;
238
+ quantity: z.ZodNumber;
239
+ title: z.ZodNullable<z.ZodOptional<z.ZodString>>;
240
+ description: z.ZodNullable<z.ZodOptional<z.ZodString>>;
241
+ unitSellAmountCents: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
242
+ totalSellAmountCents: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
243
+ travelerKeys: z.ZodNullable<z.ZodOptional<z.ZodArray<z.ZodString>>>;
244
+ travelerIndexes: z.ZodNullable<z.ZodOptional<z.ZodArray<z.ZodNumber>>>;
245
+ }, z.core.$strip>>>;
246
+ extraLines: z.ZodOptional<z.ZodArray<z.ZodObject<{
247
+ clientLineKey: z.ZodNullable<z.ZodOptional<z.ZodString>>;
248
+ productExtraId: z.ZodString;
249
+ optionExtraConfigId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
250
+ name: z.ZodString;
251
+ description: z.ZodNullable<z.ZodOptional<z.ZodString>>;
252
+ pricingMode: z.ZodNullable<z.ZodOptional<z.ZodString>>;
253
+ pricedPerPerson: z.ZodNullable<z.ZodOptional<z.ZodBoolean>>;
254
+ quantity: z.ZodNumber;
255
+ sellCurrency: z.ZodString;
256
+ unitSellAmountCents: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
257
+ totalSellAmountCents: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
258
+ travelerKeys: z.ZodNullable<z.ZodOptional<z.ZodArray<z.ZodString>>>;
259
+ travelerIndexes: z.ZodNullable<z.ZodOptional<z.ZodArray<z.ZodNumber>>>;
260
+ }, z.core.$strip>>>;
261
+ paymentSchedules: z.ZodOptional<z.ZodArray<z.ZodObject<{
262
+ scheduleType: z.ZodDefault<z.ZodEnum<{
263
+ other: "other";
264
+ deposit: "deposit";
265
+ installment: "installment";
266
+ balance: "balance";
267
+ hold: "hold";
268
+ }>>;
269
+ status: z.ZodDefault<z.ZodEnum<{
270
+ paid: "paid";
271
+ pending: "pending";
272
+ cancelled: "cancelled";
273
+ expired: "expired";
274
+ due: "due";
275
+ waived: "waived";
276
+ }>>;
277
+ dueDate: z.ZodString;
278
+ currency: z.ZodString;
279
+ amountCents: z.ZodNumber;
280
+ notes: z.ZodNullable<z.ZodOptional<z.ZodString>>;
281
+ }, z.core.$strip>>>;
282
+ travelCreditRedemption: z.ZodOptional<z.ZodObject<{
283
+ travelCreditId: z.ZodString;
284
+ amountCents: z.ZodNumber;
285
+ }, z.core.$strip>>;
286
+ groupMembership: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
287
+ action: z.ZodLiteral<"join">;
288
+ groupId: z.ZodString;
289
+ role: z.ZodDefault<z.ZodEnum<{
290
+ primary: "primary";
291
+ shared: "shared";
292
+ }>>;
293
+ }, z.core.$strip>, z.ZodObject<{
294
+ action: z.ZodLiteral<"create">;
295
+ kind: z.ZodDefault<z.ZodEnum<{
296
+ other: "other";
297
+ shared_room: "shared_room";
298
+ }>>;
299
+ label: z.ZodNullable<z.ZodOptional<z.ZodString>>;
300
+ optionUnitId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
301
+ makeBookingPrimary: z.ZodDefault<z.ZodBoolean>;
302
+ }, z.core.$strip>], "action">>;
303
+ documentGeneration: z.ZodOptional<z.ZodDefault<z.ZodObject<{
304
+ contractDocument: z.ZodDefault<z.ZodBoolean>;
305
+ invoiceDocument: z.ZodDefault<z.ZodBoolean>;
306
+ invoiceType: z.ZodDefault<z.ZodEnum<{
307
+ invoice: "invoice";
308
+ proforma: "proforma";
309
+ }>>;
310
+ }, z.core.$strip>>>;
311
+ }, z.core.$strip>;
312
+ }, z.core.$strip>;
313
+ export declare const createBookingTool: import("@voyant-travel/tools").ToolDefinition<{
314
+ booking: {
315
+ productId: string;
316
+ bookingNumber: string;
317
+ optionId?: string | null | undefined;
318
+ slotId?: string | null | undefined;
319
+ availabilityHoldToken?: string | undefined;
320
+ personId?: string | null | undefined;
321
+ organizationId?: string | null | undefined;
322
+ pax?: number | null | undefined;
323
+ internalNotes?: string | null | undefined;
324
+ sellAmountCentsOverride?: number | null | undefined;
325
+ catalogSellAmountCents?: number | null | undefined;
326
+ confirmedSellAmountCents?: number | null | undefined;
327
+ priceOverrideReason?: string | null | undefined;
328
+ initialStatus?: "draft" | "completed" | "cancelled" | "expired" | "on_hold" | "awaiting_payment" | "confirmed" | "in_progress" | undefined;
329
+ suppressNotifications?: boolean | undefined;
330
+ allowDuplicate?: boolean | undefined;
331
+ contactFirstName?: string | null | undefined;
332
+ contactLastName?: string | null | undefined;
333
+ contactEmail?: string | null | undefined;
334
+ contactPhone?: string | null | undefined;
335
+ contactPreferredLanguage?: string | null | undefined;
336
+ contactCountry?: string | null | undefined;
337
+ contactRegion?: string | null | undefined;
338
+ contactCity?: string | null | undefined;
339
+ contactAddressLine1?: string | null | undefined;
340
+ contactAddressLine2?: string | null | undefined;
341
+ contactPostalCode?: string | null | undefined;
342
+ travelers?: {
343
+ firstName: string;
344
+ lastName: string;
345
+ participantType: "other" | "traveler" | "occupant";
346
+ clientTravelerKey?: string | null | undefined;
347
+ email?: string | null | undefined;
348
+ phone?: string | null | undefined;
349
+ personId?: string | null | undefined;
350
+ travelerCategory?: "other" | "adult" | "child" | "infant" | "senior" | null | undefined;
351
+ preferredLanguage?: string | null | undefined;
352
+ specialRequests?: string | null | undefined;
353
+ roomUnitId?: string | null | undefined;
354
+ isPrimary?: boolean | null | undefined;
355
+ notes?: string | null | undefined;
356
+ }[] | undefined;
357
+ itemLines?: {
358
+ optionUnitId: string;
359
+ quantity: number;
360
+ clientLineKey?: string | null | undefined;
361
+ title?: string | null | undefined;
362
+ description?: string | null | undefined;
363
+ unitSellAmountCents?: number | null | undefined;
364
+ totalSellAmountCents?: number | null | undefined;
365
+ travelerKeys?: string[] | null | undefined;
366
+ travelerIndexes?: number[] | null | undefined;
367
+ }[] | undefined;
368
+ extraLines?: {
369
+ productExtraId: string;
370
+ name: string;
371
+ quantity: number;
372
+ sellCurrency: string;
373
+ clientLineKey?: string | null | undefined;
374
+ optionExtraConfigId?: string | null | undefined;
375
+ description?: string | null | undefined;
376
+ pricingMode?: string | null | undefined;
377
+ pricedPerPerson?: boolean | null | undefined;
378
+ unitSellAmountCents?: number | null | undefined;
379
+ totalSellAmountCents?: number | null | undefined;
380
+ travelerKeys?: string[] | null | undefined;
381
+ travelerIndexes?: number[] | null | undefined;
382
+ }[] | undefined;
383
+ paymentSchedules?: {
384
+ scheduleType: "other" | "deposit" | "installment" | "balance" | "hold";
385
+ status: "paid" | "pending" | "cancelled" | "expired" | "due" | "waived";
386
+ dueDate: string;
387
+ currency: string;
388
+ amountCents: number;
389
+ notes?: string | null | undefined;
390
+ }[] | undefined;
391
+ travelCreditRedemption?: {
392
+ travelCreditId: string;
393
+ amountCents: number;
394
+ } | undefined;
395
+ groupMembership?: {
396
+ action: "join";
397
+ groupId: string;
398
+ role: "primary" | "shared";
399
+ } | {
400
+ action: "create";
401
+ kind: "other" | "shared_room";
402
+ makeBookingPrimary: boolean;
403
+ label?: string | null | undefined;
404
+ optionUnitId?: string | null | undefined;
405
+ } | undefined;
406
+ documentGeneration?: {
407
+ contractDocument: boolean;
408
+ invoiceDocument: boolean;
409
+ invoiceType: "invoice" | "proforma";
410
+ } | undefined;
411
+ };
412
+ }, {
413
+ status: "created";
414
+ booking: {
415
+ id: string;
416
+ bookingNumber: string;
417
+ status: string;
418
+ currency: string;
419
+ amountCents: number | null;
420
+ pax: number | null;
421
+ };
422
+ travelerIds: string[];
423
+ paymentSchedules: {
424
+ id: string;
425
+ scheduleType: string;
426
+ status: string;
427
+ dueDate: string;
428
+ currency: string;
429
+ amountCents: number;
430
+ }[];
431
+ invoice: {
432
+ id: string;
433
+ invoiceNumber: string;
434
+ invoiceType: string;
435
+ status: string;
436
+ } | null;
437
+ invoiceDocument: {
438
+ status: "requested";
439
+ renditionId: string | null;
440
+ } | {
441
+ status: "generated";
442
+ renditionId: string;
443
+ } | {
444
+ status: "failed" | "not_available" | "not_requested";
445
+ };
446
+ paymentIds: string[];
447
+ groupId: string | null;
448
+ travelCreditRedemptionId: string | null;
449
+ }, FinanceToolContext>;
450
+ export declare const financeBookingsCreateTools: readonly [import("@voyant-travel/tools").ToolDefinition<{
451
+ booking: {
452
+ productId: string;
453
+ bookingNumber: string;
454
+ optionId?: string | null | undefined;
455
+ slotId?: string | null | undefined;
456
+ availabilityHoldToken?: string | undefined;
457
+ personId?: string | null | undefined;
458
+ organizationId?: string | null | undefined;
459
+ pax?: number | null | undefined;
460
+ internalNotes?: string | null | undefined;
461
+ sellAmountCentsOverride?: number | null | undefined;
462
+ catalogSellAmountCents?: number | null | undefined;
463
+ confirmedSellAmountCents?: number | null | undefined;
464
+ priceOverrideReason?: string | null | undefined;
465
+ initialStatus?: "draft" | "completed" | "cancelled" | "expired" | "on_hold" | "awaiting_payment" | "confirmed" | "in_progress" | undefined;
466
+ suppressNotifications?: boolean | undefined;
467
+ allowDuplicate?: boolean | undefined;
468
+ contactFirstName?: string | null | undefined;
469
+ contactLastName?: string | null | undefined;
470
+ contactEmail?: string | null | undefined;
471
+ contactPhone?: string | null | undefined;
472
+ contactPreferredLanguage?: string | null | undefined;
473
+ contactCountry?: string | null | undefined;
474
+ contactRegion?: string | null | undefined;
475
+ contactCity?: string | null | undefined;
476
+ contactAddressLine1?: string | null | undefined;
477
+ contactAddressLine2?: string | null | undefined;
478
+ contactPostalCode?: string | null | undefined;
479
+ travelers?: {
480
+ firstName: string;
481
+ lastName: string;
482
+ participantType: "other" | "traveler" | "occupant";
483
+ clientTravelerKey?: string | null | undefined;
484
+ email?: string | null | undefined;
485
+ phone?: string | null | undefined;
486
+ personId?: string | null | undefined;
487
+ travelerCategory?: "other" | "adult" | "child" | "infant" | "senior" | null | undefined;
488
+ preferredLanguage?: string | null | undefined;
489
+ specialRequests?: string | null | undefined;
490
+ roomUnitId?: string | null | undefined;
491
+ isPrimary?: boolean | null | undefined;
492
+ notes?: string | null | undefined;
493
+ }[] | undefined;
494
+ itemLines?: {
495
+ optionUnitId: string;
496
+ quantity: number;
497
+ clientLineKey?: string | null | undefined;
498
+ title?: string | null | undefined;
499
+ description?: string | null | undefined;
500
+ unitSellAmountCents?: number | null | undefined;
501
+ totalSellAmountCents?: number | null | undefined;
502
+ travelerKeys?: string[] | null | undefined;
503
+ travelerIndexes?: number[] | null | undefined;
504
+ }[] | undefined;
505
+ extraLines?: {
506
+ productExtraId: string;
507
+ name: string;
508
+ quantity: number;
509
+ sellCurrency: string;
510
+ clientLineKey?: string | null | undefined;
511
+ optionExtraConfigId?: string | null | undefined;
512
+ description?: string | null | undefined;
513
+ pricingMode?: string | null | undefined;
514
+ pricedPerPerson?: boolean | null | undefined;
515
+ unitSellAmountCents?: number | null | undefined;
516
+ totalSellAmountCents?: number | null | undefined;
517
+ travelerKeys?: string[] | null | undefined;
518
+ travelerIndexes?: number[] | null | undefined;
519
+ }[] | undefined;
520
+ paymentSchedules?: {
521
+ scheduleType: "other" | "deposit" | "installment" | "balance" | "hold";
522
+ status: "paid" | "pending" | "cancelled" | "expired" | "due" | "waived";
523
+ dueDate: string;
524
+ currency: string;
525
+ amountCents: number;
526
+ notes?: string | null | undefined;
527
+ }[] | undefined;
528
+ travelCreditRedemption?: {
529
+ travelCreditId: string;
530
+ amountCents: number;
531
+ } | undefined;
532
+ groupMembership?: {
533
+ action: "join";
534
+ groupId: string;
535
+ role: "primary" | "shared";
536
+ } | {
537
+ action: "create";
538
+ kind: "other" | "shared_room";
539
+ makeBookingPrimary: boolean;
540
+ label?: string | null | undefined;
541
+ optionUnitId?: string | null | undefined;
542
+ } | undefined;
543
+ documentGeneration?: {
544
+ contractDocument: boolean;
545
+ invoiceDocument: boolean;
546
+ invoiceType: "invoice" | "proforma";
547
+ } | undefined;
548
+ };
549
+ }, {
550
+ status: "created";
551
+ booking: {
552
+ id: string;
553
+ bookingNumber: string;
554
+ status: string;
555
+ currency: string;
556
+ amountCents: number | null;
557
+ pax: number | null;
558
+ };
559
+ travelerIds: string[];
560
+ paymentSchedules: {
561
+ id: string;
562
+ scheduleType: string;
563
+ status: string;
564
+ dueDate: string;
565
+ currency: string;
566
+ amountCents: number;
567
+ }[];
568
+ invoice: {
569
+ id: string;
570
+ invoiceNumber: string;
571
+ invoiceType: string;
572
+ status: string;
573
+ } | null;
574
+ invoiceDocument: {
575
+ status: "requested";
576
+ renditionId: string | null;
577
+ } | {
578
+ status: "generated";
579
+ renditionId: string;
580
+ } | {
581
+ status: "failed" | "not_available" | "not_requested";
582
+ };
583
+ paymentIds: string[];
584
+ groupId: string | null;
585
+ travelCreditRedemptionId: string | null;
586
+ }, FinanceToolContext>];
587
+ export declare const issueInvoiceFromBookingToolInputSchema: z.ZodObject<{
588
+ command: z.ZodObject<{
589
+ bookingId: z.ZodString;
590
+ bookingPaymentScheduleId: z.ZodOptional<z.ZodString>;
591
+ invoiceNumber: z.ZodOptional<z.ZodString>;
592
+ seriesId: z.ZodOptional<z.ZodString>;
593
+ convertedFromInvoiceId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
594
+ issueDate: z.ZodString;
595
+ dueDate: z.ZodString;
596
+ notes: z.ZodNullable<z.ZodOptional<z.ZodString>>;
597
+ currency: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
598
+ baseCurrency: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
599
+ fxRateSetId: z.ZodOptional<z.ZodString>;
600
+ subtotalCents: z.ZodOptional<z.ZodNumber>;
601
+ taxCents: z.ZodOptional<z.ZodNumber>;
602
+ totalCents: z.ZodOptional<z.ZodNumber>;
603
+ lineItems: z.ZodOptional<z.ZodArray<z.ZodObject<{
604
+ description: z.ZodString;
605
+ quantity: z.ZodNumber;
606
+ unitAmountCents: z.ZodNumber;
607
+ taxRateBps: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
608
+ taxAmountCents: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
609
+ }, z.core.$strip>>>;
610
+ paymentScheduleLineDescriptionFormat: z.ZodOptional<z.ZodEnum<{
611
+ schedule_first: "schedule_first";
612
+ product_first: "product_first";
613
+ product_only: "product_only";
614
+ }>>;
615
+ externalRefs: z.ZodOptional<z.ZodArray<z.ZodObject<{
616
+ provider: z.ZodString;
617
+ externalId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
618
+ externalNumber: z.ZodNullable<z.ZodOptional<z.ZodString>>;
619
+ externalUrl: z.ZodNullable<z.ZodOptional<z.ZodString>>;
620
+ status: z.ZodNullable<z.ZodOptional<z.ZodString>>;
621
+ metadata: z.ZodNullable<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
622
+ syncedAt: z.ZodNullable<z.ZodOptional<z.ZodString>>;
623
+ syncError: z.ZodNullable<z.ZodOptional<z.ZodString>>;
624
+ }, z.core.$strip>>>;
625
+ invoiceType: z.ZodDefault<z.ZodEnum<{
626
+ invoice: "invoice";
627
+ proforma: "proforma";
628
+ }>>;
629
+ skipExternalSync: z.ZodOptional<z.ZodBoolean>;
630
+ wait: z.ZodOptional<z.ZodPreprocess<z.ZodEnum<{
631
+ any: "any";
632
+ none: "none";
633
+ pdf: "pdf";
634
+ }>>>;
635
+ waitTimeoutMs: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
636
+ }, z.core.$strip>;
637
+ idempotencyKey: z.ZodString;
638
+ approvalId: z.ZodOptional<z.ZodString>;
639
+ }, z.core.$strip>;
640
+ export declare const issueInvoiceFromBookingToolOutputSchema: z.ZodUnion<readonly [z.ZodObject<{
641
+ status: z.ZodLiteral<"approval_required">;
642
+ requestedAction: z.ZodObject<{
643
+ id: z.ZodString;
644
+ status: z.ZodString;
645
+ actionName: z.ZodString;
646
+ targetType: z.ZodString;
647
+ targetId: z.ZodString;
648
+ }, z.core.$strip>;
649
+ approval: z.ZodObject<{
650
+ id: z.ZodString;
651
+ status: z.ZodString;
652
+ requestedActionId: z.ZodString;
653
+ policyName: z.ZodString;
654
+ policyVersion: z.ZodString;
655
+ riskSnapshot: z.ZodString;
656
+ reasonCode: z.ZodString;
657
+ expiresAt: z.ZodNullable<z.ZodString>;
658
+ createdAt: z.ZodString;
659
+ }, z.core.$strip>;
660
+ replayed: z.ZodBoolean;
661
+ }, z.core.$strip>, z.ZodObject<{
662
+ status: z.ZodLiteral<"issued">;
663
+ invoice: z.ZodObject<{
664
+ id: z.ZodString;
665
+ invoiceNumber: z.ZodString;
666
+ invoiceType: z.ZodEnum<{
667
+ invoice: "invoice";
668
+ proforma: "proforma";
669
+ credit_note: "credit_note";
670
+ }>;
671
+ convertedFromInvoiceId: z.ZodNullable<z.ZodString>;
672
+ seriesId: z.ZodNullable<z.ZodString>;
673
+ sequence: z.ZodNullable<z.ZodNumber>;
674
+ templateId: z.ZodNullable<z.ZodString>;
675
+ taxRegimeId: z.ZodNullable<z.ZodString>;
676
+ language: z.ZodNullable<z.ZodString>;
677
+ bookingId: z.ZodString;
678
+ personId: z.ZodNullable<z.ZodString>;
679
+ organizationId: z.ZodNullable<z.ZodString>;
680
+ status: z.ZodEnum<{
681
+ draft: "draft";
682
+ pending_external_allocation: "pending_external_allocation";
683
+ issued: "issued";
684
+ partially_paid: "partially_paid";
685
+ paid: "paid";
686
+ overdue: "overdue";
687
+ void: "void";
688
+ }>;
689
+ currency: z.ZodString;
690
+ baseCurrency: z.ZodNullable<z.ZodString>;
691
+ fxRateSetId: z.ZodNullable<z.ZodString>;
692
+ subtotalCents: z.ZodNumber;
693
+ baseSubtotalCents: z.ZodNullable<z.ZodNumber>;
694
+ taxCents: z.ZodNumber;
695
+ baseTaxCents: z.ZodNullable<z.ZodNumber>;
696
+ totalCents: z.ZodNumber;
697
+ baseTotalCents: z.ZodNullable<z.ZodNumber>;
698
+ paidCents: z.ZodNumber;
699
+ basePaidCents: z.ZodNullable<z.ZodNumber>;
700
+ balanceDueCents: z.ZodNumber;
701
+ baseBalanceDueCents: z.ZodNullable<z.ZodNumber>;
702
+ commissionPercent: z.ZodNullable<z.ZodNumber>;
703
+ commissionAmountCents: z.ZodNullable<z.ZodNumber>;
704
+ issueDate: z.ZodString;
705
+ dueDate: z.ZodString;
706
+ notes: z.ZodNullable<z.ZodString>;
707
+ voidedAt: z.ZodNullable<z.ZodString>;
708
+ voidReason: z.ZodNullable<z.ZodString>;
709
+ createdAt: z.ZodString;
710
+ updatedAt: z.ZodString;
711
+ }, z.core.$strip>;
712
+ replayed: z.ZodBoolean;
713
+ }, z.core.$strip>]>;
714
+ export declare const issueInvoiceFromBookingTool: import("@voyant-travel/tools").ToolDefinition<{
715
+ command: {
716
+ bookingId: string;
717
+ issueDate: string;
718
+ dueDate: string;
719
+ invoiceType: "invoice" | "proforma";
720
+ bookingPaymentScheduleId?: string | undefined;
721
+ invoiceNumber?: string | undefined;
722
+ seriesId?: string | undefined;
723
+ convertedFromInvoiceId?: string | null | undefined;
724
+ notes?: string | null | undefined;
725
+ currency?: string | undefined;
726
+ baseCurrency?: string | undefined;
727
+ fxRateSetId?: string | undefined;
728
+ subtotalCents?: number | undefined;
729
+ taxCents?: number | undefined;
730
+ totalCents?: number | undefined;
731
+ lineItems?: {
732
+ description: string;
733
+ quantity: number;
734
+ unitAmountCents: number;
735
+ taxRateBps?: number | null | undefined;
736
+ taxAmountCents?: number | null | undefined;
737
+ }[] | undefined;
738
+ paymentScheduleLineDescriptionFormat?: "schedule_first" | "product_first" | "product_only" | undefined;
739
+ externalRefs?: {
740
+ provider: string;
741
+ externalId?: string | null | undefined;
742
+ externalNumber?: string | null | undefined;
743
+ externalUrl?: string | null | undefined;
744
+ status?: string | null | undefined;
745
+ metadata?: Record<string, unknown> | null | undefined;
746
+ syncedAt?: string | null | undefined;
747
+ syncError?: string | null | undefined;
748
+ }[] | undefined;
749
+ skipExternalSync?: boolean | undefined;
750
+ wait?: "pdf" | "any" | "none" | undefined;
751
+ waitTimeoutMs?: number | undefined;
752
+ };
753
+ idempotencyKey: string;
754
+ approvalId?: string | undefined;
755
+ }, {
756
+ status: "approval_required";
757
+ requestedAction: {
758
+ id: string;
759
+ status: string;
760
+ actionName: string;
761
+ targetType: string;
762
+ targetId: string;
763
+ };
764
+ approval: {
765
+ id: string;
766
+ status: string;
767
+ requestedActionId: string;
768
+ policyName: string;
769
+ policyVersion: string;
770
+ riskSnapshot: string;
771
+ reasonCode: string;
772
+ expiresAt: string | null;
773
+ createdAt: string;
774
+ };
775
+ replayed: boolean;
776
+ } | {
777
+ status: "issued";
778
+ invoice: {
779
+ id: string;
780
+ invoiceNumber: string;
781
+ invoiceType: "invoice" | "proforma" | "credit_note";
782
+ convertedFromInvoiceId: string | null;
783
+ seriesId: string | null;
784
+ sequence: number | null;
785
+ templateId: string | null;
786
+ taxRegimeId: string | null;
787
+ language: string | null;
788
+ bookingId: string;
789
+ personId: string | null;
790
+ organizationId: string | null;
791
+ status: "draft" | "pending_external_allocation" | "issued" | "partially_paid" | "paid" | "overdue" | "void";
792
+ currency: string;
793
+ baseCurrency: string | null;
794
+ fxRateSetId: string | null;
795
+ subtotalCents: number;
796
+ baseSubtotalCents: number | null;
797
+ taxCents: number;
798
+ baseTaxCents: number | null;
799
+ totalCents: number;
800
+ baseTotalCents: number | null;
801
+ paidCents: number;
802
+ basePaidCents: number | null;
803
+ balanceDueCents: number;
804
+ baseBalanceDueCents: number | null;
805
+ commissionPercent: number | null;
806
+ commissionAmountCents: number | null;
807
+ issueDate: string;
808
+ dueDate: string;
809
+ notes: string | null;
810
+ voidedAt: string | null;
811
+ voidReason: string | null;
812
+ createdAt: string;
813
+ updatedAt: string;
814
+ };
815
+ replayed: boolean;
816
+ }, FinanceToolContext>;
40
817
  export declare const financeTools: readonly [import("@voyant-travel/tools").ToolDefinition<{
41
818
  sortBy: "status" | "createdAt" | "invoiceNumber" | "totalCents" | "paidCents" | "balanceDueCents" | "issueDate" | "dueDate";
42
819
  sortDir: "asc" | "desc";
@@ -55,4 +832,157 @@ export declare const financeTools: readonly [import("@voyant-travel/tools").Tool
55
832
  }, unknown, FinanceToolContext>, import("@voyant-travel/tools").ToolDefinition<{
56
833
  id: string;
57
834
  reason?: string | undefined;
58
- }, unknown, FinanceToolContext>];
835
+ }, unknown, FinanceToolContext>, import("@voyant-travel/tools").ToolDefinition<{
836
+ currency: string;
837
+ amountCents: number;
838
+ creditNoteNumber: string;
839
+ reason: string;
840
+ invoiceId: string;
841
+ idempotencyKey: string;
842
+ notes?: string | null | undefined;
843
+ baseCurrency?: string | null | undefined;
844
+ fxRateSetId?: string | null | undefined;
845
+ baseAmountCents?: number | null | undefined;
846
+ approvalId?: string | undefined;
847
+ }, {
848
+ status: "approval_required";
849
+ requestedAction: {
850
+ id: string;
851
+ status: string;
852
+ actionName: string;
853
+ targetType: string;
854
+ targetId: string;
855
+ };
856
+ approval: {
857
+ id: string;
858
+ status: string;
859
+ requestedActionId: string;
860
+ policyName: string;
861
+ policyVersion: string;
862
+ riskSnapshot: string;
863
+ reasonCode: string;
864
+ expiresAt: string | null;
865
+ createdAt: string;
866
+ };
867
+ replayed: boolean;
868
+ } | {
869
+ status: "issued";
870
+ creditNote: {
871
+ id: string;
872
+ creditNoteNumber: string;
873
+ invoiceId: string;
874
+ status: "draft" | "issued" | "applied";
875
+ amountCents: number;
876
+ currency: string;
877
+ baseCurrency: string | null;
878
+ baseAmountCents: number | null;
879
+ fxRateSetId: string | null;
880
+ reason: string;
881
+ notes: string | null;
882
+ createdAt: string;
883
+ updatedAt: string;
884
+ };
885
+ replayed: boolean;
886
+ }, FinanceToolContext>, import("@voyant-travel/tools").ToolDefinition<{
887
+ command: {
888
+ bookingId: string;
889
+ issueDate: string;
890
+ dueDate: string;
891
+ invoiceType: "invoice" | "proforma";
892
+ bookingPaymentScheduleId?: string | undefined;
893
+ invoiceNumber?: string | undefined;
894
+ seriesId?: string | undefined;
895
+ convertedFromInvoiceId?: string | null | undefined;
896
+ notes?: string | null | undefined;
897
+ currency?: string | undefined;
898
+ baseCurrency?: string | undefined;
899
+ fxRateSetId?: string | undefined;
900
+ subtotalCents?: number | undefined;
901
+ taxCents?: number | undefined;
902
+ totalCents?: number | undefined;
903
+ lineItems?: {
904
+ description: string;
905
+ quantity: number;
906
+ unitAmountCents: number;
907
+ taxRateBps?: number | null | undefined;
908
+ taxAmountCents?: number | null | undefined;
909
+ }[] | undefined;
910
+ paymentScheduleLineDescriptionFormat?: "schedule_first" | "product_first" | "product_only" | undefined;
911
+ externalRefs?: {
912
+ provider: string;
913
+ externalId?: string | null | undefined;
914
+ externalNumber?: string | null | undefined;
915
+ externalUrl?: string | null | undefined;
916
+ status?: string | null | undefined;
917
+ metadata?: Record<string, unknown> | null | undefined;
918
+ syncedAt?: string | null | undefined;
919
+ syncError?: string | null | undefined;
920
+ }[] | undefined;
921
+ skipExternalSync?: boolean | undefined;
922
+ wait?: "pdf" | "any" | "none" | undefined;
923
+ waitTimeoutMs?: number | undefined;
924
+ };
925
+ idempotencyKey: string;
926
+ approvalId?: string | undefined;
927
+ }, {
928
+ status: "approval_required";
929
+ requestedAction: {
930
+ id: string;
931
+ status: string;
932
+ actionName: string;
933
+ targetType: string;
934
+ targetId: string;
935
+ };
936
+ approval: {
937
+ id: string;
938
+ status: string;
939
+ requestedActionId: string;
940
+ policyName: string;
941
+ policyVersion: string;
942
+ riskSnapshot: string;
943
+ reasonCode: string;
944
+ expiresAt: string | null;
945
+ createdAt: string;
946
+ };
947
+ replayed: boolean;
948
+ } | {
949
+ status: "issued";
950
+ invoice: {
951
+ id: string;
952
+ invoiceNumber: string;
953
+ invoiceType: "invoice" | "proforma" | "credit_note";
954
+ convertedFromInvoiceId: string | null;
955
+ seriesId: string | null;
956
+ sequence: number | null;
957
+ templateId: string | null;
958
+ taxRegimeId: string | null;
959
+ language: string | null;
960
+ bookingId: string;
961
+ personId: string | null;
962
+ organizationId: string | null;
963
+ status: "draft" | "pending_external_allocation" | "issued" | "partially_paid" | "paid" | "overdue" | "void";
964
+ currency: string;
965
+ baseCurrency: string | null;
966
+ fxRateSetId: string | null;
967
+ subtotalCents: number;
968
+ baseSubtotalCents: number | null;
969
+ taxCents: number;
970
+ baseTaxCents: number | null;
971
+ totalCents: number;
972
+ baseTotalCents: number | null;
973
+ paidCents: number;
974
+ basePaidCents: number | null;
975
+ balanceDueCents: number;
976
+ baseBalanceDueCents: number | null;
977
+ commissionPercent: number | null;
978
+ commissionAmountCents: number | null;
979
+ issueDate: string;
980
+ dueDate: string;
981
+ notes: string | null;
982
+ voidedAt: string | null;
983
+ voidReason: string | null;
984
+ createdAt: string;
985
+ updatedAt: string;
986
+ };
987
+ replayed: boolean;
988
+ }, FinanceToolContext>];