@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.
@@ -37,6 +37,7 @@ export type CheckoutRouteRuntime = {
37
37
  listBookingReminderRuns?: CheckoutRoutesOptions["listBookingReminderRuns"];
38
38
  };
39
39
  export declare const CHECKOUT_ROUTE_RUNTIME_CONTAINER_KEY = "providers.finance.checkout.runtime";
40
+ export declare const CHECKOUT_ROUTE_RUNTIME_NOT_CONFIGURED_MESSAGE = "Checkout payment links require a configured checkout provider. Configure a Finance checkout runtime with a card payment starter before generating payment links.";
40
41
  export declare function createCheckoutRoutes(options?: CheckoutRoutesOptions): import("hono/hono-base").HonoBase<Env, {
41
42
  "/bookings/:bookingId/collection-plan": {
42
43
  $post: {
@@ -353,6 +354,17 @@ export declare function createCheckoutRoutes(options?: CheckoutRoutesOptions): i
353
354
  };
354
355
  outputFormat: "json";
355
356
  status: 201;
357
+ } | {
358
+ input: {
359
+ param: {
360
+ bookingId: string;
361
+ };
362
+ };
363
+ output: {
364
+ error: string;
365
+ };
366
+ outputFormat: "json";
367
+ status: 501;
356
368
  } | {
357
369
  input: {
358
370
  param: {
@@ -581,6 +593,13 @@ export declare function createCheckoutRoutes(options?: CheckoutRoutesOptions): i
581
593
  };
582
594
  outputFormat: "json";
583
595
  status: 201;
596
+ } | {
597
+ input: {};
598
+ output: {
599
+ error: string;
600
+ };
601
+ outputFormat: "json";
602
+ status: 501;
584
603
  } | {
585
604
  input: {};
586
605
  output: {
@@ -907,6 +926,17 @@ export declare function createCheckoutAdminRoutes(options?: CheckoutRoutesOption
907
926
  };
908
927
  outputFormat: "json";
909
928
  status: 201;
929
+ } | {
930
+ input: {
931
+ param: {
932
+ bookingId: string;
933
+ };
934
+ };
935
+ output: {
936
+ error: string;
937
+ };
938
+ outputFormat: "json";
939
+ status: 501;
910
940
  } | {
911
941
  input: {
912
942
  param: {
@@ -1135,6 +1165,13 @@ export declare function createCheckoutAdminRoutes(options?: CheckoutRoutesOption
1135
1165
  };
1136
1166
  outputFormat: "json";
1137
1167
  status: 201;
1168
+ } | {
1169
+ input: {};
1170
+ output: {
1171
+ error: string;
1172
+ };
1173
+ outputFormat: "json";
1174
+ status: 501;
1138
1175
  } | {
1139
1176
  input: {};
1140
1177
  output: {
@@ -1 +1 @@
1
- {"version":3,"file":"checkout-routes.d.ts","sourceRoot":"","sources":["../src/checkout-routes.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AAQ1D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAGjE,OAAO,EAEL,KAAK,2BAA2B,EAChC,KAAK,8BAA8B,EACnC,KAAK,sBAAsB,EAC3B,KAAK,qBAAqB,EAG3B,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAEL,KAAK,4BAA4B,EACjC,KAAK,yBAAyB,EAI/B,MAAM,0BAA0B,CAAA;AAEjC,KAAK,GAAG,GAAG;IACT,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IACjC,SAAS,EAAE;QACT,SAAS,EAAE,eAAe,CAAA;QAC1B,EAAE,EAAE,kBAAkB,CAAA;QACtB,MAAM,CAAC,EAAE,MAAM,CAAA;KAChB,CAAA;CACF,CAAA;AAED,MAAM,MAAM,qBAAqB,GAAG;IAClC,MAAM,CAAC,EAAE,qBAAqB,CAAA;IAC9B,sBAAsB,CAAC,EAAE,8BAA8B,GAAG,IAAI,CAAA;IAC9D,6BAA6B,CAAC,EAAE,CAC9B,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAC9B,8BAA8B,GAAG,IAAI,CAAA;IAC1C,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,sBAAsB,CAAC,CAAA;IACxD,sBAAsB,CAAC,EAAE,CACvB,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kCAc5E;AAuBD,wBAAgB,yBAAyB,CACvC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACjC,OAAO,GAAE,qBAA0B,GAClC,oBAAoB,CAYtB;AAED,eAAO,MAAM,2BAA2B,6BAAuB,CAAA;AAC/D,eAAO,MAAM,gCAAgC,kCAA4B,CAAA;AACzE,eAAO,MAAM,gCAAgC,kCAA4B,CAAA;AACzE,eAAO,MAAM,4CAA4C,uCAAuC,CAAA"}
@@ -4,6 +4,12 @@ import { Hono } from "hono";
4
4
  import { bootstrapCheckoutCollection, initiateCheckoutCollection, previewCheckoutCollection, } from "./checkout-service.js";
5
5
  import { bootstrapCheckoutCollectionSchema, checkoutReminderRunListQuerySchema, initiateCheckoutCollectionSchema, previewCheckoutCollectionSchema, } from "./checkout-validation.js";
6
6
  export const CHECKOUT_ROUTE_RUNTIME_CONTAINER_KEY = "providers.finance.checkout.runtime";
7
+ export const CHECKOUT_ROUTE_RUNTIME_NOT_CONFIGURED_MESSAGE = "Checkout payment links require a configured checkout provider. Configure a Finance checkout runtime with a card payment starter before generating payment links.";
8
+ class CheckoutRouteRuntimeNotConfiguredError extends Error {
9
+ constructor() {
10
+ super(CHECKOUT_ROUTE_RUNTIME_NOT_CONFIGURED_MESSAGE);
11
+ }
12
+ }
7
13
  function runtimeEnv(c) {
8
14
  return c.env;
9
15
  }
@@ -26,9 +32,8 @@ function attachCollectionRoutes(app, options) {
26
32
  // Pin the middleware to this module's Env so Hono doesn't intersect the
27
33
  // middleware's default VoyantBindings into the handlers' `c.env` type.
28
34
  const collectionIdempotency = () => idempotencyKey();
29
- function getRuntime(bindings, resolveFromContainer) {
30
- return (resolveFromContainer?.(CHECKOUT_ROUTE_RUNTIME_CONTAINER_KEY) ??
31
- buildCheckoutRouteRuntime(bindings, options));
35
+ function getRuntime(bindings, container) {
36
+ return resolveCheckoutRouteRuntime(bindings, options, container);
32
37
  }
33
38
  return (app
34
39
  // Mostly a read, but `ensureDefaultPaymentPlan` can materialize a
@@ -49,8 +54,10 @@ function attachCollectionRoutes(app, options) {
49
54
  })
50
55
  .post("/bookings/:bookingId/initiate-collection", collectionIdempotency(), async (c) => {
51
56
  try {
52
- const runtime = getRuntime(c.env, (key) => c.var.container?.resolve(key));
53
- const result = await initiateCheckoutCollection(c.get("db"), c.req.param("bookingId"), await parseJsonBody(c, initiateCheckoutCollectionSchema), options.policy, runtime);
57
+ const input = await parseJsonBody(c, initiateCheckoutCollectionSchema);
58
+ const runtime = getRuntime(c.env, c.var.container);
59
+ assertCheckoutRuntimeSupportsCollection(runtime, input);
60
+ const result = await initiateCheckoutCollection(c.get("db"), c.req.param("bookingId"), input, options.policy, runtime);
54
61
  if (!result) {
55
62
  return c.json({ error: "Booking not found" }, 404);
56
63
  }
@@ -61,13 +68,18 @@ function attachCollectionRoutes(app, options) {
61
68
  if (message.includes("Booking not found")) {
62
69
  return c.json({ error: message }, 404);
63
70
  }
71
+ if (error instanceof CheckoutRouteRuntimeNotConfiguredError) {
72
+ return c.json({ error: message }, 501);
73
+ }
64
74
  return c.json({ error: message }, 409);
65
75
  }
66
76
  })
67
77
  .post("/collections/bootstrap", collectionIdempotency(), async (c) => {
68
78
  try {
69
- const runtime = getRuntime(c.env, (key) => c.var.container?.resolve(key));
70
- const result = await bootstrapCheckoutCollection(c.get("db"), await parseJsonBody(c, bootstrapCheckoutCollectionSchema), options.policy, runtime);
79
+ const input = await parseJsonBody(c, bootstrapCheckoutCollectionSchema);
80
+ const runtime = getRuntime(c.env, c.var.container);
81
+ assertCheckoutRuntimeSupportsCollection(runtime, input);
82
+ const result = await bootstrapCheckoutCollection(c.get("db"), input, options.policy, runtime);
71
83
  if (!result) {
72
84
  return c.json({ error: "Booking session not found" }, 404);
73
85
  }
@@ -78,6 +90,9 @@ function attachCollectionRoutes(app, options) {
78
90
  if (message.includes("Booking not found")) {
79
91
  return c.json({ error: message }, 404);
80
92
  }
93
+ if (error instanceof CheckoutRouteRuntimeNotConfiguredError) {
94
+ return c.json({ error: message }, 501);
95
+ }
81
96
  return c.json({ error: message }, 409);
82
97
  }
83
98
  }));
@@ -91,8 +106,7 @@ export function createCheckoutRoutes(options = {}) {
91
106
  export function createCheckoutAdminRoutes(options = {}) {
92
107
  const app = new Hono().get("/bookings/:bookingId/reminder-runs", async (c) => {
93
108
  const query = parseQuery(c, checkoutReminderRunListQuerySchema);
94
- const runtime = c.var.container?.resolve(CHECKOUT_ROUTE_RUNTIME_CONTAINER_KEY) ??
95
- buildCheckoutRouteRuntime(c.env, options);
109
+ const runtime = resolveCheckoutRouteRuntime(c.env, options, c.var.container);
96
110
  if (!runtime.listBookingReminderRuns) {
97
111
  return c.json({ data: [], total: 0, limit: query.limit, offset: query.offset });
98
112
  }
@@ -100,6 +114,17 @@ export function createCheckoutAdminRoutes(options = {}) {
100
114
  });
101
115
  return attachCollectionRoutes(app, options);
102
116
  }
117
+ function resolveCheckoutRouteRuntime(bindings, options, container) {
118
+ if (container?.has(CHECKOUT_ROUTE_RUNTIME_CONTAINER_KEY)) {
119
+ return container.resolve(CHECKOUT_ROUTE_RUNTIME_CONTAINER_KEY);
120
+ }
121
+ return buildCheckoutRouteRuntime(bindings, options);
122
+ }
123
+ function assertCheckoutRuntimeSupportsCollection(runtime, input) {
124
+ if (input.method === "card" && Object.keys(runtime.paymentStarters).length === 0) {
125
+ throw new CheckoutRouteRuntimeNotConfiguredError();
126
+ }
127
+ }
103
128
  export function buildCheckoutRouteRuntime(bindings, options = {}) {
104
129
  return {
105
130
  bindings,
@@ -86,9 +86,13 @@ export declare const financeBookingBillingRoutes: OpenAPIHono<Env, import("hono/
86
86
  };
87
87
  output: {
88
88
  error: string;
89
+ code: string;
90
+ details?: {
91
+ [x: string]: import("hono/utils/types").JSONValue;
92
+ } | undefined;
89
93
  };
90
94
  outputFormat: "json";
91
- status: 404;
95
+ status: 400;
92
96
  } | {
93
97
  input: {
94
98
  param: {
@@ -112,7 +116,7 @@ export declare const financeBookingBillingRoutes: OpenAPIHono<Env, import("hono/
112
116
  error: string;
113
117
  };
114
118
  outputFormat: "json";
115
- status: 400;
119
+ status: 404;
116
120
  } | {
117
121
  input: {
118
122
  param: {
@@ -164,13 +168,13 @@ export declare const financeBookingBillingRoutes: OpenAPIHono<Env, import("hono/
164
168
  };
165
169
  } & {
166
170
  json: {
171
+ commissionModel?: "percentage" | "fixed" | "markup" | "net" | undefined;
172
+ status?: "paid" | "void" | "pending" | "accrued" | "payable" | undefined;
167
173
  channelId?: string | null | undefined;
168
174
  recipientType?: "other" | "supplier" | "channel" | "agency" | "internal" | "affiliate" | "agent" | undefined;
169
- commissionModel?: "percentage" | "fixed" | "markup" | "net" | undefined;
170
175
  currency?: string | null | undefined;
171
176
  amountCents?: number | null | undefined;
172
177
  rateBasisPoints?: number | null | undefined;
173
- status?: "paid" | "void" | "pending" | "accrued" | "payable" | undefined;
174
178
  payableAt?: string | null | undefined;
175
179
  paidAt?: string | null | undefined;
176
180
  notes?: string | null | undefined;
@@ -178,9 +182,13 @@ export declare const financeBookingBillingRoutes: OpenAPIHono<Env, import("hono/
178
182
  };
179
183
  output: {
180
184
  error: string;
185
+ code: string;
186
+ details?: {
187
+ [x: string]: import("hono/utils/types").JSONValue;
188
+ } | undefined;
181
189
  };
182
190
  outputFormat: "json";
183
- status: 404;
191
+ status: 400;
184
192
  } | {
185
193
  input: {
186
194
  param: {
@@ -189,13 +197,13 @@ export declare const financeBookingBillingRoutes: OpenAPIHono<Env, import("hono/
189
197
  };
190
198
  } & {
191
199
  json: {
200
+ commissionModel?: "percentage" | "fixed" | "markup" | "net" | undefined;
201
+ status?: "paid" | "void" | "pending" | "accrued" | "payable" | undefined;
192
202
  channelId?: string | null | undefined;
193
203
  recipientType?: "other" | "supplier" | "channel" | "agency" | "internal" | "affiliate" | "agent" | undefined;
194
- commissionModel?: "percentage" | "fixed" | "markup" | "net" | undefined;
195
204
  currency?: string | null | undefined;
196
205
  amountCents?: number | null | undefined;
197
206
  rateBasisPoints?: number | null | undefined;
198
- status?: "paid" | "void" | "pending" | "accrued" | "payable" | undefined;
199
207
  payableAt?: string | null | undefined;
200
208
  paidAt?: string | null | undefined;
201
209
  notes?: string | null | undefined;
@@ -205,7 +213,7 @@ export declare const financeBookingBillingRoutes: OpenAPIHono<Env, import("hono/
205
213
  error: string;
206
214
  };
207
215
  outputFormat: "json";
208
- status: 400;
216
+ status: 404;
209
217
  } | {
210
218
  input: {
211
219
  param: {
@@ -214,13 +222,13 @@ export declare const financeBookingBillingRoutes: OpenAPIHono<Env, import("hono/
214
222
  };
215
223
  } & {
216
224
  json: {
225
+ commissionModel?: "percentage" | "fixed" | "markup" | "net" | undefined;
226
+ status?: "paid" | "void" | "pending" | "accrued" | "payable" | undefined;
217
227
  channelId?: string | null | undefined;
218
228
  recipientType?: "other" | "supplier" | "channel" | "agency" | "internal" | "affiliate" | "agent" | undefined;
219
- commissionModel?: "percentage" | "fixed" | "markup" | "net" | undefined;
220
229
  currency?: string | null | undefined;
221
230
  amountCents?: number | null | undefined;
222
231
  rateBasisPoints?: number | null | undefined;
223
- status?: "paid" | "void" | "pending" | "accrued" | "payable" | undefined;
224
232
  payableAt?: string | null | undefined;
225
233
  paidAt?: string | null | undefined;
226
234
  notes?: string | null | undefined;
@@ -1100,6 +1108,22 @@ export declare const financeBookingBillingRoutes: OpenAPIHono<Env, import("hono/
1100
1108
  } & {
1101
1109
  "/bookings/:bookingId/guarantees/:guaranteeId": {
1102
1110
  $delete: {
1111
+ input: {
1112
+ param: {
1113
+ bookingId: string;
1114
+ guaranteeId: string;
1115
+ };
1116
+ };
1117
+ output: {
1118
+ error: string;
1119
+ code: string;
1120
+ details?: {
1121
+ [x: string]: import("hono/utils/types").JSONValue;
1122
+ } | undefined;
1123
+ };
1124
+ outputFormat: "json";
1125
+ status: 400;
1126
+ } | {
1103
1127
  input: {
1104
1128
  param: {
1105
1129
  bookingId: string;
@@ -1 +1 @@
1
- {"version":3,"file":"routes-booking-billing.d.ts","sourceRoot":"","sources":["../src/routes-booking-billing.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAEH,OAAO,EAAe,WAAW,EAAK,MAAM,mBAAmB,CAAA;AAM/D,OAAO,EAAE,KAAK,GAAG,EAAY,MAAM,oBAAoB,CAAA;AAm4BvD,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;aAME,CAAA"}
@@ -499,6 +499,10 @@ const deleteBookingGuaranteeRoute = createRoute({
499
499
  description: "Guarantee deleted",
500
500
  content: { "application/json": { schema: successResponseSchema } },
501
501
  },
502
+ 400: {
503
+ description: "invalid_request: guarantee state does not allow deletion",
504
+ content: { "application/json": { schema: paymentValidationErrorSchema } },
505
+ },
502
506
  404: {
503
507
  description: "Booking guarantee not found",
504
508
  content: { "application/json": { schema: errorResponseSchema } },
@@ -552,16 +556,24 @@ const bookingGuaranteeRoutes = new OpenAPIHono({ defaultHook: openApiValidationH
552
556
  return c.json({ data: row }, 200);
553
557
  })
554
558
  .openapi(deleteBookingGuaranteeRoute, async (c) => {
555
- const runtime = getFinanceRouteRuntime(c);
556
- const row = await financeService.deleteBookingGuarantee(c.get("db"), c.req.valid("param").guaranteeId, {
557
- eventBus: runtime?.eventBus,
558
- actionLedgerContext: getActionLedgerRequestContext(c),
559
- actionLedgerAuthorizationSource: "finance.booking_guarantee.route",
560
- });
561
- if (!row) {
562
- return notFound(c, "Booking guarantee not found");
559
+ try {
560
+ const runtime = getFinanceRouteRuntime(c);
561
+ const row = await financeService.deleteBookingGuarantee(c.get("db"), c.req.valid("param").guaranteeId, {
562
+ eventBus: runtime?.eventBus,
563
+ actionLedgerContext: getActionLedgerRequestContext(c),
564
+ actionLedgerAuthorizationSource: "finance.booking_guarantee.route",
565
+ });
566
+ if (!row) {
567
+ return notFound(c, "Booking guarantee not found");
568
+ }
569
+ return c.json({ success: true }, 200);
570
+ }
571
+ catch (error) {
572
+ if (error instanceof PaymentValidationError) {
573
+ return c.json({ error: error.message, code: error.code, details: error.details }, 400);
574
+ }
575
+ throw error;
563
576
  }
564
- return c.json({ success: true }, 200);
565
577
  });
566
578
  // ===========================================================================
567
579
  // Booking Item Tax Lines
@@ -704,7 +716,7 @@ const createBookingItemCommissionRoute = createRoute({
704
716
  },
705
717
  400: {
706
718
  description: "invalid_request: request body failed validation",
707
- content: { "application/json": { schema: errorResponseSchema } },
719
+ content: { "application/json": { schema: paymentValidationErrorSchema } },
708
720
  },
709
721
  404: {
710
722
  description: "Booking item not found",
@@ -731,7 +743,7 @@ const updateBookingItemCommissionRoute = createRoute({
731
743
  },
732
744
  400: {
733
745
  description: "invalid_request: request body failed validation",
734
- content: { "application/json": { schema: errorResponseSchema } },
746
+ content: { "application/json": { schema: paymentValidationErrorSchema } },
735
747
  },
736
748
  404: {
737
749
  description: "Booking item commission not found",
@@ -759,18 +771,34 @@ const bookingItemCommissionRoutes = new OpenAPIHono({ defaultHook: openApiValida
759
771
  data: await financeService.listBookingItemCommissions(c.get("db"), c.req.valid("param").bookingItemId),
760
772
  }, 200))
761
773
  .openapi(createBookingItemCommissionRoute, async (c) => {
762
- const row = await financeService.createBookingItemCommission(c.get("db"), c.req.valid("param").bookingItemId, c.req.valid("json"));
763
- if (!row) {
764
- return notFound(c, "Booking item not found");
774
+ try {
775
+ const row = await financeService.createBookingItemCommission(c.get("db"), c.req.valid("param").bookingItemId, c.req.valid("json"));
776
+ if (!row) {
777
+ return notFound(c, "Booking item not found");
778
+ }
779
+ return c.json({ data: row }, 201);
780
+ }
781
+ catch (error) {
782
+ if (error instanceof PaymentValidationError) {
783
+ return c.json({ error: error.message, code: error.code, details: error.details }, 400);
784
+ }
785
+ throw error;
765
786
  }
766
- return c.json({ data: row }, 201);
767
787
  })
768
788
  .openapi(updateBookingItemCommissionRoute, async (c) => {
769
- const row = await financeService.updateBookingItemCommission(c.get("db"), c.req.valid("param").commissionId, c.req.valid("json"));
770
- if (!row) {
771
- return notFound(c, "Booking item commission not found");
789
+ try {
790
+ const row = await financeService.updateBookingItemCommission(c.get("db"), c.req.valid("param").commissionId, c.req.valid("json"));
791
+ if (!row) {
792
+ return notFound(c, "Booking item commission not found");
793
+ }
794
+ return c.json({ data: row }, 200);
795
+ }
796
+ catch (error) {
797
+ if (error instanceof PaymentValidationError) {
798
+ return c.json({ error: error.message, code: error.code, details: error.details }, 400);
799
+ }
800
+ throw error;
772
801
  }
773
- return c.json({ data: row }, 200);
774
802
  })
775
803
  .openapi(deleteBookingItemCommissionRoute, async (c) => {
776
804
  const row = await financeService.deleteBookingItemCommission(c.get("db"), c.req.valid("param").commissionId);
@@ -29,9 +29,10 @@ export declare const financeBookingReadRoutes: OpenAPIHono<Env, {
29
29
  bookingId: string;
30
30
  payments: {
31
31
  id: string;
32
- invoiceId: string;
33
- invoiceNumber: string;
34
- invoiceType: "invoice" | "proforma" | "credit_note";
32
+ source: "payment" | "voucher_redemption";
33
+ invoiceId: string | null;
34
+ invoiceNumber: string | null;
35
+ invoiceType: "invoice" | "proforma" | "credit_note" | null;
35
36
  status: "pending" | "completed" | "failed" | "refunded";
36
37
  paymentMethod: "bank_transfer" | "credit_card" | "debit_card" | "cash" | "cheque" | "wallet" | "direct_bill" | "voucher" | "other";
37
38
  amountCents: number;
@@ -1 +1 @@
1
- {"version":3,"file":"routes-booking-reads.d.ts","sourceRoot":"","sources":["../src/routes-booking-reads.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAe,WAAW,EAAK,MAAM,mBAAmB,CAAA;AAG/D,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,oBAAoB,CAAA;AAuB7C,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAYnC,CAAA"}
1
+ {"version":3,"file":"routes-booking-reads.d.ts","sourceRoot":"","sources":["../src/routes-booking-reads.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAe,WAAW,EAAK,MAAM,mBAAmB,CAAA;AAG/D,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,oBAAoB,CAAA;AAuB7C,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAYnC,CAAA"}
@@ -1124,9 +1124,10 @@ export declare function createPublicFinanceRoutes(options?: PublicFinanceRouteOp
1124
1124
  bookingId: string;
1125
1125
  payments: {
1126
1126
  id: string;
1127
- invoiceId: string;
1128
- invoiceNumber: string;
1129
- invoiceType: "invoice" | "proforma" | "credit_note";
1127
+ source: "payment" | "voucher_redemption";
1128
+ invoiceId: string | null;
1129
+ invoiceNumber: string | null;
1130
+ invoiceType: "invoice" | "proforma" | "credit_note" | null;
1130
1131
  status: "pending" | "completed" | "failed" | "refunded";
1131
1132
  paymentMethod: "bank_transfer" | "credit_card" | "debit_card" | "cash" | "cheque" | "wallet" | "direct_bill" | "voucher" | "other";
1132
1133
  amountCents: number;
@@ -2518,9 +2519,10 @@ export declare const publicFinanceRoutes: OpenAPIHono<Env, import("hono/types").
2518
2519
  bookingId: string;
2519
2520
  payments: {
2520
2521
  id: string;
2521
- invoiceId: string;
2522
- invoiceNumber: string;
2523
- invoiceType: "invoice" | "proforma" | "credit_note";
2522
+ source: "payment" | "voucher_redemption";
2523
+ invoiceId: string | null;
2524
+ invoiceNumber: string | null;
2525
+ invoiceType: "invoice" | "proforma" | "credit_note" | null;
2524
2526
  status: "pending" | "completed" | "failed" | "refunded";
2525
2527
  paymentMethod: "bank_transfer" | "credit_card" | "debit_card" | "cash" | "cheque" | "wallet" | "direct_bill" | "voucher" | "other";
2526
2528
  amountCents: number;
@@ -1 +1 @@
1
- {"version":3,"file":"routes-public.d.ts","sourceRoot":"","sources":["../src/routes-public.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,WAAW,EAAK,MAAM,mBAAmB,CAAA;AAW/D,OAAO,EAAE,KAAK,GAAG,EAA2B,MAAM,oBAAoB,CAAA;AAqBtE,MAAM,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;aAA8B,CAAA;AAE9D,MAAM,MAAM,mBAAmB,GAAG,OAAO,mBAAmB,CAAA"}
package/dist/routes.d.ts CHANGED
@@ -2842,9 +2842,13 @@ export declare const financeRoutes: import("hono/hono-base").HonoBase<Env, {
2842
2842
  };
2843
2843
  output: {
2844
2844
  error: string;
2845
+ code: string;
2846
+ details?: {
2847
+ [x: string]: import("hono/utils/types").JSONValue;
2848
+ } | undefined;
2845
2849
  };
2846
2850
  outputFormat: "json";
2847
- status: 404;
2851
+ status: 400;
2848
2852
  } | {
2849
2853
  input: {
2850
2854
  param: {
@@ -2868,7 +2872,7 @@ export declare const financeRoutes: import("hono/hono-base").HonoBase<Env, {
2868
2872
  error: string;
2869
2873
  };
2870
2874
  outputFormat: "json";
2871
- status: 400;
2875
+ status: 404;
2872
2876
  } | {
2873
2877
  input: {
2874
2878
  param: {
@@ -2920,13 +2924,13 @@ export declare const financeRoutes: import("hono/hono-base").HonoBase<Env, {
2920
2924
  };
2921
2925
  } & {
2922
2926
  json: {
2927
+ commissionModel?: "percentage" | "fixed" | "markup" | "net" | undefined;
2928
+ status?: "paid" | "void" | "pending" | "accrued" | "payable" | undefined;
2923
2929
  channelId?: string | null | undefined;
2924
2930
  recipientType?: "other" | "supplier" | "channel" | "agency" | "internal" | "affiliate" | "agent" | undefined;
2925
- commissionModel?: "percentage" | "fixed" | "markup" | "net" | undefined;
2926
2931
  currency?: string | null | undefined;
2927
2932
  amountCents?: number | null | undefined;
2928
2933
  rateBasisPoints?: number | null | undefined;
2929
- status?: "paid" | "void" | "pending" | "accrued" | "payable" | undefined;
2930
2934
  payableAt?: string | null | undefined;
2931
2935
  paidAt?: string | null | undefined;
2932
2936
  notes?: string | null | undefined;
@@ -2934,9 +2938,13 @@ export declare const financeRoutes: import("hono/hono-base").HonoBase<Env, {
2934
2938
  };
2935
2939
  output: {
2936
2940
  error: string;
2941
+ code: string;
2942
+ details?: {
2943
+ [x: string]: import("hono/utils/types").JSONValue;
2944
+ } | undefined;
2937
2945
  };
2938
2946
  outputFormat: "json";
2939
- status: 404;
2947
+ status: 400;
2940
2948
  } | {
2941
2949
  input: {
2942
2950
  param: {
@@ -2945,13 +2953,13 @@ export declare const financeRoutes: import("hono/hono-base").HonoBase<Env, {
2945
2953
  };
2946
2954
  } & {
2947
2955
  json: {
2956
+ commissionModel?: "percentage" | "fixed" | "markup" | "net" | undefined;
2957
+ status?: "paid" | "void" | "pending" | "accrued" | "payable" | undefined;
2948
2958
  channelId?: string | null | undefined;
2949
2959
  recipientType?: "other" | "supplier" | "channel" | "agency" | "internal" | "affiliate" | "agent" | undefined;
2950
- commissionModel?: "percentage" | "fixed" | "markup" | "net" | undefined;
2951
2960
  currency?: string | null | undefined;
2952
2961
  amountCents?: number | null | undefined;
2953
2962
  rateBasisPoints?: number | null | undefined;
2954
- status?: "paid" | "void" | "pending" | "accrued" | "payable" | undefined;
2955
2963
  payableAt?: string | null | undefined;
2956
2964
  paidAt?: string | null | undefined;
2957
2965
  notes?: string | null | undefined;
@@ -2961,7 +2969,7 @@ export declare const financeRoutes: import("hono/hono-base").HonoBase<Env, {
2961
2969
  error: string;
2962
2970
  };
2963
2971
  outputFormat: "json";
2964
- status: 400;
2972
+ status: 404;
2965
2973
  } | {
2966
2974
  input: {
2967
2975
  param: {
@@ -2970,13 +2978,13 @@ export declare const financeRoutes: import("hono/hono-base").HonoBase<Env, {
2970
2978
  };
2971
2979
  } & {
2972
2980
  json: {
2981
+ commissionModel?: "percentage" | "fixed" | "markup" | "net" | undefined;
2982
+ status?: "paid" | "void" | "pending" | "accrued" | "payable" | undefined;
2973
2983
  channelId?: string | null | undefined;
2974
2984
  recipientType?: "other" | "supplier" | "channel" | "agency" | "internal" | "affiliate" | "agent" | undefined;
2975
- commissionModel?: "percentage" | "fixed" | "markup" | "net" | undefined;
2976
2985
  currency?: string | null | undefined;
2977
2986
  amountCents?: number | null | undefined;
2978
2987
  rateBasisPoints?: number | null | undefined;
2979
- status?: "paid" | "void" | "pending" | "accrued" | "payable" | undefined;
2980
2988
  payableAt?: string | null | undefined;
2981
2989
  paidAt?: string | null | undefined;
2982
2990
  notes?: string | null | undefined;
@@ -3856,6 +3864,22 @@ export declare const financeRoutes: import("hono/hono-base").HonoBase<Env, {
3856
3864
  } & {
3857
3865
  "/bookings/:bookingId/guarantees/:guaranteeId": {
3858
3866
  $delete: {
3867
+ input: {
3868
+ param: {
3869
+ bookingId: string;
3870
+ guaranteeId: string;
3871
+ };
3872
+ };
3873
+ output: {
3874
+ error: string;
3875
+ code: string;
3876
+ details?: {
3877
+ [x: string]: import("hono/utils/types").JSONValue;
3878
+ } | undefined;
3879
+ };
3880
+ outputFormat: "json";
3881
+ status: 400;
3882
+ } | {
3859
3883
  input: {
3860
3884
  param: {
3861
3885
  bookingId: string;
@@ -9068,9 +9092,10 @@ export declare const financeRoutes: import("hono/hono-base").HonoBase<Env, {
9068
9092
  bookingId: string;
9069
9093
  payments: {
9070
9094
  id: string;
9071
- invoiceId: string;
9072
- invoiceNumber: string;
9073
- invoiceType: "invoice" | "proforma" | "credit_note";
9095
+ source: "payment" | "voucher_redemption";
9096
+ invoiceId: string | null;
9097
+ invoiceNumber: string | null;
9098
+ invoiceType: "invoice" | "proforma" | "credit_note" | null;
9074
9099
  status: "pending" | "completed" | "failed" | "refunded";
9075
9100
  paymentMethod: "bank_transfer" | "credit_card" | "debit_card" | "cash" | "cheque" | "wallet" | "direct_bill" | "voucher" | "other";
9076
9101
  amountCents: number;