@voyant-travel/finance 0.169.0 → 0.169.2

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.
@@ -0,0 +1,17 @@
1
+ import type { ApiExtension } from "@voyant-travel/hono/module";
2
+ import type { Context } from "hono";
3
+ import { type BookingTaxRouteOptions } from "./booking-tax.js";
4
+ export declare const BOOKING_TAX_SETTINGS_RUNTIME_KEY = "finance.bookingTaxSettingsRuntime";
5
+ export declare const BOOKING_TAX_PREVIEW_RUNTIME_KEY = "finance.bookingTaxPreviewRuntime";
6
+ export interface BookingTaxRuntime {
7
+ resolveRoutesOptions(): BookingTaxRouteOptions;
8
+ }
9
+ /**
10
+ * Resolve the container-registered booking-tax route options at request time,
11
+ * preferring the wired runtime (registered by the graph factory's bootstrap)
12
+ * over the closure options a plain api-facet call captured. Fail-open: any
13
+ * missing/empty container falls back to the passed options.
14
+ */
15
+ export declare function resolveBookingTaxRouteOptions(c: Context, runtimeKey: string, fallback: BookingTaxRouteOptions): BookingTaxRouteOptions;
16
+ export declare const createBookingTaxSettingsVoyantRuntime: import("@voyant-travel/core/project").VoyantGraphRuntimeFactory<ApiExtension>;
17
+ export declare const createBookingTaxPreviewVoyantRuntime: import("@voyant-travel/core/project").VoyantGraphRuntimeFactory<ApiExtension>;
@@ -0,0 +1,68 @@
1
+ import { defineGraphRuntimeFactory } from "@voyant-travel/core/project";
2
+ import { createBookingTaxPreviewApiExtension, createBookingTaxSettingsApiExtension, } from "./booking-tax.js";
3
+ import { createFinanceBookingTaxRuntime } from "./runtime.js";
4
+ import { financeOperatorSettingsRuntimePort } from "./runtime-port.js";
5
+ // ─────────────────────────────────────────────────────────────────
6
+ // Runtime-container wiring (mirrors booking-schedule)
7
+ // ─────────────────────────────────────────────────────────────────
8
+ //
9
+ // On the managed runtime each graph unit's runtime exports are ALL invoked:
10
+ // a `defineGraphRuntimeFactory` export receives the factory context (`getPort`)
11
+ // and wires the operator-settings port into options; a PLAIN api-facet export
12
+ // is invoked with NO ARGS, so it sees empty options. The graph factory
13
+ // therefore registers the WIRED options into the shared app container under a
14
+ // runtime key, and the routes resolve those options from the container at
15
+ // request time — falling back to the closure options for standard callers that
16
+ // pass real options directly. This keeps the wired options winning without an
17
+ // empty-options route mount racing the factory's.
18
+ export const BOOKING_TAX_SETTINGS_RUNTIME_KEY = "finance.bookingTaxSettingsRuntime";
19
+ export const BOOKING_TAX_PREVIEW_RUNTIME_KEY = "finance.bookingTaxPreviewRuntime";
20
+ /**
21
+ * Resolve the container-registered booking-tax route options at request time,
22
+ * preferring the wired runtime (registered by the graph factory's bootstrap)
23
+ * over the closure options a plain api-facet call captured. Fail-open: any
24
+ * missing/empty container falls back to the passed options.
25
+ */
26
+ export function resolveBookingTaxRouteOptions(c, runtimeKey, fallback) {
27
+ const container = c.get("container");
28
+ if (!container?.has(runtimeKey))
29
+ return fallback;
30
+ try {
31
+ return container.resolve(runtimeKey).resolveRoutesOptions();
32
+ }
33
+ catch {
34
+ return fallback;
35
+ }
36
+ }
37
+ export const createBookingTaxSettingsVoyantRuntime = defineGraphRuntimeFactory(async ({ getPort }) => {
38
+ const options = createFinanceBookingTaxRuntime(await getPort(financeOperatorSettingsRuntimePort));
39
+ const configured = createBookingTaxSettingsApiExtension(options);
40
+ const selected = {
41
+ ...configured,
42
+ extension: {
43
+ ...configured.extension,
44
+ bootstrap: async ({ container }) => {
45
+ container.register(BOOKING_TAX_SETTINGS_RUNTIME_KEY, {
46
+ resolveRoutesOptions: () => options,
47
+ });
48
+ },
49
+ },
50
+ };
51
+ return selected;
52
+ });
53
+ export const createBookingTaxPreviewVoyantRuntime = defineGraphRuntimeFactory(async ({ getPort }) => {
54
+ const options = createFinanceBookingTaxRuntime(await getPort(financeOperatorSettingsRuntimePort));
55
+ const configured = createBookingTaxPreviewApiExtension(options);
56
+ const selected = {
57
+ ...configured,
58
+ extension: {
59
+ ...configured.extension,
60
+ bootstrap: async ({ container }) => {
61
+ container.register(BOOKING_TAX_PREVIEW_RUNTIME_KEY, {
62
+ resolveRoutesOptions: () => options,
63
+ });
64
+ },
65
+ },
66
+ };
67
+ return selected;
68
+ });
@@ -1,4 +1,5 @@
1
1
  import { OpenAPIHono } from "@hono/zod-openapi";
