@voyant-travel/finance 0.119.5
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/LICENSE +201 -0
- package/README.md +192 -0
- package/dist/action-ledger-drift.d.ts +29 -0
- package/dist/action-ledger-drift.d.ts.map +1 -0
- package/dist/action-ledger-drift.js +166 -0
- package/dist/booking-tax.d.ts +124 -0
- package/dist/booking-tax.d.ts.map +1 -0
- package/dist/booking-tax.js +264 -0
- package/dist/checkout-routes.d.ts +1154 -0
- package/dist/checkout-routes.d.ts.map +1 -0
- package/dist/checkout-routes.js +116 -0
- package/dist/checkout-service-plan.d.ts +137 -0
- package/dist/checkout-service-plan.d.ts.map +1 -0
- package/dist/checkout-service-plan.js +119 -0
- package/dist/checkout-service.d.ts +9 -0
- package/dist/checkout-service.d.ts.map +1 -0
- package/dist/checkout-service.js +324 -0
- package/dist/checkout-validation.d.ts +1682 -0
- package/dist/checkout-validation.d.ts.map +1 -0
- package/dist/checkout-validation.js +228 -0
- package/dist/document-download.d.ts +3 -0
- package/dist/document-download.d.ts.map +1 -0
- package/dist/document-download.js +1 -0
- package/dist/fx-money.d.ts +17 -0
- package/dist/fx-money.d.ts.map +1 -0
- package/dist/fx-money.js +194 -0
- package/dist/index.d.ts +65 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +108 -0
- package/dist/invoice-fx.d.ts +134 -0
- package/dist/invoice-fx.d.ts.map +1 -0
- package/dist/invoice-fx.js +240 -0
- package/dist/invoice-number-errors.d.ts +2 -0
- package/dist/invoice-number-errors.d.ts.map +1 -0
- package/dist/invoice-number-errors.js +58 -0
- package/dist/markets-ref.d.ts +149 -0
- package/dist/markets-ref.d.ts.map +1 -0
- package/dist/markets-ref.js +17 -0
- package/dist/payment-link.d.ts +23 -0
- package/dist/payment-link.d.ts.map +1 -0
- package/dist/payment-link.js +30 -0
- package/dist/payment-policy.d.ts +113 -0
- package/dist/payment-policy.d.ts.map +1 -0
- package/dist/payment-policy.js +193 -0
- package/dist/route-runtime.d.ts +22 -0
- package/dist/route-runtime.d.ts.map +1 -0
- package/dist/route-runtime.js +18 -0
- package/dist/routes-action-ledger.d.ts +181 -0
- package/dist/routes-action-ledger.d.ts.map +1 -0
- package/dist/routes-action-ledger.js +142 -0
- package/dist/routes-booking-billing.d.ts +852 -0
- package/dist/routes-booking-billing.d.ts.map +1 -0
- package/dist/routes-booking-billing.js +223 -0
- package/dist/routes-booking-create.d.ts +3 -0
- package/dist/routes-booking-create.d.ts.map +1 -0
- package/dist/routes-booking-create.js +194 -0
- package/dist/routes-booking-reads.d.ts +46 -0
- package/dist/routes-booking-reads.d.ts.map +1 -0
- package/dist/routes-booking-reads.js +20 -0
- package/dist/routes-documents.d.ts +195 -0
- package/dist/routes-documents.d.ts.map +1 -0
- package/dist/routes-documents.js +93 -0
- package/dist/routes-invoice-core.d.ts +794 -0
- package/dist/routes-invoice-core.d.ts.map +1 -0
- package/dist/routes-invoice-core.js +238 -0
- package/dist/routes-invoice-documents.d.ts +401 -0
- package/dist/routes-invoice-documents.d.ts.map +1 -0
- package/dist/routes-invoice-documents.js +91 -0
- package/dist/routes-invoice-issue.d.ts +384 -0
- package/dist/routes-invoice-issue.d.ts.map +1 -0
- package/dist/routes-invoice-issue.js +208 -0
- package/dist/routes-payment-processing.d.ts +1193 -0
- package/dist/routes-payment-processing.d.ts.map +1 -0
- package/dist/routes-payment-processing.js +238 -0
- package/dist/routes-payments.d.ts +309 -0
- package/dist/routes-payments.d.ts.map +1 -0
- package/dist/routes-payments.js +94 -0
- package/dist/routes-public.d.ts +1948 -0
- package/dist/routes-public.d.ts.map +1 -0
- package/dist/routes-public.js +275 -0
- package/dist/routes-reference-data.d.ts +977 -0
- package/dist/routes-reference-data.d.ts.map +1 -0
- package/dist/routes-reference-data.js +191 -0
- package/dist/routes-reports.d.ts +344 -0
- package/dist/routes-reports.d.ts.map +1 -0
- package/dist/routes-reports.js +93 -0
- package/dist/routes-runtime.d.ts +71 -0
- package/dist/routes-runtime.d.ts.map +1 -0
- package/dist/routes-runtime.js +59 -0
- package/dist/routes-settlement.d.ts +67 -0
- package/dist/routes-settlement.d.ts.map +1 -0
- package/dist/routes-settlement.js +23 -0
- package/dist/routes-shared.d.ts +35 -0
- package/dist/routes-shared.d.ts.map +1 -0
- package/dist/routes-shared.js +10 -0
- package/dist/routes-supplier-invoices.d.ts +778 -0
- package/dist/routes-supplier-invoices.d.ts.map +1 -0
- package/dist/routes-supplier-invoices.js +159 -0
- package/dist/routes-vouchers.d.ts +228 -0
- package/dist/routes-vouchers.d.ts.map +1 -0
- package/dist/routes-vouchers.js +54 -0
- package/dist/routes.d.ts +5577 -0
- package/dist/routes.d.ts.map +1 -0
- package/dist/routes.js +44 -0
- package/dist/schema/booking-billing.d.ts +1006 -0
- package/dist/schema/booking-billing.d.ts.map +1 -0
- package/dist/schema/booking-billing.js +106 -0
- package/dist/schema/enums.d.ts +48 -0
- package/dist/schema/enums.d.ts.map +1 -0
- package/dist/schema/enums.js +237 -0
- package/dist/schema/invoice-documents.d.ts +1245 -0
- package/dist/schema/invoice-documents.d.ts.map +1 -0
- package/dist/schema/invoice-documents.js +140 -0
- package/dist/schema/payment-instruments.d.ts +418 -0
- package/dist/schema/payment-instruments.d.ts.map +1 -0
- package/dist/schema/payment-instruments.js +45 -0
- package/dist/schema/payment-processing.d.ts +563 -0
- package/dist/schema/payment-processing.d.ts.map +1 -0
- package/dist/schema/payment-processing.js +65 -0
- package/dist/schema/payment-sessions.d.ts +728 -0
- package/dist/schema/payment-sessions.d.ts.map +1 -0
- package/dist/schema/payment-sessions.js +79 -0
- package/dist/schema/receivables.d.ts +1474 -0
- package/dist/schema/receivables.d.ts.map +1 -0
- package/dist/schema/receivables.js +179 -0
- package/dist/schema/relations.d.ts +82 -0
- package/dist/schema/relations.d.ts.map +1 -0
- package/dist/schema/relations.js +144 -0
- package/dist/schema/supplier-invoices.d.ts +1619 -0
- package/dist/schema/supplier-invoices.d.ts.map +1 -0
- package/dist/schema/supplier-invoices.js +228 -0
- package/dist/schema/tax.d.ts +712 -0
- package/dist/schema/tax.d.ts.map +1 -0
- package/dist/schema/tax.js +98 -0
- package/dist/schema/vouchers.d.ts +444 -0
- package/dist/schema/vouchers.d.ts.map +1 -0
- package/dist/schema/vouchers.js +64 -0
- package/dist/schema.d.ts +12 -0
- package/dist/schema.d.ts.map +1 -0
- package/dist/schema.js +11 -0
- package/dist/service-accountant-shares.d.ts +106 -0
- package/dist/service-accountant-shares.d.ts.map +1 -0
- package/dist/service-accountant-shares.js +331 -0
- package/dist/service-action-ledger-accounting.d.ts +104 -0
- package/dist/service-action-ledger-accounting.d.ts.map +1 -0
- package/dist/service-action-ledger-accounting.js +386 -0
- package/dist/service-action-ledger-booking-payments.d.ts +48 -0
- package/dist/service-action-ledger-booking-payments.d.ts.map +1 -0
- package/dist/service-action-ledger-booking-payments.js +178 -0
- package/dist/service-action-ledger-bookings.d.ts +44 -0
- package/dist/service-action-ledger-bookings.d.ts.map +1 -0
- package/dist/service-action-ledger-bookings.js +81 -0
- package/dist/service-action-ledger-payment-authorizations.d.ts +48 -0
- package/dist/service-action-ledger-payment-authorizations.d.ts.map +1 -0
- package/dist/service-action-ledger-payment-authorizations.js +209 -0
- package/dist/service-action-ledger-payment-sessions.d.ts +83 -0
- package/dist/service-action-ledger-payment-sessions.d.ts.map +1 -0
- package/dist/service-action-ledger-payment-sessions.js +294 -0
- package/dist/service-action-ledger-supplier-invoices.d.ts +27 -0
- package/dist/service-action-ledger-supplier-invoices.d.ts.map +1 -0
- package/dist/service-action-ledger-supplier-invoices.js +111 -0
- package/dist/service-action-ledger-supplier-payments.d.ts +21 -0
- package/dist/service-action-ledger-supplier-payments.d.ts.map +1 -0
- package/dist/service-action-ledger-supplier-payments.js +97 -0
- package/dist/service-action-ledger.d.ts +7 -0
- package/dist/service-action-ledger.d.ts.map +1 -0
- package/dist/service-action-ledger.js +6 -0
- package/dist/service-aggregates.d.ts +96 -0
- package/dist/service-aggregates.d.ts.map +1 -0
- package/dist/service-aggregates.js +294 -0
- package/dist/service-booking-billing.d.ts +2322 -0
- package/dist/service-booking-billing.d.ts.map +1 -0
- package/dist/service-booking-billing.js +8 -0
- package/dist/service-booking-create.d.ts +410 -0
- package/dist/service-booking-create.d.ts.map +1 -0
- package/dist/service-booking-create.js +1256 -0
- package/dist/service-booking-guarantees.d.ts +725 -0
- package/dist/service-booking-guarantees.d.ts.map +1 -0
- package/dist/service-booking-guarantees.js +153 -0
- package/dist/service-booking-item-billing.d.ts +1062 -0
- package/dist/service-booking-item-billing.d.ts.map +1 -0
- package/dist/service-booking-item-billing.js +77 -0
- package/dist/service-booking-payment-schedules.d.ts +557 -0
- package/dist/service-booking-payment-schedules.d.ts.map +1 -0
- package/dist/service-booking-payment-schedules.js +372 -0
- package/dist/service-bookings-dual-create.d.ts +308 -0
- package/dist/service-bookings-dual-create.d.ts.map +1 -0
- package/dist/service-bookings-dual-create.js +131 -0
- package/dist/service-boundary-sql.d.ts +6 -0
- package/dist/service-boundary-sql.d.ts.map +1 -0
- package/dist/service-boundary-sql.js +15 -0
- package/dist/service-cost-categories.d.ts +26 -0
- package/dist/service-cost-categories.d.ts.map +1 -0
- package/dist/service-cost-categories.js +76 -0
- package/dist/service-documents.d.ts +80 -0
- package/dist/service-documents.d.ts.map +1 -0
- package/dist/service-documents.js +228 -0
- package/dist/service-invoice-artifacts.d.ts +246 -0
- package/dist/service-invoice-artifacts.d.ts.map +1 -0
- package/dist/service-invoice-artifacts.js +277 -0
- package/dist/service-invoice-core.d.ts +405 -0
- package/dist/service-invoice-core.d.ts.map +1 -0
- package/dist/service-invoice-core.js +290 -0
- package/dist/service-invoice-credit-notes.d.ts +973 -0
- package/dist/service-invoice-credit-notes.d.ts.map +1 -0
- package/dist/service-invoice-credit-notes.js +142 -0
- package/dist/service-invoice-from-booking.d.ts +41 -0
- package/dist/service-invoice-from-booking.d.ts.map +1 -0
- package/dist/service-invoice-from-booking.js +267 -0
- package/dist/service-invoice-line-items.d.ts +432 -0
- package/dist/service-invoice-line-items.d.ts.map +1 -0
- package/dist/service-invoice-line-items.js +102 -0
- package/dist/service-invoice-numbering.d.ts +227 -0
- package/dist/service-invoice-numbering.d.ts.map +1 -0
- package/dist/service-invoice-numbering.js +260 -0
- package/dist/service-invoice-payments.d.ts +673 -0
- package/dist/service-invoice-payments.d.ts.map +1 -0
- package/dist/service-invoice-payments.js +398 -0
- package/dist/service-invoices.d.ts +2501 -0
- package/dist/service-invoices.d.ts.map +1 -0
- package/dist/service-invoices.js +12 -0
- package/dist/service-issue.d.ts +207 -0
- package/dist/service-issue.d.ts.map +1 -0
- package/dist/service-issue.js +431 -0
- package/dist/service-payment-authorizations.d.ts +164 -0
- package/dist/service-payment-authorizations.d.ts.map +1 -0
- package/dist/service-payment-authorizations.js +227 -0
- package/dist/service-payment-instruments.d.ts +116 -0
- package/dist/service-payment-instruments.d.ts.map +1 -0
- package/dist/service-payment-instruments.js +99 -0
- package/dist/service-payment-processing.d.ts +676 -0
- package/dist/service-payment-processing.d.ts.map +1 -0
- package/dist/service-payment-processing.js +10 -0
- package/dist/service-payment-session-completion.d.ts +48 -0
- package/dist/service-payment-session-completion.d.ts.map +1 -0
- package/dist/service-payment-session-completion.js +238 -0
- package/dist/service-payment-sessions.d.ts +361 -0
- package/dist/service-payment-sessions.d.ts.map +1 -0
- package/dist/service-payment-sessions.js +280 -0
- package/dist/service-profitability.d.ts +114 -0
- package/dist/service-profitability.d.ts.map +1 -0
- package/dist/service-profitability.js +794 -0
- package/dist/service-public.d.ts +553 -0
- package/dist/service-public.d.ts.map +1 -0
- package/dist/service-public.js +583 -0
- package/dist/service-reference-data.d.ts +272 -0
- package/dist/service-reference-data.d.ts.map +1 -0
- package/dist/service-reference-data.js +280 -0
- package/dist/service-rendition-wait.d.ts +38 -0
- package/dist/service-rendition-wait.d.ts.map +1 -0
- package/dist/service-rendition-wait.js +67 -0
- package/dist/service-reports.d.ts +37 -0
- package/dist/service-reports.d.ts.map +1 -0
- package/dist/service-reports.js +62 -0
- package/dist/service-settlement.d.ts +46 -0
- package/dist/service-settlement.d.ts.map +1 -0
- package/dist/service-settlement.js +185 -0
- package/dist/service-shared.d.ts +541 -0
- package/dist/service-shared.d.ts.map +1 -0
- package/dist/service-shared.js +764 -0
- package/dist/service-supplier-invoices.d.ts +871 -0
- package/dist/service-supplier-invoices.d.ts.map +1 -0
- package/dist/service-supplier-invoices.js +744 -0
- package/dist/service-supplier-payments.d.ts +69 -0
- package/dist/service-supplier-payments.d.ts.map +1 -0
- package/dist/service-supplier-payments.js +136 -0
- package/dist/service-vouchers-migration.d.ts +44 -0
- package/dist/service-vouchers-migration.d.ts.map +1 -0
- package/dist/service-vouchers-migration.js +148 -0
- package/dist/service-vouchers.d.ts +157 -0
- package/dist/service-vouchers.d.ts.map +1 -0
- package/dist/service-vouchers.js +191 -0
- package/dist/service.d.ts +6490 -0
- package/dist/service.d.ts.map +1 -0
- package/dist/service.js +29 -0
- package/dist/validation-billing.d.ts +2 -0
- package/dist/validation-billing.d.ts.map +1 -0
- package/dist/validation-billing.js +1 -0
- package/dist/validation-payments.d.ts +2 -0
- package/dist/validation-payments.d.ts.map +1 -0
- package/dist/validation-payments.js +1 -0
- package/dist/validation-public.d.ts +2 -0
- package/dist/validation-public.d.ts.map +1 -0
- package/dist/validation-public.js +1 -0
- package/dist/validation-shared.d.ts +2 -0
- package/dist/validation-shared.d.ts.map +1 -0
- package/dist/validation-shared.js +1 -0
- package/dist/validation-vouchers.d.ts +2 -0
- package/dist/validation-vouchers.d.ts.map +1 -0
- package/dist/validation-vouchers.js +1 -0
- package/dist/validation.d.ts +2 -0
- package/dist/validation.d.ts.map +1 -0
- package/dist/validation.js +1 -0
- package/package.json +121 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"routes-invoice-core.d.ts","sourceRoot":"","sources":["../src/routes-invoice-core.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,oBAAoB,CAAA;AAe7C,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8BA+UjC,CAAA"}
|
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
import { parseJsonBody, parseOptionalJsonBody, requireUserId } from "@voyant-travel/hono";
|
|
2
|
+
import { Hono } from "hono";
|
|
3
|
+
import { getActionLedgerRequestContext, getFinanceRouteRuntime } from "./routes-runtime.js";
|
|
4
|
+
import { financeService, PaymentValidationError } from "./service.js";
|
|
5
|
+
import { createPaymentSessionFromInvoiceSchema, insertCreditNoteLineItemSchema, insertCreditNoteSchema, insertFinanceNoteSchema, insertInvoiceLineItemSchema, insertPaymentSchema, updateCreditNoteSchema, updateInvoiceLineItemSchema, updateInvoiceSchema, voidInvoiceSchema, } from "./validation.js";
|
|
6
|
+
export const financeInvoiceCoreRoutes = new Hono()
|
|
7
|
+
// GET /invoices/:id — Get single invoice // GET /invoices/:id — Get single invoice
|
|
8
|
+
.get("/invoices/:id", async (c) => {
|
|
9
|
+
const row = await financeService.getInvoiceById(c.get("db"), c.req.param("id"));
|
|
10
|
+
if (!row) {
|
|
11
|
+
return c.json({ error: "Invoice not found" }, 404);
|
|
12
|
+
}
|
|
13
|
+
return c.json({ data: row });
|
|
14
|
+
})
|
|
15
|
+
// PATCH /invoices/:id — Update invoice
|
|
16
|
+
.patch("/invoices/:id", async (c) => {
|
|
17
|
+
const runtime = getFinanceRouteRuntime(c);
|
|
18
|
+
const row = await financeService.updateInvoice(c.get("db"), c.req.param("id"), await parseJsonBody(c, updateInvoiceSchema), {
|
|
19
|
+
eventBus: runtime?.eventBus,
|
|
20
|
+
actionLedgerContext: getActionLedgerRequestContext(c),
|
|
21
|
+
actionLedgerAuthorizationSource: "finance.invoice.route",
|
|
22
|
+
});
|
|
23
|
+
if (!row) {
|
|
24
|
+
return c.json({ error: "Invoice not found" }, 404);
|
|
25
|
+
}
|
|
26
|
+
return c.json({ data: row });
|
|
27
|
+
})
|
|
28
|
+
// DELETE /invoices/:id — Delete invoice (draft only)
|
|
29
|
+
.delete("/invoices/:id", async (c) => {
|
|
30
|
+
const runtime = getFinanceRouteRuntime(c);
|
|
31
|
+
const result = await financeService.deleteInvoice(c.get("db"), c.req.param("id"), {
|
|
32
|
+
eventBus: runtime?.eventBus,
|
|
33
|
+
actionLedgerContext: getActionLedgerRequestContext(c),
|
|
34
|
+
actionLedgerAuthorizationSource: "finance.invoice.route",
|
|
35
|
+
});
|
|
36
|
+
if (result.status === "not_found") {
|
|
37
|
+
return c.json({ error: "Invoice not found" }, 404);
|
|
38
|
+
}
|
|
39
|
+
if (result.status === "not_draft") {
|
|
40
|
+
return c.json({ error: "Only draft invoices can be deleted" }, 400);
|
|
41
|
+
}
|
|
42
|
+
return c.json({ success: true }, 200);
|
|
43
|
+
})
|
|
44
|
+
// POST /invoices/:id/void — Void an issued invoice without deleting audit history.
|
|
45
|
+
.post("/invoices/:id/void", async (c) => {
|
|
46
|
+
const runtime = getFinanceRouteRuntime(c);
|
|
47
|
+
const result = await financeService.voidInvoice(c.get("db"), c.req.param("id"), await parseOptionalJsonBody(c, voidInvoiceSchema), {
|
|
48
|
+
eventBus: runtime?.eventBus,
|
|
49
|
+
actionLedgerContext: getActionLedgerRequestContext(c),
|
|
50
|
+
actionLedgerAuthorizationSource: "finance.invoice.route",
|
|
51
|
+
});
|
|
52
|
+
if (result.status === "not_found") {
|
|
53
|
+
return c.json({ error: "Invoice not found" }, 404);
|
|
54
|
+
}
|
|
55
|
+
if (result.status === "already_void") {
|
|
56
|
+
return c.json({ error: "Invoice is already void" }, 409);
|
|
57
|
+
}
|
|
58
|
+
if (result.status === "draft") {
|
|
59
|
+
return c.json({ error: "Draft invoices can be deleted instead" }, 400);
|
|
60
|
+
}
|
|
61
|
+
if (result.status === "invalid_status") {
|
|
62
|
+
return c.json({ error: "Invoice cannot be voided from its current status" }, 409);
|
|
63
|
+
}
|
|
64
|
+
if (result.status === "has_payments") {
|
|
65
|
+
return c.json({ error: "Invoices with payments cannot be voided" }, 409);
|
|
66
|
+
}
|
|
67
|
+
if (result.status === "has_credit_notes") {
|
|
68
|
+
return c.json({ error: "Invoices with credit notes cannot be voided" }, 409);
|
|
69
|
+
}
|
|
70
|
+
return c.json({ data: result.invoice }, 200);
|
|
71
|
+
})
|
|
72
|
+
.post("/invoices/:id/payment-session", async (c) => {
|
|
73
|
+
try {
|
|
74
|
+
const runtime = getFinanceRouteRuntime(c);
|
|
75
|
+
const row = await financeService.createPaymentSessionFromInvoice(c.get("db"), c.req.param("id"), await parseJsonBody(c, createPaymentSessionFromInvoiceSchema), {
|
|
76
|
+
eventBus: runtime?.eventBus,
|
|
77
|
+
actionLedgerContext: getActionLedgerRequestContext(c),
|
|
78
|
+
actionLedgerAuthorizationSource: "finance.payment_session.route",
|
|
79
|
+
});
|
|
80
|
+
if (!row) {
|
|
81
|
+
return c.json({ error: "Invoice not found" }, 404);
|
|
82
|
+
}
|
|
83
|
+
return c.json({ data: row }, 201);
|
|
84
|
+
}
|
|
85
|
+
catch (error) {
|
|
86
|
+
const message = error instanceof Error ? error.message : "Unable to create payment session";
|
|
87
|
+
return c.json({ error: message }, 409);
|
|
88
|
+
}
|
|
89
|
+
})
|
|
90
|
+
// ========================================================================
|
|
91
|
+
// Invoice Line Items
|
|
92
|
+
// ========================================================================
|
|
93
|
+
// GET /invoices/:id/line-items — List line items
|
|
94
|
+
.get("/invoices/:id/line-items", async (c) => {
|
|
95
|
+
return c.json({
|
|
96
|
+
data: await financeService.listInvoiceLineItems(c.get("db"), c.req.param("id")),
|
|
97
|
+
});
|
|
98
|
+
})
|
|
99
|
+
// POST /invoices/:id/line-items — Add line item
|
|
100
|
+
.post("/invoices/:id/line-items", async (c) => {
|
|
101
|
+
const runtime = getFinanceRouteRuntime(c);
|
|
102
|
+
const row = await financeService.createInvoiceLineItem(c.get("db"), c.req.param("id"), await parseJsonBody(c, insertInvoiceLineItemSchema), {
|
|
103
|
+
eventBus: runtime?.eventBus,
|
|
104
|
+
actionLedgerContext: getActionLedgerRequestContext(c),
|
|
105
|
+
actionLedgerAuthorizationSource: "finance.invoice_line_item.route",
|
|
106
|
+
});
|
|
107
|
+
if (!row) {
|
|
108
|
+
return c.json({ error: "Invoice not found" }, 404);
|
|
109
|
+
}
|
|
110
|
+
return c.json({ data: row }, 201);
|
|
111
|
+
})
|
|
112
|
+
// PATCH /invoices/:id/line-items/:lineId — Update line item
|
|
113
|
+
.patch("/invoices/:id/line-items/:lineId", async (c) => {
|
|
114
|
+
const runtime = getFinanceRouteRuntime(c);
|
|
115
|
+
const row = await financeService.updateInvoiceLineItem(c.get("db"), c.req.param("lineId"), await parseJsonBody(c, updateInvoiceLineItemSchema), {
|
|
116
|
+
eventBus: runtime?.eventBus,
|
|
117
|
+
actionLedgerContext: getActionLedgerRequestContext(c),
|
|
118
|
+
actionLedgerAuthorizationSource: "finance.invoice_line_item.route",
|
|
119
|
+
});
|
|
120
|
+
if (!row) {
|
|
121
|
+
return c.json({ error: "Line item not found" }, 404);
|
|
122
|
+
}
|
|
123
|
+
return c.json({ data: row });
|
|
124
|
+
})
|
|
125
|
+
// DELETE /invoices/:id/line-items/:lineId — Delete line item
|
|
126
|
+
.delete("/invoices/:id/line-items/:lineId", async (c) => {
|
|
127
|
+
const runtime = getFinanceRouteRuntime(c);
|
|
128
|
+
const row = await financeService.deleteInvoiceLineItem(c.get("db"), c.req.param("lineId"), {
|
|
129
|
+
eventBus: runtime?.eventBus,
|
|
130
|
+
actionLedgerContext: getActionLedgerRequestContext(c),
|
|
131
|
+
actionLedgerAuthorizationSource: "finance.invoice_line_item.route",
|
|
132
|
+
});
|
|
133
|
+
if (!row) {
|
|
134
|
+
return c.json({ error: "Line item not found" }, 404);
|
|
135
|
+
}
|
|
136
|
+
return c.json({ success: true }, 200);
|
|
137
|
+
})
|
|
138
|
+
// ========================================================================
|
|
139
|
+
// Payments
|
|
140
|
+
// ========================================================================
|
|
141
|
+
// GET /invoices/:id/payments — List payments
|
|
142
|
+
.get("/invoices/:id/payments", async (c) => {
|
|
143
|
+
return c.json({ data: await financeService.listPayments(c.get("db"), c.req.param("id")) });
|
|
144
|
+
})
|
|
145
|
+
// POST /invoices/:id/payments — Record payment (transaction)
|
|
146
|
+
.post("/invoices/:id/payments", async (c) => {
|
|
147
|
+
try {
|
|
148
|
+
const runtime = getFinanceRouteRuntime(c);
|
|
149
|
+
const row = await financeService.createPayment(c.get("db"), c.req.param("id"), await parseJsonBody(c, insertPaymentSchema), {
|
|
150
|
+
...(runtime ?? {}),
|
|
151
|
+
actionLedgerContext: getActionLedgerRequestContext(c),
|
|
152
|
+
actionLedgerAuthorizationSource: "finance.payment.route",
|
|
153
|
+
});
|
|
154
|
+
if (!row) {
|
|
155
|
+
return c.json({ error: "Invoice not found" }, 404);
|
|
156
|
+
}
|
|
157
|
+
return c.json({ data: row }, 201);
|
|
158
|
+
}
|
|
159
|
+
catch (error) {
|
|
160
|
+
if (error instanceof PaymentValidationError) {
|
|
161
|
+
return c.json({ error: error.message, code: error.code, details: error.details }, error.status);
|
|
162
|
+
}
|
|
163
|
+
throw error;
|
|
164
|
+
}
|
|
165
|
+
})
|
|
166
|
+
// ========================================================================
|
|
167
|
+
// Credit Notes
|
|
168
|
+
// ========================================================================
|
|
169
|
+
// GET /invoices/:id/credit-notes — List credit notes
|
|
170
|
+
.get("/invoices/:id/credit-notes", async (c) => {
|
|
171
|
+
return c.json({
|
|
172
|
+
data: await financeService.listCreditNotes(c.get("db"), c.req.param("id")),
|
|
173
|
+
});
|
|
174
|
+
})
|
|
175
|
+
// POST /invoices/:id/credit-notes — Create credit note
|
|
176
|
+
.post("/invoices/:id/credit-notes", async (c) => {
|
|
177
|
+
const runtime = getFinanceRouteRuntime(c);
|
|
178
|
+
const row = await financeService.createCreditNote(c.get("db"), c.req.param("id"), await parseJsonBody(c, insertCreditNoteSchema), {
|
|
179
|
+
...(runtime ?? {}),
|
|
180
|
+
actionLedgerContext: getActionLedgerRequestContext(c),
|
|
181
|
+
actionLedgerAuthorizationSource: "finance.credit_note.route",
|
|
182
|
+
});
|
|
183
|
+
if (!row) {
|
|
184
|
+
return c.json({ error: "Invoice not found" }, 404);
|
|
185
|
+
}
|
|
186
|
+
return c.json({ data: row }, 201);
|
|
187
|
+
})
|
|
188
|
+
// PATCH /invoices/:id/credit-notes/:creditNoteId — Update credit note
|
|
189
|
+
.patch("/invoices/:id/credit-notes/:creditNoteId", async (c) => {
|
|
190
|
+
const runtime = getFinanceRouteRuntime(c);
|
|
191
|
+
const row = await financeService.updateCreditNote(c.get("db"), c.req.param("creditNoteId"), await parseJsonBody(c, updateCreditNoteSchema), {
|
|
192
|
+
...(runtime ?? {}),
|
|
193
|
+
actionLedgerContext: getActionLedgerRequestContext(c),
|
|
194
|
+
actionLedgerAuthorizationSource: "finance.credit_note.route",
|
|
195
|
+
});
|
|
196
|
+
if (!row) {
|
|
197
|
+
return c.json({ error: "Credit note not found" }, 404);
|
|
198
|
+
}
|
|
199
|
+
return c.json({ data: row });
|
|
200
|
+
})
|
|
201
|
+
// ========================================================================
|
|
202
|
+
// Credit Note Line Items
|
|
203
|
+
// ========================================================================
|
|
204
|
+
// GET /invoices/:id/credit-notes/:creditNoteId/line-items — List credit note line items
|
|
205
|
+
.get("/invoices/:id/credit-notes/:creditNoteId/line-items", async (c) => {
|
|
206
|
+
return c.json({
|
|
207
|
+
data: await financeService.listCreditNoteLineItems(c.get("db"), c.req.param("creditNoteId")),
|
|
208
|
+
});
|
|
209
|
+
})
|
|
210
|
+
// POST /invoices/:id/credit-notes/:creditNoteId/line-items — Add credit note line item
|
|
211
|
+
.post("/invoices/:id/credit-notes/:creditNoteId/line-items", async (c) => {
|
|
212
|
+
const runtime = getFinanceRouteRuntime(c);
|
|
213
|
+
const row = await financeService.createCreditNoteLineItem(c.get("db"), c.req.param("creditNoteId"), await parseJsonBody(c, insertCreditNoteLineItemSchema), {
|
|
214
|
+
eventBus: runtime?.eventBus,
|
|
215
|
+
actionLedgerContext: getActionLedgerRequestContext(c),
|
|
216
|
+
actionLedgerAuthorizationSource: "finance.credit_note_line_item.route",
|
|
217
|
+
});
|
|
218
|
+
if (!row) {
|
|
219
|
+
return c.json({ error: "Credit note not found" }, 404);
|
|
220
|
+
}
|
|
221
|
+
return c.json({ data: row }, 201);
|
|
222
|
+
})
|
|
223
|
+
// ========================================================================
|
|
224
|
+
// Finance Notes
|
|
225
|
+
// ========================================================================
|
|
226
|
+
// GET /invoices/:id/notes — List notes
|
|
227
|
+
.get("/invoices/:id/notes", async (c) => {
|
|
228
|
+
return c.json({ data: await financeService.listNotes(c.get("db"), c.req.param("id")) });
|
|
229
|
+
})
|
|
230
|
+
// POST /invoices/:id/notes — Add note
|
|
231
|
+
.post("/invoices/:id/notes", async (c) => {
|
|
232
|
+
const userId = requireUserId(c);
|
|
233
|
+
const row = await financeService.createNote(c.get("db"), c.req.param("id"), userId, await parseJsonBody(c, insertFinanceNoteSchema));
|
|
234
|
+
if (!row) {
|
|
235
|
+
return c.json({ error: "Invoice not found" }, 404);
|
|
236
|
+
}
|
|
237
|
+
return c.json({ data: row }, 201);
|
|
238
|
+
});
|
|
@@ -0,0 +1,401 @@
|
|
|
1
|
+
import type { Env } from "./routes-shared.js";
|
|
2
|
+
export declare const financeInvoiceDocumentRoutes: import("hono/hono-base").HonoBase<Env, {
|
|
3
|
+
"/invoices/:id/renditions": {
|
|
4
|
+
$get: {
|
|
5
|
+
input: {
|
|
6
|
+
param: {
|
|
7
|
+
id: string;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
output: {
|
|
11
|
+
data: {
|
|
12
|
+
id: string;
|
|
13
|
+
invoiceId: string;
|
|
14
|
+
templateId: string | null;
|
|
15
|
+
format: "json" | "html" | "pdf" | "xml";
|
|
16
|
+
status: "failed" | "pending" | "ready" | "stale";
|
|
17
|
+
storageKey: string | null;
|
|
18
|
+
fileSize: number | null;
|
|
19
|
+
checksum: string | null;
|
|
20
|
+
language: string | null;
|
|
21
|
+
errorMessage: string | null;
|
|
22
|
+
generatedAt: string | null;
|
|
23
|
+
metadata: import("hono/utils/types").JSONValue;
|
|
24
|
+
createdAt: string;
|
|
25
|
+
updatedAt: string;
|
|
26
|
+
}[];
|
|
27
|
+
};
|
|
28
|
+
outputFormat: "json";
|
|
29
|
+
status: import("hono/utils/http-status").ContentfulStatusCode;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
} & {
|
|
33
|
+
"/invoices/:id/attachments": {
|
|
34
|
+
$get: {
|
|
35
|
+
input: {
|
|
36
|
+
param: {
|
|
37
|
+
id: string;
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
output: {
|
|
41
|
+
data: {
|
|
42
|
+
id: string;
|
|
43
|
+
invoiceId: string;
|
|
44
|
+
kind: string;
|
|
45
|
+
name: string;
|
|
46
|
+
mimeType: string | null;
|
|
47
|
+
fileSize: number | null;
|
|
48
|
+
storageKey: string | null;
|
|
49
|
+
checksum: string | null;
|
|
50
|
+
metadata: import("hono/utils/types").JSONValue;
|
|
51
|
+
createdAt: string;
|
|
52
|
+
}[];
|
|
53
|
+
};
|
|
54
|
+
outputFormat: "json";
|
|
55
|
+
status: import("hono/utils/http-status").ContentfulStatusCode;
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
} & {
|
|
59
|
+
"/invoices/:id/attachments": {
|
|
60
|
+
$post: {
|
|
61
|
+
input: {
|
|
62
|
+
param: {
|
|
63
|
+
id: string;
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
output: {
|
|
67
|
+
error: string;
|
|
68
|
+
};
|
|
69
|
+
outputFormat: "json";
|
|
70
|
+
status: 404;
|
|
71
|
+
} | {
|
|
72
|
+
input: {
|
|
73
|
+
param: {
|
|
74
|
+
id: string;
|
|
75
|
+
};
|
|
76
|
+
};
|
|
77
|
+
output: {
|
|
78
|
+
data: {
|
|
79
|
+
id: string;
|
|
80
|
+
name: string;
|
|
81
|
+
createdAt: string;
|
|
82
|
+
metadata: import("hono/utils/types").JSONValue;
|
|
83
|
+
invoiceId: string;
|
|
84
|
+
kind: string;
|
|
85
|
+
storageKey: string | null;
|
|
86
|
+
fileSize: number | null;
|
|
87
|
+
checksum: string | null;
|
|
88
|
+
mimeType: string | null;
|
|
89
|
+
};
|
|
90
|
+
};
|
|
91
|
+
outputFormat: "json";
|
|
92
|
+
status: 201;
|
|
93
|
+
};
|
|
94
|
+
};
|
|
95
|
+
} & {
|
|
96
|
+
"/invoices/:id/attachments/:attachmentId": {
|
|
97
|
+
$patch: {
|
|
98
|
+
input: {
|
|
99
|
+
param: {
|
|
100
|
+
id: string;
|
|
101
|
+
} & {
|
|
102
|
+
attachmentId: string;
|
|
103
|
+
};
|
|
104
|
+
};
|
|
105
|
+
output: {
|
|
106
|
+
error: string;
|
|
107
|
+
};
|
|
108
|
+
outputFormat: "json";
|
|
109
|
+
status: 404;
|
|
110
|
+
} | {
|
|
111
|
+
input: {
|
|
112
|
+
param: {
|
|
113
|
+
id: string;
|
|
114
|
+
} & {
|
|
115
|
+
attachmentId: string;
|
|
116
|
+
};
|
|
117
|
+
};
|
|
118
|
+
output: {
|
|
119
|
+
data: {
|
|
120
|
+
id: string;
|
|
121
|
+
invoiceId: string;
|
|
122
|
+
kind: string;
|
|
123
|
+
name: string;
|
|
124
|
+
mimeType: string | null;
|
|
125
|
+
fileSize: number | null;
|
|
126
|
+
storageKey: string | null;
|
|
127
|
+
checksum: string | null;
|
|
128
|
+
metadata: import("hono/utils/types").JSONValue;
|
|
129
|
+
createdAt: string;
|
|
130
|
+
};
|
|
131
|
+
};
|
|
132
|
+
outputFormat: "json";
|
|
133
|
+
status: import("hono/utils/http-status").ContentfulStatusCode;
|
|
134
|
+
};
|
|
135
|
+
};
|
|
136
|
+
} & {
|
|
137
|
+
"/invoice-attachments/:id/download": {
|
|
138
|
+
$get: {
|
|
139
|
+
input: {
|
|
140
|
+
param: {
|
|
141
|
+
id: string;
|
|
142
|
+
};
|
|
143
|
+
};
|
|
144
|
+
output: {
|
|
145
|
+
error: string;
|
|
146
|
+
};
|
|
147
|
+
outputFormat: "json";
|
|
148
|
+
status: 404;
|
|
149
|
+
} | {
|
|
150
|
+
input: {
|
|
151
|
+
param: {
|
|
152
|
+
id: string;
|
|
153
|
+
};
|
|
154
|
+
};
|
|
155
|
+
output: {
|
|
156
|
+
error: string;
|
|
157
|
+
};
|
|
158
|
+
outputFormat: "json";
|
|
159
|
+
status: 501;
|
|
160
|
+
} | {
|
|
161
|
+
input: {
|
|
162
|
+
param: {
|
|
163
|
+
id: string;
|
|
164
|
+
};
|
|
165
|
+
};
|
|
166
|
+
output: undefined;
|
|
167
|
+
outputFormat: "redirect";
|
|
168
|
+
status: 302;
|
|
169
|
+
};
|
|
170
|
+
};
|
|
171
|
+
} & {
|
|
172
|
+
"/invoices/:id/attachments/:attachmentId": {
|
|
173
|
+
$delete: {
|
|
174
|
+
input: {
|
|
175
|
+
param: {
|
|
176
|
+
id: string;
|
|
177
|
+
} & {
|
|
178
|
+
attachmentId: string;
|
|
179
|
+
};
|
|
180
|
+
};
|
|
181
|
+
output: {
|
|
182
|
+
error: string;
|
|
183
|
+
};
|
|
184
|
+
outputFormat: "json";
|
|
185
|
+
status: 404;
|
|
186
|
+
} | {
|
|
187
|
+
input: {
|
|
188
|
+
param: {
|
|
189
|
+
id: string;
|
|
190
|
+
} & {
|
|
191
|
+
attachmentId: string;
|
|
192
|
+
};
|
|
193
|
+
};
|
|
194
|
+
output: {
|
|
195
|
+
success: true;
|
|
196
|
+
};
|
|
197
|
+
outputFormat: "json";
|
|
198
|
+
status: import("hono/utils/http-status").ContentfulStatusCode;
|
|
199
|
+
};
|
|
200
|
+
};
|
|
201
|
+
} & {
|
|
202
|
+
"/invoices/:id/render": {
|
|
203
|
+
$post: {
|
|
204
|
+
input: {
|
|
205
|
+
param: {
|
|
206
|
+
id: string;
|
|
207
|
+
};
|
|
208
|
+
};
|
|
209
|
+
output: {
|
|
210
|
+
error: string;
|
|
211
|
+
};
|
|
212
|
+
outputFormat: "json";
|
|
213
|
+
status: 404;
|
|
214
|
+
} | {
|
|
215
|
+
input: {
|
|
216
|
+
param: {
|
|
217
|
+
id: string;
|
|
218
|
+
};
|
|
219
|
+
};
|
|
220
|
+
output: {
|
|
221
|
+
data: {
|
|
222
|
+
rendition: {
|
|
223
|
+
format: "json" | "html" | "pdf" | "xml";
|
|
224
|
+
id: string;
|
|
225
|
+
createdAt: string;
|
|
226
|
+
updatedAt: string;
|
|
227
|
+
metadata: import("hono/utils/types").JSONValue;
|
|
228
|
+
status: "failed" | "pending" | "ready" | "stale";
|
|
229
|
+
errorMessage: string | null;
|
|
230
|
+
invoiceId: string;
|
|
231
|
+
templateId: string | null;
|
|
232
|
+
language: string | null;
|
|
233
|
+
storageKey: string | null;
|
|
234
|
+
fileSize: number | null;
|
|
235
|
+
checksum: string | null;
|
|
236
|
+
generatedAt: string | null;
|
|
237
|
+
};
|
|
238
|
+
};
|
|
239
|
+
};
|
|
240
|
+
outputFormat: "json";
|
|
241
|
+
status: 202;
|
|
242
|
+
} | {
|
|
243
|
+
input: {
|
|
244
|
+
param: {
|
|
245
|
+
id: string;
|
|
246
|
+
};
|
|
247
|
+
};
|
|
248
|
+
output: {
|
|
249
|
+
data: {
|
|
250
|
+
download: {
|
|
251
|
+
url: string;
|
|
252
|
+
expiresAt: string | null;
|
|
253
|
+
filename: string | null;
|
|
254
|
+
};
|
|
255
|
+
rendition: {
|
|
256
|
+
format: "json" | "html" | "pdf" | "xml";
|
|
257
|
+
id: string;
|
|
258
|
+
createdAt: string;
|
|
259
|
+
updatedAt: string;
|
|
260
|
+
metadata: import("hono/utils/types").JSONValue;
|
|
261
|
+
status: "failed" | "pending" | "ready" | "stale";
|
|
262
|
+
errorMessage: string | null;
|
|
263
|
+
invoiceId: string;
|
|
264
|
+
templateId: string | null;
|
|
265
|
+
language: string | null;
|
|
266
|
+
storageKey: string | null;
|
|
267
|
+
fileSize: number | null;
|
|
268
|
+
checksum: string | null;
|
|
269
|
+
generatedAt: string | null;
|
|
270
|
+
};
|
|
271
|
+
};
|
|
272
|
+
};
|
|
273
|
+
outputFormat: "json";
|
|
274
|
+
status: 201;
|
|
275
|
+
} | {
|
|
276
|
+
input: {
|
|
277
|
+
param: {
|
|
278
|
+
id: string;
|
|
279
|
+
};
|
|
280
|
+
};
|
|
281
|
+
output: {
|
|
282
|
+
data: {
|
|
283
|
+
format: "json" | "html" | "pdf" | "xml";
|
|
284
|
+
id: string;
|
|
285
|
+
createdAt: string;
|
|
286
|
+
updatedAt: string;
|
|
287
|
+
metadata: import("hono/utils/types").JSONValue;
|
|
288
|
+
status: "failed" | "pending" | "ready" | "stale";
|
|
289
|
+
errorMessage: string | null;
|
|
290
|
+
invoiceId: string;
|
|
291
|
+
templateId: string | null;
|
|
292
|
+
language: string | null;
|
|
293
|
+
storageKey: string | null;
|
|
294
|
+
fileSize: number | null;
|
|
295
|
+
checksum: string | null;
|
|
296
|
+
generatedAt: string | null;
|
|
297
|
+
} | null;
|
|
298
|
+
};
|
|
299
|
+
outputFormat: "json";
|
|
300
|
+
status: 201;
|
|
301
|
+
};
|
|
302
|
+
};
|
|
303
|
+
} & {
|
|
304
|
+
"/invoices/:id/external-refs": {
|
|
305
|
+
$get: {
|
|
306
|
+
input: {
|
|
307
|
+
param: {
|
|
308
|
+
id: string;
|
|
309
|
+
};
|
|
310
|
+
};
|
|
311
|
+
output: {
|
|
312
|
+
data: {
|
|
313
|
+
id: string;
|
|
314
|
+
invoiceId: string;
|
|
315
|
+
provider: string;
|
|
316
|
+
externalId: string | null;
|
|
317
|
+
externalNumber: string | null;
|
|
318
|
+
externalUrl: string | null;
|
|
319
|
+
status: string | null;
|
|
320
|
+
metadata: import("hono/utils/types").JSONValue;
|
|
321
|
+
syncedAt: string | null;
|
|
322
|
+
syncError: string | null;
|
|
323
|
+
createdAt: string;
|
|
324
|
+
updatedAt: string;
|
|
325
|
+
}[];
|
|
326
|
+
};
|
|
327
|
+
outputFormat: "json";
|
|
328
|
+
status: import("hono/utils/http-status").ContentfulStatusCode;
|
|
329
|
+
};
|
|
330
|
+
};
|
|
331
|
+
} & {
|
|
332
|
+
"/invoices/:id/external-refs": {
|
|
333
|
+
$post: {
|
|
334
|
+
input: {
|
|
335
|
+
param: {
|
|
336
|
+
id: string;
|
|
337
|
+
};
|
|
338
|
+
};
|
|
339
|
+
output: {
|
|
340
|
+
error: string;
|
|
341
|
+
};
|
|
342
|
+
outputFormat: "json";
|
|
343
|
+
status: 404;
|
|
344
|
+
} | {
|
|
345
|
+
input: {
|
|
346
|
+
param: {
|
|
347
|
+
id: string;
|
|
348
|
+
};
|
|
349
|
+
};
|
|
350
|
+
output: {
|
|
351
|
+
data: {
|
|
352
|
+
id: string;
|
|
353
|
+
createdAt: string;
|
|
354
|
+
updatedAt: string;
|
|
355
|
+
metadata: import("hono/utils/types").JSONValue;
|
|
356
|
+
status: string | null;
|
|
357
|
+
provider: string;
|
|
358
|
+
invoiceId: string;
|
|
359
|
+
externalId: string | null;
|
|
360
|
+
externalNumber: string | null;
|
|
361
|
+
externalUrl: string | null;
|
|
362
|
+
syncedAt: string | null;
|
|
363
|
+
syncError: string | null;
|
|
364
|
+
};
|
|
365
|
+
};
|
|
366
|
+
outputFormat: "json";
|
|
367
|
+
status: 201;
|
|
368
|
+
};
|
|
369
|
+
};
|
|
370
|
+
} & {
|
|
371
|
+
"/invoices/:id/external-refs/:refId": {
|
|
372
|
+
$delete: {
|
|
373
|
+
input: {
|
|
374
|
+
param: {
|
|
375
|
+
id: string;
|
|
376
|
+
} & {
|
|
377
|
+
refId: string;
|
|
378
|
+
};
|
|
379
|
+
};
|
|
380
|
+
output: {
|
|
381
|
+
error: string;
|
|
382
|
+
};
|
|
383
|
+
outputFormat: "json";
|
|
384
|
+
status: 404;
|
|
385
|
+
} | {
|
|
386
|
+
input: {
|
|
387
|
+
param: {
|
|
388
|
+
id: string;
|
|
389
|
+
} & {
|
|
390
|
+
refId: string;
|
|
391
|
+
};
|
|
392
|
+
};
|
|
393
|
+
output: {
|
|
394
|
+
success: true;
|
|
395
|
+
};
|
|
396
|
+
outputFormat: "json";
|
|
397
|
+
status: import("hono/utils/http-status").ContentfulStatusCode;
|
|
398
|
+
};
|
|
399
|
+
};
|
|
400
|
+
}, "/", "/invoices/:id/external-refs/:refId">;
|
|
401
|
+
//# sourceMappingURL=routes-invoice-documents.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"routes-invoice-documents.d.ts","sourceRoot":"","sources":["../src/routes-invoice-documents.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,oBAAoB,CAAA;AAW7C,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6CA6GrC,CAAA"}
|