@voyant-travel/finance 0.130.0 → 0.131.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/routes-invoice-issue.d.ts +0 -127
- package/dist/routes-invoice-issue.d.ts.map +1 -1
- package/dist/routes-invoice-issue.js +5 -40
- package/dist/routes-runtime.d.ts +17 -1
- package/dist/routes-runtime.d.ts.map +1 -1
- package/dist/routes-runtime.js +4 -2
- package/dist/routes-shared.d.ts +2 -1
- package/dist/routes-shared.d.ts.map +1 -1
- package/dist/routes.d.ts +0 -127
- package/dist/routes.d.ts.map +1 -1
- package/package.json +2 -2
|
@@ -178,133 +178,6 @@ export declare const financeInvoiceIssueRoutes: import("hono/hono-base").HonoBas
|
|
|
178
178
|
};
|
|
179
179
|
outputFormat: "json";
|
|
180
180
|
status: 201;
|
|
181
|
-
} | {
|
|
182
|
-
input: {};
|
|
183
|
-
output: {
|
|
184
|
-
data: {
|
|
185
|
-
invoice: {
|
|
186
|
-
id: string;
|
|
187
|
-
status: "draft" | "pending_external_allocation" | "issued" | "partially_paid" | "paid" | "overdue" | "void";
|
|
188
|
-
organizationId: string | null;
|
|
189
|
-
createdAt: string;
|
|
190
|
-
personId: string | null;
|
|
191
|
-
notes: string | null;
|
|
192
|
-
updatedAt: string;
|
|
193
|
-
invoiceNumber: string;
|
|
194
|
-
invoiceType: "invoice" | "proforma" | "credit_note";
|
|
195
|
-
convertedFromInvoiceId: string | null;
|
|
196
|
-
seriesId: string | null;
|
|
197
|
-
sequence: number | null;
|
|
198
|
-
templateId: string | null;
|
|
199
|
-
taxRegimeId: string | null;
|
|
200
|
-
language: string | null;
|
|
201
|
-
bookingId: string;
|
|
202
|
-
currency: string;
|
|
203
|
-
baseCurrency: string | null;
|
|
204
|
-
fxRateSetId: string | null;
|
|
205
|
-
subtotalCents: number;
|
|
206
|
-
baseSubtotalCents: number | null;
|
|
207
|
-
taxCents: number;
|
|
208
|
-
baseTaxCents: number | null;
|
|
209
|
-
totalCents: number;
|
|
210
|
-
baseTotalCents: number | null;
|
|
211
|
-
paidCents: number;
|
|
212
|
-
basePaidCents: number | null;
|
|
213
|
-
balanceDueCents: number;
|
|
214
|
-
baseBalanceDueCents: number | null;
|
|
215
|
-
commissionPercent: number | null;
|
|
216
|
-
commissionAmountCents: number | null;
|
|
217
|
-
issueDate: string;
|
|
218
|
-
dueDate: string;
|
|
219
|
-
voidedAt: string | null;
|
|
220
|
-
voidReason: string | null;
|
|
221
|
-
};
|
|
222
|
-
rendition: {
|
|
223
|
-
format: "json" | "html" | "pdf" | "xml";
|
|
224
|
-
id: string;
|
|
225
|
-
status: "failed" | "pending" | "ready" | "stale";
|
|
226
|
-
createdAt: string;
|
|
227
|
-
metadata: import("hono/utils/types").JSONValue;
|
|
228
|
-
updatedAt: string;
|
|
229
|
-
templateId: string | null;
|
|
230
|
-
language: string | null;
|
|
231
|
-
invoiceId: string;
|
|
232
|
-
storageKey: string | null;
|
|
233
|
-
fileSize: number | null;
|
|
234
|
-
checksum: string | null;
|
|
235
|
-
errorMessage: string | null;
|
|
236
|
-
generatedAt: string | null;
|
|
237
|
-
} | null;
|
|
238
|
-
};
|
|
239
|
-
};
|
|
240
|
-
outputFormat: "json";
|
|
241
|
-
status: 202;
|
|
242
|
-
} | {
|
|
243
|
-
input: {};
|
|
244
|
-
output: {
|
|
245
|
-
data: {
|
|
246
|
-
download: {
|
|
247
|
-
url: string;
|
|
248
|
-
expiresAt: string | null;
|
|
249
|
-
filename: string | null;
|
|
250
|
-
};
|
|
251
|
-
invoice: {
|
|
252
|
-
id: string;
|
|
253
|
-
status: "draft" | "pending_external_allocation" | "issued" | "partially_paid" | "paid" | "overdue" | "void";
|
|
254
|
-
organizationId: string | null;
|
|
255
|
-
createdAt: string;
|
|
256
|
-
personId: string | null;
|
|
257
|
-
notes: string | null;
|
|
258
|
-
updatedAt: string;
|
|
259
|
-
invoiceNumber: string;
|
|
260
|
-
invoiceType: "invoice" | "proforma" | "credit_note";
|
|
261
|
-
convertedFromInvoiceId: string | null;
|
|
262
|
-
seriesId: string | null;
|
|
263
|
-
sequence: number | null;
|
|
264
|
-
templateId: string | null;
|
|
265
|
-
taxRegimeId: string | null;
|
|
266
|
-
language: string | null;
|
|
267
|
-
bookingId: string;
|
|
268
|
-
currency: string;
|
|
269
|
-
baseCurrency: string | null;
|
|
270
|
-
fxRateSetId: string | null;
|
|
271
|
-
subtotalCents: number;
|
|
272
|
-
baseSubtotalCents: number | null;
|
|
273
|
-
taxCents: number;
|
|
274
|
-
baseTaxCents: number | null;
|
|
275
|
-
totalCents: number;
|
|
276
|
-
baseTotalCents: number | null;
|
|
277
|
-
paidCents: number;
|
|
278
|
-
basePaidCents: number | null;
|
|
279
|
-
balanceDueCents: number;
|
|
280
|
-
baseBalanceDueCents: number | null;
|
|
281
|
-
commissionPercent: number | null;
|
|
282
|
-
commissionAmountCents: number | null;
|
|
283
|
-
issueDate: string;
|
|
284
|
-
dueDate: string;
|
|
285
|
-
voidedAt: string | null;
|
|
286
|
-
voidReason: string | null;
|
|
287
|
-
};
|
|
288
|
-
rendition: {
|
|
289
|
-
format: "json" | "html" | "pdf" | "xml";
|
|
290
|
-
id: string;
|
|
291
|
-
status: "failed" | "pending" | "ready" | "stale";
|
|
292
|
-
createdAt: string;
|
|
293
|
-
metadata: import("hono/utils/types").JSONValue;
|
|
294
|
-
updatedAt: string;
|
|
295
|
-
templateId: string | null;
|
|
296
|
-
language: string | null;
|
|
297
|
-
invoiceId: string;
|
|
298
|
-
storageKey: string | null;
|
|
299
|
-
fileSize: number | null;
|
|
300
|
-
checksum: string | null;
|
|
301
|
-
errorMessage: string | null;
|
|
302
|
-
generatedAt: string | null;
|
|
303
|
-
} | null;
|
|
304
|
-
};
|
|
305
|
-
};
|
|
306
|
-
outputFormat: "json";
|
|
307
|
-
status: 201;
|
|
308
181
|
};
|
|
309
182
|
};
|
|
310
183
|
} & {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"routes-invoice-issue.d.ts","sourceRoot":"","sources":["../src/routes-invoice-issue.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"routes-invoice-issue.d.ts","sourceRoot":"","sources":["../src/routes-invoice-issue.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,oBAAoB,CAAA;AAa7C,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2CAkOlC,CAAA"}
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import { parseJsonBody, parseQuery } from "@voyant-travel/hono";
|
|
2
2
|
import { Hono } from "hono";
|
|
3
|
-
import {
|
|
4
|
-
import { buildInlineDownload, getActionLedgerRequestContext, resolveWaitRequest, routeIdempotencyKey, } from "./routes-runtime.js";
|
|
3
|
+
import { getActionLedgerRequestContext, getFinanceRouteRuntime, routeIdempotencyKey, } from "./routes-runtime.js";
|
|
5
4
|
import { financeService, InvoiceFromBookingValidationError, InvoiceNumberAllocationError, InvoiceNumberConflictError, } from "./service.js";
|
|
6
|
-
import {
|
|
7
|
-
import { insertInvoiceSchema, invoiceDocumentWaitQuerySchema, invoiceFromBookingSchema, invoiceListQuerySchema, } from "./validation.js";
|
|
5
|
+
import { insertInvoiceSchema, invoiceFromBookingSchema, invoiceListQuerySchema, } from "./validation.js";
|
|
8
6
|
export const financeInvoiceIssueRoutes = new Hono()
|
|
9
7
|
// ========================================================================
|
|
10
8
|
// Invoices CRUD
|
|
@@ -25,7 +23,6 @@ export const financeInvoiceIssueRoutes = new Hono()
|
|
|
25
23
|
fingerprintSearchParams: ["wait", "waitTimeoutMs"],
|
|
26
24
|
}), async (c) => {
|
|
27
25
|
const input = await parseJsonBody(c, invoiceFromBookingSchema);
|
|
28
|
-
const waitRequest = resolveWaitRequest(input, parseQuery(c, invoiceDocumentWaitQuerySchema));
|
|
29
26
|
const db = c.get("db");
|
|
30
27
|
const [{ bookingItems, bookings }, { bookingPaymentSchedules }, { and, asc, eq }, { issueInvoiceFromBooking, issueProformaFromBooking },] = await Promise.all([
|
|
31
28
|
import("@voyant-travel/bookings/schema"),
|
|
@@ -56,14 +53,7 @@ export const financeInvoiceIssueRoutes = new Hono()
|
|
|
56
53
|
if (input.bookingPaymentScheduleId && !paymentSchedule) {
|
|
57
54
|
return c.json({ error: "Booking payment schedule not found" }, 404);
|
|
58
55
|
}
|
|
59
|
-
const runtime = (
|
|
60
|
-
try {
|
|
61
|
-
return c.var.container?.resolve(FINANCE_ROUTE_RUNTIME_CONTAINER_KEY);
|
|
62
|
-
}
|
|
63
|
-
catch {
|
|
64
|
-
return undefined;
|
|
65
|
-
}
|
|
66
|
-
})();
|
|
56
|
+
const runtime = getFinanceRouteRuntime(c);
|
|
67
57
|
const issuer = input.invoiceType === "proforma" ? issueProformaFromBooking : issueInvoiceFromBooking;
|
|
68
58
|
let row;
|
|
69
59
|
try {
|
|
@@ -132,25 +122,7 @@ export const financeInvoiceIssueRoutes = new Hono()
|
|
|
132
122
|
}
|
|
133
123
|
throw error;
|
|
134
124
|
}
|
|
135
|
-
|
|
136
|
-
return c.json({ data: row }, 201);
|
|
137
|
-
}
|
|
138
|
-
const waitResult = await waitForInvoiceRendition(db, row.id, {
|
|
139
|
-
format: waitFormatForMode(waitRequest.mode),
|
|
140
|
-
timeoutMs: waitRequest.timeoutMs,
|
|
141
|
-
});
|
|
142
|
-
const payload = {
|
|
143
|
-
invoice: row,
|
|
144
|
-
rendition: waitResult.rendition,
|
|
145
|
-
};
|
|
146
|
-
if (waitResult.status !== "ready") {
|
|
147
|
-
return c.json({ data: payload }, 202);
|
|
148
|
-
}
|
|
149
|
-
const download = await buildInlineDownload(c, waitResult.rendition);
|
|
150
|
-
if (download.status !== "ready") {
|
|
151
|
-
return c.json({ data: payload }, 202);
|
|
152
|
-
}
|
|
153
|
-
return c.json({ data: { ...payload, download: download.download } }, 201);
|
|
125
|
+
return c.json({ data: row }, 201);
|
|
154
126
|
})
|
|
155
127
|
// POST /invoices/:id/convert-to-invoice — Convert a proforma into a final invoice
|
|
156
128
|
.post("/invoices/:id/convert-to-invoice", async (c) => {
|
|
@@ -158,14 +130,7 @@ export const financeInvoiceIssueRoutes = new Hono()
|
|
|
158
130
|
const input = await c.req
|
|
159
131
|
.json()
|
|
160
132
|
.catch(() => ({}));
|
|
161
|
-
const runtime = (
|
|
162
|
-
try {
|
|
163
|
-
return c.var.container?.resolve(FINANCE_ROUTE_RUNTIME_CONTAINER_KEY);
|
|
164
|
-
}
|
|
165
|
-
catch {
|
|
166
|
-
return undefined;
|
|
167
|
-
}
|
|
168
|
-
})();
|
|
133
|
+
const runtime = getFinanceRouteRuntime(c);
|
|
169
134
|
let result;
|
|
170
135
|
try {
|
|
171
136
|
result = await convertProformaToInvoice(c.get("db"), c.req.param("id"), input, {
|
package/dist/routes-runtime.d.ts
CHANGED
|
@@ -30,6 +30,7 @@ export declare const routeIdempotencyKey: (scope: string, options?: {
|
|
|
30
30
|
workflowStepId?: string;
|
|
31
31
|
isInternalRequest?: boolean;
|
|
32
32
|
container?: import("@voyant-travel/core").ModuleContainer;
|
|
33
|
+
eventBus?: import("@voyant-travel/core").EventBus;
|
|
33
34
|
};
|
|
34
35
|
}>;
|
|
35
36
|
export declare function resolveWaitRequest(body: {
|
|
@@ -52,7 +53,22 @@ export declare function getFinanceRouteRuntime(c: {
|
|
|
52
53
|
resolve: <T>(key: string) => T;
|
|
53
54
|
};
|
|
54
55
|
};
|
|
55
|
-
|
|
56
|
+
get?: (key: "eventBus") => FinanceRouteRuntime["eventBus"] | undefined;
|
|
57
|
+
}): FinanceRouteRuntime | {
|
|
58
|
+
eventBus: import("@voyant-travel/core").EventBus;
|
|
59
|
+
invoiceDocumentGenerator?: import("./routes-documents.js").InvoiceDocumentGenerator;
|
|
60
|
+
resolveDocumentDownloadUrl?: import("./routes-documents.js").FinanceDocumentRouteOptions["resolveDocumentDownloadUrl"];
|
|
61
|
+
invoiceSettlementPollers?: Record<string, import("./service-settlement.js").InvoiceSettlementPoller> | undefined;
|
|
62
|
+
descriptionResolver?: import("./service-shared.js").InvoiceLineDescriptionResolver;
|
|
63
|
+
invoiceDueDateResolver?: import("./service-shared.js").InvoiceDueDateResolver;
|
|
64
|
+
paymentScheduleLineDescriptionFormat?: import("./service-shared.js").PaymentScheduleLineDescriptionFormat;
|
|
65
|
+
invoiceFxSettings?: import("./invoice-fx.js").InvoiceFxSettings | null;
|
|
66
|
+
resolveInvoiceFxSettings?: import("./invoice-fx.js").ResolveInvoiceFxSettings;
|
|
67
|
+
updateInvoiceFxSettings?: import("./invoice-fx.js").UpdateInvoiceFxSettings;
|
|
68
|
+
resolveInvoiceExchangeRate?: import("./invoice-fx.js").ResolveInvoiceExchangeRate;
|
|
69
|
+
resolveInvoiceExchangeRateResolver?: (bindings: Record<string, unknown>) => import("./invoice-fx.js").ResolveInvoiceExchangeRate | undefined;
|
|
70
|
+
onInvoiceFxResolutionError?: import("./invoice-fx.js").HandleInvoiceFxResolutionError;
|
|
71
|
+
} | undefined;
|
|
56
72
|
export declare function getActionLedgerRequestContext(c: Context<Env>): {
|
|
57
73
|
userId: string | null;
|
|
58
74
|
agentId: string | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"routes-runtime.d.ts","sourceRoot":"","sources":["../src/routes-runtime.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAA;AAGnC,OAAO,EAAuC,KAAK,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AAClG,OAAO,KAAK,EAAE,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AI,CAAC;IAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;CAAE,qEAO9D;AAED,wBAAgB,sBAAsB,CAAC,CAAC,EAAE;IACxC,GAAG,EAAE;QAAE,SAAS,CAAC,EAAE;YAAE,OAAO,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC,CAAA;SAAE,CAAA;KAAE,CAAA;IACvD,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,UAAU,KAAK,mBAAmB,CAAC,UAAU,CAAC,GAAG,SAAS,CAAA;CACvE;;;;;;;;;;;;;;cAUA;AAED,wBAAgB,6BAA6B,CAAC,CAAC,EAAE,OAAO,CAAC,GAAG,CAAC;;;;;;;;;;;;;;cA4B5D"}
|
package/dist/routes-runtime.js
CHANGED
|
@@ -25,11 +25,13 @@ export async function buildInlineDownload(c, reference) {
|
|
|
25
25
|
});
|
|
26
26
|
}
|
|
27
27
|
export function getFinanceRouteRuntime(c) {
|
|
28
|
+
const eventBus = c.get?.("eventBus");
|
|
28
29
|
try {
|
|
29
|
-
|
|
30
|
+
const runtime = c.var.container?.resolve(FINANCE_ROUTE_RUNTIME_CONTAINER_KEY);
|
|
31
|
+
return eventBus ? { ...(runtime ?? {}), eventBus } : runtime;
|
|
30
32
|
}
|
|
31
33
|
catch {
|
|
32
|
-
return undefined;
|
|
34
|
+
return eventBus ? { invoiceSettlementPollers: {}, eventBus } : undefined;
|
|
33
35
|
}
|
|
34
36
|
}
|
|
35
37
|
export function getActionLedgerRequestContext(c) {
|
package/dist/routes-shared.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ModuleContainer } from "@voyant-travel/core";
|
|
1
|
+
import type { EventBus, ModuleContainer } from "@voyant-travel/core";
|
|
2
2
|
import type { PostgresJsDatabase } from "drizzle-orm/postgres-js";
|
|
3
3
|
import type { Context } from "hono";
|
|
4
4
|
export type Env = {
|
|
@@ -26,6 +26,7 @@ export type Env = {
|
|
|
26
26
|
workflowStepId?: string;
|
|
27
27
|
isInternalRequest?: boolean;
|
|
28
28
|
container?: ModuleContainer;
|
|
29
|
+
eventBus?: EventBus;
|
|
29
30
|
};
|
|
30
31
|
};
|
|
31
32
|
export declare function getRuntimeEnv(c: Context): any;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"routes-shared.d.ts","sourceRoot":"","sources":["../src/routes-shared.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;
|
|
1
|
+
{"version":3,"file":"routes-shared.d.ts","sourceRoot":"","sources":["../src/routes-shared.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AACpE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AACjE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAA;AAEnC,MAAM,MAAM,GAAG,GAAG;IAChB,QAAQ,EAAE,OAAO,CAAC;QAChB,iCAAiC,EAAE,MAAM,CAAA;QACzC,0BAA0B,EAAE,MAAM,CAAA;QAClC,sCAAsC,EAAE,MAAM,CAAA;QAC9C,+BAA+B,EAAE,MAAM,CAAA;QACvC,qBAAqB,EAAE,MAAM,CAAA;QAC7B,kBAAkB,EAAE,MAAM,CAAA;KAC3B,CAAC,CAAA;IACF,SAAS,EAAE;QACT,EAAE,EAAE,kBAAkB,CAAA;QACtB,MAAM,CAAC,EAAE,MAAM,CAAA;QACf,OAAO,CAAC,EAAE,MAAM,CAAA;QAChB,mBAAmB,CAAC,EAAE,MAAM,CAAA;QAC5B,gBAAgB,CAAC,EAAE,MAAM,CAAA;QACzB,SAAS,CAAC,EAAE,MAAM,CAAA;QAClB,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;QAC9B,UAAU,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,UAAU,GAAG,OAAO,GAAG,UAAU,CAAA;QACtE,KAAK,CAAC,EAAE,MAAM,CAAA;QACd,UAAU,CAAC,EAAE,MAAM,CAAA;QACnB,QAAQ,CAAC,EAAE,MAAM,CAAA;QACjB,aAAa,CAAC,EAAE,MAAM,CAAA;QACtB,cAAc,CAAC,EAAE,MAAM,CAAA;QACvB,iBAAiB,CAAC,EAAE,OAAO,CAAA;QAC3B,SAAS,CAAC,EAAE,eAAe,CAAA;QAC3B,QAAQ,CAAC,EAAE,QAAQ,CAAA;KACpB,CAAA;CACF,CAAA;AAED,wBAAgB,aAAa,CAAC,CAAC,EAAE,OAAO,OAYvC;AAED,wBAAgB,QAAQ,CAAC,CAAC,SAAS,GAAG,EAAE,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM;;gBAEnE"}
|
package/dist/routes.d.ts
CHANGED
|
@@ -2938,133 +2938,6 @@ export declare const financeRoutes: import("hono/hono-base").HonoBase<Env, {
|
|
|
2938
2938
|
};
|
|
2939
2939
|
outputFormat: "json";
|
|
2940
2940
|
status: 201;
|
|
2941
|
-
} | {
|
|
2942
|
-
input: {};
|
|
2943
|
-
output: {
|
|
2944
|
-
data: {
|
|
2945
|
-
invoice: {
|
|
2946
|
-
id: string;
|
|
2947
|
-
status: "draft" | "pending_external_allocation" | "issued" | "partially_paid" | "paid" | "overdue" | "void";
|
|
2948
|
-
organizationId: string | null;
|
|
2949
|
-
createdAt: string;
|
|
2950
|
-
personId: string | null;
|
|
2951
|
-
notes: string | null;
|
|
2952
|
-
updatedAt: string;
|
|
2953
|
-
invoiceNumber: string;
|
|
2954
|
-
invoiceType: "invoice" | "proforma" | "credit_note";
|
|
2955
|
-
convertedFromInvoiceId: string | null;
|
|
2956
|
-
seriesId: string | null;
|
|
2957
|
-
sequence: number | null;
|
|
2958
|
-
templateId: string | null;
|
|
2959
|
-
taxRegimeId: string | null;
|
|
2960
|
-
language: string | null;
|
|
2961
|
-
bookingId: string;
|
|
2962
|
-
currency: string;
|
|
2963
|
-
baseCurrency: string | null;
|
|
2964
|
-
fxRateSetId: string | null;
|
|
2965
|
-
subtotalCents: number;
|
|
2966
|
-
baseSubtotalCents: number | null;
|
|
2967
|
-
taxCents: number;
|
|
2968
|
-
baseTaxCents: number | null;
|
|
2969
|
-
totalCents: number;
|
|
2970
|
-
baseTotalCents: number | null;
|
|
2971
|
-
paidCents: number;
|
|
2972
|
-
basePaidCents: number | null;
|
|
2973
|
-
balanceDueCents: number;
|
|
2974
|
-
baseBalanceDueCents: number | null;
|
|
2975
|
-
commissionPercent: number | null;
|
|
2976
|
-
commissionAmountCents: number | null;
|
|
2977
|
-
issueDate: string;
|
|
2978
|
-
dueDate: string;
|
|
2979
|
-
voidedAt: string | null;
|
|
2980
|
-
voidReason: string | null;
|
|
2981
|
-
};
|
|
2982
|
-
rendition: {
|
|
2983
|
-
format: "json" | "html" | "pdf" | "xml";
|
|
2984
|
-
id: string;
|
|
2985
|
-
status: "failed" | "pending" | "ready" | "stale";
|
|
2986
|
-
createdAt: string;
|
|
2987
|
-
metadata: import("hono/utils/types").JSONValue;
|
|
2988
|
-
updatedAt: string;
|
|
2989
|
-
templateId: string | null;
|
|
2990
|
-
language: string | null;
|
|
2991
|
-
invoiceId: string;
|
|
2992
|
-
storageKey: string | null;
|
|
2993
|
-
fileSize: number | null;
|
|
2994
|
-
checksum: string | null;
|
|
2995
|
-
errorMessage: string | null;
|
|
2996
|
-
generatedAt: string | null;
|
|
2997
|
-
} | null;
|
|
2998
|
-
};
|
|
2999
|
-
};
|
|
3000
|
-
outputFormat: "json";
|
|
3001
|
-
status: 202;
|
|
3002
|
-
} | {
|
|
3003
|
-
input: {};
|
|
3004
|
-
output: {
|
|
3005
|
-
data: {
|
|
3006
|
-
download: {
|
|
3007
|
-
url: string;
|
|
3008
|
-
expiresAt: string | null;
|
|
3009
|
-
filename: string | null;
|
|
3010
|
-
};
|
|
3011
|
-
invoice: {
|
|
3012
|
-
id: string;
|
|
3013
|
-
status: "draft" | "pending_external_allocation" | "issued" | "partially_paid" | "paid" | "overdue" | "void";
|
|
3014
|
-
organizationId: string | null;
|
|
3015
|
-
createdAt: string;
|
|
3016
|
-
personId: string | null;
|
|
3017
|
-
notes: string | null;
|
|
3018
|
-
updatedAt: string;
|
|
3019
|
-
invoiceNumber: string;
|
|
3020
|
-
invoiceType: "invoice" | "proforma" | "credit_note";
|
|
3021
|
-
convertedFromInvoiceId: string | null;
|
|
3022
|
-
seriesId: string | null;
|
|
3023
|
-
sequence: number | null;
|
|
3024
|
-
templateId: string | null;
|
|
3025
|
-
taxRegimeId: string | null;
|
|
3026
|
-
language: string | null;
|
|
3027
|
-
bookingId: string;
|
|
3028
|
-
currency: string;
|
|
3029
|
-
baseCurrency: string | null;
|
|
3030
|
-
fxRateSetId: string | null;
|
|
3031
|
-
subtotalCents: number;
|
|
3032
|
-
baseSubtotalCents: number | null;
|
|
3033
|
-
taxCents: number;
|
|
3034
|
-
baseTaxCents: number | null;
|
|
3035
|
-
totalCents: number;
|
|
3036
|
-
baseTotalCents: number | null;
|
|
3037
|
-
paidCents: number;
|
|
3038
|
-
basePaidCents: number | null;
|
|
3039
|
-
balanceDueCents: number;
|
|
3040
|
-
baseBalanceDueCents: number | null;
|
|
3041
|
-
commissionPercent: number | null;
|
|
3042
|
-
commissionAmountCents: number | null;
|
|
3043
|
-
issueDate: string;
|
|
3044
|
-
dueDate: string;
|
|
3045
|
-
voidedAt: string | null;
|
|
3046
|
-
voidReason: string | null;
|
|
3047
|
-
};
|
|
3048
|
-
rendition: {
|
|
3049
|
-
format: "json" | "html" | "pdf" | "xml";
|
|
3050
|
-
id: string;
|
|
3051
|
-
status: "failed" | "pending" | "ready" | "stale";
|
|
3052
|
-
createdAt: string;
|
|
3053
|
-
metadata: import("hono/utils/types").JSONValue;
|
|
3054
|
-
updatedAt: string;
|
|
3055
|
-
templateId: string | null;
|
|
3056
|
-
language: string | null;
|
|
3057
|
-
invoiceId: string;
|
|
3058
|
-
storageKey: string | null;
|
|
3059
|
-
fileSize: number | null;
|
|
3060
|
-
checksum: string | null;
|
|
3061
|
-
errorMessage: string | null;
|
|
3062
|
-
generatedAt: string | null;
|
|
3063
|
-
} | null;
|
|
3064
|
-
};
|
|
3065
|
-
};
|
|
3066
|
-
outputFormat: "json";
|
|
3067
|
-
status: 201;
|
|
3068
2941
|
};
|
|
3069
2942
|
};
|
|
3070
2943
|
} & {
|
package/dist/routes.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../src/routes.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AAI7D,OAAO,EAAE,6BAA6B,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAA;AAE3F,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,oBAAoB,CAAA;AAU7C,eAAO,MAAM,aAAa
|
|
1
|
+
{"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../src/routes.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AAI7D,OAAO,EAAE,6BAA6B,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAA;AAE3F,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,oBAAoB,CAAA;AAU7C,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;4BAwBa,CAAA;AAEvC,MAAM,MAAM,aAAa,GAAG,OAAO,aAAa,CAAA;AAChD,MAAM,MAAM,mBAAmB,GAAG,OAAO,mBAAmB,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@voyant-travel/finance",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.131.1",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -92,7 +92,7 @@
|
|
|
92
92
|
"hono": "^4.12.10",
|
|
93
93
|
"zod": "^4.3.6",
|
|
94
94
|
"@voyant-travel/action-ledger": "^0.105.3",
|
|
95
|
-
"@voyant-travel/bookings": "^0.
|
|
95
|
+
"@voyant-travel/bookings": "^0.131.0",
|
|
96
96
|
"@voyant-travel/core": "^0.110.0",
|
|
97
97
|
"@voyant-travel/db": "^0.108.4",
|
|
98
98
|
"@voyant-travel/finance-contracts": "^0.104.6",
|