2
+ import type { ModuleContainer } from "@voyant-travel/core";
2
3
  import type { ApiExtension } from "@voyant-travel/hono/module";
3
4
  import type { PostgresJsDatabase } from "drizzle-orm/postgres-js";
4
5
  import type { Hono } from "hono";
@@ -73,6 +74,7 @@ export declare function matchesTaxPolicyCondition(condition: TaxPolicyCondition
73
74
  export declare function createBookingTaxSettingsRoutes(options?: BookingTaxRouteOptions): OpenAPIHono<{
74
75
  Variables: {
75
76
  db: PostgresJsDatabase;
77
+ container?: ModuleContainer;
76
78
  };
77
79
  }, {
78
80
  "/tax-settings": {
@@ -92,17 +94,6 @@ export declare function createBookingTaxSettingsRoutes(options?: BookingTaxRoute
92
94
  } & {
93
95
  "/tax-settings": {
94
96
  $patch: {
95
- input: {
96
- json: {
97
- taxPriceMode?: "inclusive" | "exclusive" | undefined;
98
- taxPolicyProfileId?: string | null | undefined;
99
- invoicingMode?: "direct" | "proforma-first" | undefined;
100
- };
101
- };
102
- output: {};
103
- outputFormat: string;
104
- status: 409;
105
- } | {
106
97
  input: {
107
98
  json: {
108
99
  taxPriceMode?: "inclusive" | "exclusive" | undefined;
@@ -119,6 +110,17 @@ export declare function createBookingTaxSettingsRoutes(options?: BookingTaxRoute
119
110
  };
120
111
  outputFormat: "json";
121
112
  status: 200;
113
+ } | {
114
+ input: {
115
+ json: {
116
+ taxPriceMode?: "inclusive" | "exclusive" | undefined;
117
+ taxPolicyProfileId?: string | null | undefined;
118
+ invoicingMode?: "direct" | "proforma-first" | undefined;
119
+ };
120
+ };
121
+ output: {};
122
+ outputFormat: string;
123
+ status: 409;
122
124
  };
123
125
  };
124
126
  }, "/">;
@@ -132,6 +134,7 @@ export declare function createBookingTaxSettingsRoutes(options?: BookingTaxRoute
132
134
  export declare function createBookingTaxPreviewRoutes(options?: BookingTaxRouteOptions): OpenAPIHono<{
133
135
  Variables: {
134
136
  db: PostgresJsDatabase;
137
+ container?: ModuleContainer;
135
138
  };
136
139
  }, {
137
140
  "/tax-preview": {
@@ -168,5 +171,3 @@ export declare function mountBookingTaxSettingsRoutes(hono: Hono, options?: Book
168
171
  export declare function mountBookingTaxPreviewRoutes(hono: Hono, options?: BookingTaxRouteOptions): void;
169
172
  export declare function createBookingTaxSettingsApiExtension(options?: BookingTaxRouteOptions): ApiExtension;
170
173
  export declare function createBookingTaxPreviewApiExtension(options?: BookingTaxRouteOptions): ApiExtension;
171
- export declare const createBookingTaxSettingsVoyantRuntime: import("@voyant-travel/core/project").VoyantGraphRuntimeFactory<ApiExtension>;
172
- export declare const createBookingTaxPreviewVoyantRuntime: import("@voyant-travel/core/project").VoyantGraphRuntimeFactory<ApiExtension>;
@@ -1,9 +1,7 @@
1
1
  import { createRoute, OpenAPIHono, z } from "@hono/zod-openapi";
2
- import { defineGraphRuntimeFactory } from "@voyant-travel/core/project";
3
2
  import { ApiHttpError, openApiValidationHook, stampOpenApiRegistryApiId } from "@voyant-travel/hono";
4
3
  import { and, asc, eq, sql } from "drizzle-orm";
5
- import { createFinanceBookingTaxRuntime } from "./runtime.js";
6
- import { financeOperatorSettingsRuntimePort } from "./runtime-port.js";
4
+ import { BOOKING_TAX_PREVIEW_RUNTIME_KEY, BOOKING_TAX_SETTINGS_RUNTIME_KEY, resolveBookingTaxRouteOptions, } from "./booking-tax-runtime.js";
7
5
  import { taxClasses, taxPolicyProfiles, taxPolicyRules, taxRegimes } from "./schema.js";
8
6
  import { executeBoundaryRows } from "./service-boundary-sql.js";
9
7
  const taxPreviewBodySchema = z.object({
@@ -269,20 +267,22 @@ async function resolveProductTaxClassRate(db, productId, priceMode) {
269
267
  export function createBookingTaxSettingsRoutes(options = {}) {
270
268
  const routes = new OpenAPIHono({ defaultHook: openApiValidationHook })
271
269
  .openapi(getBookingTaxSettingsRoute, async (c) => {
270
+ const opts = resolveBookingTaxRouteOptions(c, BOOKING_TAX_SETTINGS_RUNTIME_KEY, options);
272
271
  return c.json({
273
- data: await resolveBookingTaxSettingsOrDefault(c.get("db"), options),
272
+ data: await resolveBookingTaxSettingsOrDefault(c.get("db"), opts),
274
273
  }, 200);
275
274
  })
276
275
  .openapi(updateBookingTaxSettingsRoute, async (c) => {
277
- if (!options.updateBookingTaxSettings) {
276
+ const opts = resolveBookingTaxRouteOptions(c, BOOKING_TAX_SETTINGS_RUNTIME_KEY, options);
277
+ if (!opts.updateBookingTaxSettings) {
278
278
  throw new ApiHttpError("Booking tax settings updates are not configured", {
279
279
  status: 409,
280
280
  code: "booking_tax_settings_update_not_configured",
281
281
  });
282
282
  }
283
- const current = await resolveBookingTaxSettingsOrDefault(c.get("db"), options);
283
+ const current = await resolveBookingTaxSettingsOrDefault(c.get("db"), opts);
284
284
  const patch = c.req.valid("json");
285
- const next = await options.updateBookingTaxSettings(c.get("db"), {
285
+ const next = await opts.updateBookingTaxSettings(c.get("db"), {
286
286
  taxPriceMode: patch.taxPriceMode ?? current.taxPriceMode,
287
287
  taxPolicyProfileId: patch.taxPolicyProfileId === undefined
288
288
  ? current.taxPolicyProfileId
@@ -305,7 +305,8 @@ export function createBookingTaxSettingsRoutes(options = {}) {
305
305
  export function createBookingTaxPreviewRoutes(options = {}) {
306
306
  const routes = new OpenAPIHono({ defaultHook: openApiValidationHook }).openapi(previewBookingTaxRoute, async (c) => {
307
307
  const body = c.req.valid("json");
308
- const taxRate = await resolveBookingSellTaxRate(c.get("db"), { productId: body.productId }, options);
308
+ const opts = resolveBookingTaxRouteOptions(c, BOOKING_TAX_PREVIEW_RUNTIME_KEY, options);
309
+ const taxRate = await resolveBookingSellTaxRate(c.get("db"), { productId: body.productId }, opts);
309
310
  const taxLine = computeBookingItemTaxLine(taxRate, body.subtotalCents, body.currency);
310
311
  if (!taxRate || !taxLine) {
311
312
  return c.json({
@@ -355,7 +356,7 @@ export function createBookingTaxSettingsApiExtension(options = {}) {
355
356
  };
356
357
  return {
357
358
  extension,
358
- adminRoutes: createBookingTaxSettingsRoutes(options),
359
+ lazyAdminRoutes: async () => createBookingTaxSettingsRoutes(options),
359
360
  };
360
361
  }
361
362
  export function createBookingTaxPreviewApiExtension(options = {}) {
@@ -365,12 +366,6 @@ export function createBookingTaxPreviewApiExtension(options = {}) {
365
366
  };
366
367
  return {
367
368
  extension,
368
- adminRoutes: createBookingTaxPreviewRoutes(options),
369
+ lazyAdminRoutes: async () => createBookingTaxPreviewRoutes(options),
369
370
  };
370
371
  }
371
- export const createBookingTaxSettingsVoyantRuntime = defineGraphRuntimeFactory(async ({ getPort }) => {
372
- return createBookingTaxSettingsApiExtension(createFinanceBookingTaxRuntime(await getPort(financeOperatorSettingsRuntimePort)));
373
- });
374
- export const createBookingTaxPreviewVoyantRuntime = defineGraphRuntimeFactory(async ({ getPort }) => {
375
- return createBookingTaxPreviewApiExtension(createFinanceBookingTaxRuntime(await getPort(financeOperatorSettingsRuntimePort)));
376
- });
package/dist/index.d.ts CHANGED
@@ -26,7 +26,8 @@ export declare const createFinanceVoyantRuntime: import("@voyant-travel/core/pro
26
26
  export type { PaymentAdapter, PaymentAdapterCapabilities, PaymentAdapterConformanceHarness, PaymentAdapterConformanceResult, PaymentAdapterDiagnostics, PaymentAdapterRuntimeContext, PaymentCallbackEvent, PaymentCallbackRequest, PaymentCallbackVerificationResult, PaymentInitiationInput, PaymentInitiationResult, PaymentMoney, PaymentOperationInput, PaymentOperationResult, PaymentStatusInput, PaymentStatusResult, } from "@voyant-travel/payments";
27
27
  export { PAYMENT_ADAPTER_CONTRACT_VERSION, PAYMENT_ADAPTER_RUNTIME_PORT_ID, paymentAdapterRuntimePort, runPaymentAdapterConformance, } from "@voyant-travel/payments";
28
28
  export { type BookingCancellationSettlementInput, buildPaidBookingCancellationSettlementNote, closeTerminalBookingPaymentSchedules, financeBookingLifecycle, recordPaidBookingCancellationSettlement, } from "./booking-lifecycle.js";
29
- export { type BookingTaxRouteOptions, type BookingTaxSettings, computeBookingItemTaxLine, createBookingTaxPreviewApiExtension, createBookingTaxPreviewRoutes, createBookingTaxPreviewVoyantRuntime, createBookingTaxSettingsApiExtension, createBookingTaxSettingsRoutes, createBookingTaxSettingsVoyantRuntime, loadProductTaxFacts, matchesTaxPolicyCondition, mountBookingTaxPreviewRoutes, mountBookingTaxSettingsRoutes, type ProductTaxFacts, type ResolveBookingSellTaxRateOptions, type ResolveBookingTaxSettings, type ResolvedBookingSellTaxRate, resolveBookingSellTaxRate, type TaxPolicyCondition, type UpdateBookingTaxSettings, } from "./booking-tax.js";
29
+ export { type BookingTaxRouteOptions, type BookingTaxSettings, computeBookingItemTaxLine, createBookingTaxPreviewApiExtension, createBookingTaxPreviewRoutes, createBookingTaxSettingsApiExtension, createBookingTaxSettingsRoutes, loadProductTaxFacts, matchesTaxPolicyCondition, mountBookingTaxPreviewRoutes, mountBookingTaxSettingsRoutes, type ProductTaxFacts, type ResolveBookingSellTaxRateOptions, type ResolveBookingTaxSettings, type ResolvedBookingSellTaxRate, resolveBookingSellTaxRate, type TaxPolicyCondition, type UpdateBookingTaxSettings, } from "./booking-tax.js";
30
+ export { BOOKING_TAX_PREVIEW_RUNTIME_KEY, BOOKING_TAX_SETTINGS_RUNTIME_KEY, type BookingTaxRuntime, createBookingTaxPreviewVoyantRuntime, createBookingTaxSettingsVoyantRuntime, } from "./booking-tax-runtime.js";
30
31
  export type { CardPaymentBilling, CardPaymentStartArgs, CardPaymentStarter, CardPaymentStartResult, PaymentAdapterCardPaymentStarterOptions, } from "./card-payment.js";
31
32
  export { createPaymentAdapterCardPaymentStarter } from "./card-payment.js";
32
33
  export { type DocumentDownloadEnvelope, type DocumentDownloadResolution, type DocumentDownloadResolver, resolveStoredDocumentDownload, type StoredDocumentReference, } from "./document-download.js";
package/dist/index.js CHANGED
@@ -89,7 +89,8 @@ export const createFinanceVoyantRuntime = defineGraphRuntimeFactory(async ({ api
89
89
  });
90
90
  export { PAYMENT_ADAPTER_CONTRACT_VERSION, PAYMENT_ADAPTER_RUNTIME_PORT_ID, paymentAdapterRuntimePort, runPaymentAdapterConformance, } from "@voyant-travel/payments";
91
91
  export { buildPaidBookingCancellationSettlementNote, closeTerminalBookingPaymentSchedules, financeBookingLifecycle, recordPaidBookingCancellationSettlement, } from "./booking-lifecycle.js";
92
- export { computeBookingItemTaxLine, createBookingTaxPreviewApiExtension, createBookingTaxPreviewRoutes, createBookingTaxPreviewVoyantRuntime, createBookingTaxSettingsApiExtension, createBookingTaxSettingsRoutes, createBookingTaxSettingsVoyantRuntime, loadProductTaxFacts, matchesTaxPolicyCondition, mountBookingTaxPreviewRoutes, mountBookingTaxSettingsRoutes, resolveBookingSellTaxRate, } from "./booking-tax.js";
92
+ export { computeBookingItemTaxLine, createBookingTaxPreviewApiExtension, createBookingTaxPreviewRoutes, createBookingTaxSettingsApiExtension, createBookingTaxSettingsRoutes, loadProductTaxFacts, matchesTaxPolicyCondition, mountBookingTaxPreviewRoutes, mountBookingTaxSettingsRoutes, resolveBookingSellTaxRate, } from "./booking-tax.js";
93
+ export { BOOKING_TAX_PREVIEW_RUNTIME_KEY, BOOKING_TAX_SETTINGS_RUNTIME_KEY, createBookingTaxPreviewVoyantRuntime, createBookingTaxSettingsVoyantRuntime, } from "./booking-tax-runtime.js";
93
94
  export { createPaymentAdapterCardPaymentStarter } from "./card-payment.js";
94
95
  export { resolveStoredDocumentDownload, } from "./document-download.js";
95
96
  export { createInvoiceFxApiExtension, createInvoiceFxRoutes, createVoyantDataFxExchangeRateResolver, mountInvoiceFxRoutes, resolveInvoiceFxContext, resolveInvoiceFxSettingsOrDefault, } from "./invoice-fx.js";
@@ -36,17 +36,6 @@ declare function getPaymentSessionLedgerTarget(session: {
36
36
  export declare const financeActionLedgerRoutes: OpenAPIHono<Env, {
37
37
  [x: string]: {
38
38
  $get: {
39
- input: {
40
- param: {
41
- [x: string]: string;
42
- };
43
- };
44
- output: {
45
- error: string;
46
- };
47
- outputFormat: "json";
48
- status: 404;
49
- } | {
50
39
  input: {
51
40
  param: {
52
41
  [x: string]: string;
@@ -58,7 +47,7 @@ export declare const financeActionLedgerRoutes: OpenAPIHono<Env, {
58
47
  occurredAt: string;
59
48
  actionName: string;
60
49
  actionVersion: string;
61
- actionKind: "reverse" | "execute" | "update" | "delete" | "read" | "create" | "approve" | "reject" | "compensate" | "duplicate";
50
+ actionKind: "reverse" | "execute" | "delete" | "update" | "read" | "create" | "approve" | "reject" | "compensate" | "duplicate";
62
51
  status: "failed" | "cancelled" | "expired" | "approved" | "requested" | "awaiting_approval" | "denied" | "succeeded" | "reversed" | "compensated" | "superseded";
63
52
  evaluatedRisk: "low" | "medium" | "high" | "critical";
64
53
  actorType: string | null;
@@ -100,11 +89,7 @@ export declare const financeActionLedgerRoutes: OpenAPIHono<Env, {
100
89
  };
101
90
  outputFormat: "json";
102
91
  status: 200;
103
- };
104
- };
105
- } & {
106
- [x: string]: {
107
- $get: {
92
+ } | {
108
93
  input: {
109
94
  param: {
110
95
  [x: string]: string;
@@ -115,7 +100,11 @@ export declare const financeActionLedgerRoutes: OpenAPIHono<Env, {
115
100
  };
116
101
  outputFormat: "json";
117
102
  status: 404;
118
- } | {
103
+ };
104
+ };
105
+ } & {
106
+ [x: string]: {
107
+ $get: {
119
108
  input: {
120
109
  param: {
121
110
  [x: string]: string;
@@ -127,7 +116,7 @@ export declare const financeActionLedgerRoutes: OpenAPIHono<Env, {
127
116
  occurredAt: string;
128
117
  actionName: string;
129
118
  actionVersion: string;
130
- actionKind: "reverse" | "execute" | "update" | "delete" | "read" | "create" | "approve" | "reject" | "compensate" | "duplicate";
119
+ actionKind: "reverse" | "execute" | "delete" | "update" | "read" | "create" | "approve" | "reject" | "compensate" | "duplicate";
131
120
  status: "failed" | "cancelled" | "expired" | "approved" | "requested" | "awaiting_approval" | "denied" | "succeeded" | "reversed" | "compensated" | "superseded";
132
121
  evaluatedRisk: "low" | "medium" | "high" | "critical";
133
122
  actorType: string | null;
@@ -169,6 +158,17 @@ export declare const financeActionLedgerRoutes: OpenAPIHono<Env, {
169
158
  };
170
159
  outputFormat: "json";
171
160
  status: 200;
161
+ } | {
162
+ input: {
163
+ param: {
164
+ [x: string]: string;
165
+ };
166
+ };
167
+ output: {
168
+ error: string;
169
+ };
170
+ outputFormat: "json";
171
+ status: 404;
172
172
  };
173
173
  };
174
174
  }, "/">;
@@ -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: {
@@ -110,13 +114,9 @@ export declare const financeBookingBillingRoutes: OpenAPIHono<Env, import("hono/
110
114
  };
111
115
  output: {
112
116
  error: string;
113
- code: string;
114
- details?: {
115
- [x: string]: import("hono/utils/types").JSONValue;
116
- } | undefined;
117
117
  };
118
118
  outputFormat: "json";
119
- status: 400;
119
+ status: 404;
120
120
  } | {
121
121
  input: {
122
122
  param: {
@@ -182,9 +182,13 @@ export declare const financeBookingBillingRoutes: OpenAPIHono<Env, import("hono/
182
182
  };
183
183
  output: {
184
184
  error: string;
185
+ code: string;
186
+ details?: {
187
+ [x: string]: import("hono/utils/types").JSONValue;
188
+ } | undefined;
185
189
  };
186
190
  outputFormat: "json";
187
- status: 404;
191
+ status: 400;
188
192
  } | {
189
193
  input: {
190
194
  param: {
@@ -207,13 +211,9 @@ export declare const financeBookingBillingRoutes: OpenAPIHono<Env, import("hono/
207
211
  };
208
212
  output: {
209
213
  error: string;
210
- code: string;
211
- details?: {
212
- [x: string]: import("hono/utils/types").JSONValue;
213
- } | undefined;
214
214
  };
215
215
  outputFormat: "json";
216
- status: 400;
216
+ status: 404;
217
217
  } | {
218
218
  input: {
219
219
  param: {
@@ -1116,9 +1116,13 @@ export declare const financeBookingBillingRoutes: OpenAPIHono<Env, import("hono/
1116
1116
  };
1117
1117
  output: {
1118
1118
  error: string;
1119
+ code: string;
1120
+ details?: {
1121
+ [x: string]: import("hono/utils/types").JSONValue;
1122
+ } | undefined;
1119
1123
  };
1120
1124
  outputFormat: "json";
1121
- status: 404;
1125
+ status: 400;
1122
1126
  } | {
1123
1127
  input: {
1124
1128
  param: {
@@ -1128,13 +1132,9 @@ export declare const financeBookingBillingRoutes: OpenAPIHono<Env, import("hono/
1128
1132
  };
1129
1133
  output: {
1130
1134
  error: string;
1131
- code: string;
1132
- details?: {
1133
- [x: string]: import("hono/utils/types").JSONValue;
1134
- } | undefined;
1135
1135
  };
1136
1136
  outputFormat: "json";
1137
- status: 400;
1137
+ status: 404;
1138
1138
  } | {
1139
1139
  input: {
1140
1140
  param: {
@@ -1195,22 +1195,15 @@ export declare const financeBookingBillingRoutes: OpenAPIHono<Env, import("hono/
1195
1195
  };
1196
1196
  };
1197
1197
  output: {
1198
- data: {
1199
- id: string;
1200
- bookingId: string;
1201
- bookingItemId: string | null;
1202
- scheduleType: "other" | "deposit" | "installment" | "balance" | "hold";
1203
- status: "paid" | "pending" | "cancelled" | "expired" | "due" | "waived";
1204
- dueDate: string;
1205
- currency: string;
1206
- amountCents: number;
1207
- notes: string | null;
1208
- createdAt: string;
1209
- updatedAt: string;
1210
- };
1198
+ error: string;
1199
+ existingActionId?: string | undefined;
1200
+ code?: string | undefined;
1201
+ details?: {
1202
+ [x: string]: import("hono/utils/types").JSONValue;
1203
+ } | undefined;
1211
1204
  };
1212
1205
  outputFormat: "json";
1213
- status: 201;
1206
+ status: 409;
1214
1207
  } | {
1215
1208
  input: {
1216
1209
  param: {
@@ -1228,10 +1221,22 @@ export declare const financeBookingBillingRoutes: OpenAPIHono<Env, import("hono/
1228
1221
  };
1229
1222
  };
1230
1223
  output: {
1231
- error: string;
1224
+ data: {
1225
+ id: string;
1226
+ bookingId: string;
1227
+ bookingItemId: string | null;
1228
+ scheduleType: "other" | "deposit" | "installment" | "balance" | "hold";
1229
+ status: "paid" | "pending" | "cancelled" | "expired" | "due" | "waived";
1230
+ dueDate: string;
1231
+ currency: string;
1232
+ amountCents: number;
1233
+ notes: string | null;
1234
+ createdAt: string;
1235
+ updatedAt: string;
1236
+ };
1232
1237
  };
1233
1238
  outputFormat: "json";
1234
- status: 404;
1239
+ status: 201;
1235
1240
  } | {
1236
1241
  input: {
1237
1242
  param: {
@@ -1275,14 +1280,9 @@ export declare const financeBookingBillingRoutes: OpenAPIHono<Env, import("hono/
1275
1280
  };
1276
1281
  output: {
1277
1282
  error: string;
1278
- existingActionId?: string | undefined;
1279
- code?: string | undefined;
1280
- details?: {
1281
- [x: string]: import("hono/utils/types").JSONValue;
1282
- } | undefined;
1283
1283
  };
1284
1284
  outputFormat: "json";
1285
- status: 409;
1285
+ status: 404;
1286
1286
  };
1287
1287
  };
1288
1288
  } & {
@@ -1388,9 +1388,14 @@ export declare const financeBookingBillingRoutes: OpenAPIHono<Env, import("hono/
1388
1388
  };
1389
1389
  output: {
1390
1390
  error: string;
1391
+ existingActionId?: string | undefined;
1392
+ code?: string | undefined;
1393
+ details?: {
1394
+ [x: string]: import("hono/utils/types").JSONValue;
1395
+ } | undefined;
1391
1396
  };
1392
1397
  outputFormat: "json";
1393
- status: 404;
1398
+ status: 409;
1394
1399
  } | {
1395
1400
  input: {
1396
1401
  param: {
@@ -1436,14 +1441,9 @@ export declare const financeBookingBillingRoutes: OpenAPIHono<Env, import("hono/
1436
1441
  };
1437
1442
  output: {
1438
1443
  error: string;
1439
- existingActionId?: string | undefined;
1440
- code?: string | undefined;
1441
- details?: {
1442
- [x: string]: import("hono/utils/types").JSONValue;
1443
- } | undefined;
1444
1444
  };
1445
1445
  outputFormat: "json";
1446
- status: 409;
1446
+ status: 404;
1447
1447
  } | {
1448
1448
  input: {
1449
1449
  param: {
@@ -1685,57 +1685,10 @@ export declare const financeBookingBillingRoutes: OpenAPIHono<Env, import("hono/
1685
1685
  };
1686
1686
  };
1687
1687
  output: {
1688
- data: {
1689
- id: string;
1690
- targetType: "other" | "booking" | "order" | "invoice" | "booking_payment_schedule" | "booking_guarantee" | "flight_order";
1691
- targetId: string | null;
1692
- bookingId: string | null;
1693
- orderId: string | null;
1694
- invoiceId: string | null;
1695
- bookingPaymentScheduleId: string | null;
1696
- bookingGuaranteeId: string | null;
1697
- paymentInstrumentId: string | null;
1698
- paymentAuthorizationId: string | null;
1699
- paymentCaptureId: string | null;
1700
- paymentId: string | null;
1701
- status: "paid" | "pending" | "failed" | "requires_redirect" | "processing" | "authorized" | "cancelled" | "expired";
1702
- provider: string | null;
1703
- providerSessionId: string | null;
1704
- providerPaymentId: string | null;
1705
- externalReference: string | null;
1706
- idempotencyKey: string | null;
1707
- clientReference: string | null;
1708
- currency: string;
1709
- amountCents: number;
1710
- paymentMethod: "bank_transfer" | "credit_card" | "debit_card" | "cash" | "cheque" | "wallet" | "direct_bill" | "travel_credit" | "other" | null;
1711
- payerPersonId: string | null;
1712
- payerOrganizationId: string | null;
1713
- payerEmail: string | null;
1714
- payerName: string | null;
1715
- redirectUrl: string | null;
1716
- returnUrl: string | null;
1717
- cancelUrl: string | null;
1718
- callbackUrl: string | null;
1719
- expiresAt: string | null;
1720
- completedAt: string | null;
1721
- failedAt: string | null;
1722
- cancelledAt: string | null;
1723
- expiredAt: string | null;
1724
- failureCode: string | null;
1725
- failureMessage: string | null;
1726
- notes: string | null;
1727
- providerPayload: {
1728
- [x: string]: import("hono/utils/types").JSONValue;
1729
- } | null;
1730
- metadata: {
1731
- [x: string]: import("hono/utils/types").JSONValue;
1732
- } | null;
1733
- createdAt: string;
1734
- updatedAt: string;
1735
- };
1688
+ error: string;
1736
1689
  };
1737
1690
  outputFormat: "json";
1738
- status: 201;
1691
+ status: 409;
1739
1692
  } | {
1740
1693
  input: {
1741
1694
  param: {
@@ -1801,10 +1754,57 @@ export declare const financeBookingBillingRoutes: OpenAPIHono<Env, import("hono/
1801
1754
  };
1802
1755
  };
1803
1756
  output: {
1804
- error: string;
1757
+ data: {
1758
+ id: string;
1759
+ targetType: "other" | "booking" | "order" | "invoice" | "booking_payment_schedule" | "booking_guarantee" | "flight_order";
1760
+ targetId: string | null;
1761
+ bookingId: string | null;
1762
+ orderId: string | null;
1763
+ invoiceId: string | null;
1764
+ bookingPaymentScheduleId: string | null;
1765
+ bookingGuaranteeId: string | null;
1766
+ paymentInstrumentId: string | null;
1767
+ paymentAuthorizationId: string | null;
1768
+ paymentCaptureId: string | null;
1769
+ paymentId: string | null;
1770
+ status: "paid" | "pending" | "failed" | "requires_redirect" | "processing" | "authorized" | "cancelled" | "expired";
1771
+ provider: string | null;
1772
+ providerSessionId: string | null;
1773
+ providerPaymentId: string | null;
1774
+ externalReference: string | null;
1775
+ idempotencyKey: string | null;
1776
+ clientReference: string | null;
1777
+ currency: string;
1778
+ amountCents: number;
1779
+ paymentMethod: "bank_transfer" | "credit_card" | "debit_card" | "cash" | "cheque" | "wallet" | "direct_bill" | "travel_credit" | "other" | null;
1780
+ payerPersonId: string | null;
1781
+ payerOrganizationId: string | null;
1782
+ payerEmail: string | null;
1783
+ payerName: string | null;
1784
+ redirectUrl: string | null;
1785
+ returnUrl: string | null;
1786
+ cancelUrl: string | null;
1787
+ callbackUrl: string | null;
1788
+ expiresAt: string | null;
1789
+ completedAt: string | null;
1790
+ failedAt: string | null;
1791
+ cancelledAt: string | null;
1792
+ expiredAt: string | null;
1793
+ failureCode: string | null;
1794
+ failureMessage: string | null;
1795
+ notes: string | null;
1796
+ providerPayload: {
1797
+ [x: string]: import("hono/utils/types").JSONValue;
1798
+ } | null;
1799
+ metadata: {
1800
+ [x: string]: import("hono/utils/types").JSONValue;
1801
+ } | null;
1802
+ createdAt: string;
1803
+ updatedAt: string;
1804
+ };
1805
1805
  };
1806
1806
  outputFormat: "json";
1807
- status: 409;
1807
+ status: 201;
1808
1808
  };
1809
1809
  };
1810
1810
  } & {