@voyantjs/finance 0.80.2 → 0.80.3
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.d.ts.map +1 -1
- package/dist/routes.js +10 -4
- package/package.json +9 -9
package/dist/routes.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../src/routes.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AAC7D,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,oBAAoB,CAAA;
|
|
1
|
+
{"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../src/routes.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AAC7D,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,oBAAoB,CAAA;AAiK7C,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wCAqqDtB,CAAA;AAEJ,MAAM,MAAM,aAAa,GAAG,OAAO,aAAa,CAAA;AAChD,MAAM,MAAM,mBAAmB,GAAG,OAAO,mBAAmB,CAAA"}
|
package/dist/routes.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { parseJsonBody, parseQuery, requireUserId } from "@voyantjs/hono";
|
|
1
|
+
import { idempotencyKey, parseJsonBody, parseQuery, requireUserId } from "@voyantjs/hono";
|
|
2
2
|
import { Hono } from "hono";
|
|
3
3
|
import { resolveStoredDocumentDownload } from "./document-download.js";
|
|
4
4
|
import { FINANCE_ROUTE_RUNTIME_CONTAINER_KEY } from "./route-runtime.js";
|
|
@@ -10,6 +10,7 @@ import { agingReportQuerySchema, applyDefaultBookingPaymentPlanSchema, cancelPay
|
|
|
10
10
|
// Finance Routes — method-chained for Hono RPC type inference
|
|
11
11
|
// ==========================================================================
|
|
12
12
|
const DEFAULT_RENDITION_WAIT_TIMEOUT_MS = 30_000;
|
|
13
|
+
const routeIdempotencyKey = (scope, options = {}) => idempotencyKey({ scope, ...options });
|
|
13
14
|
function resolveWaitRequest(body, query) {
|
|
14
15
|
return {
|
|
15
16
|
mode: query.wait ?? body.wait ?? "none",
|
|
@@ -582,13 +583,15 @@ export const financeRoutes = new Hono()
|
|
|
582
583
|
return c.json(await financeService.listInvoices(c.get("db"), query));
|
|
583
584
|
})
|
|
584
585
|
// POST /invoices — Create invoice
|
|
585
|
-
.post("/invoices", async (c) => {
|
|
586
|
+
.post("/invoices", routeIdempotencyKey("POST /v1/admin/finance/invoices"), async (c) => {
|
|
586
587
|
return c.json({
|
|
587
588
|
data: await financeService.createInvoice(c.get("db"), await parseJsonBody(c, insertInvoiceSchema)),
|
|
588
589
|
}, 201);
|
|
589
590
|
})
|
|
590
591
|
// POST /invoices/from-booking — Create + issue invoice/proforma from a booking or schedule row
|
|
591
|
-
.post("/invoices/from-booking",
|
|
592
|
+
.post("/invoices/from-booking", routeIdempotencyKey("POST /v1/admin/finance/invoices/from-booking", {
|
|
593
|
+
fingerprintSearchParams: ["wait", "waitTimeoutMs"],
|
|
594
|
+
}), async (c) => {
|
|
592
595
|
const input = await parseJsonBody(c, invoiceFromBookingSchema);
|
|
593
596
|
const waitRequest = resolveWaitRequest(input, parseQuery(c, invoiceDocumentWaitQuerySchema));
|
|
594
597
|
const db = c.get("db");
|
|
@@ -606,7 +609,10 @@ export const financeRoutes = new Hono()
|
|
|
606
609
|
if (!booking) {
|
|
607
610
|
return c.json({ error: "Booking not found" }, 404);
|
|
608
611
|
}
|
|
609
|
-
const items = await db
|
|
612
|
+
const items = await db
|
|
613
|
+
.select()
|
|
614
|
+
.from(bookingItems)
|
|
615
|
+
.where(eq(bookingItems.bookingId, booking.id));
|
|
610
616
|
const [paymentSchedule] = input.bookingPaymentScheduleId
|
|
611
617
|
? await db
|
|
612
618
|
.select()
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@voyantjs/finance",
|
|
3
|
-
"version": "0.80.
|
|
3
|
+
"version": "0.80.3",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -59,14 +59,14 @@
|
|
|
59
59
|
"drizzle-orm": "^0.45.2",
|
|
60
60
|
"hono": "^4.12.10",
|
|
61
61
|
"zod": "^4.3.6",
|
|
62
|
-
"@voyantjs/action-ledger": "0.80.
|
|
63
|
-
"@voyantjs/bookings": "0.80.
|
|
64
|
-
"@voyantjs/core": "0.80.
|
|
65
|
-
"@voyantjs/db": "0.80.
|
|
66
|
-
"@voyantjs/hono": "0.80.
|
|
67
|
-
"@voyantjs/products": "0.80.
|
|
68
|
-
"@voyantjs/utils": "0.80.
|
|
69
|
-
"@voyantjs/storage": "0.80.
|
|
62
|
+
"@voyantjs/action-ledger": "0.80.3",
|
|
63
|
+
"@voyantjs/bookings": "0.80.3",
|
|
64
|
+
"@voyantjs/core": "0.80.3",
|
|
65
|
+
"@voyantjs/db": "0.80.3",
|
|
66
|
+
"@voyantjs/hono": "0.80.3",
|
|
67
|
+
"@voyantjs/products": "0.80.3",
|
|
68
|
+
"@voyantjs/utils": "0.80.3",
|
|
69
|
+
"@voyantjs/storage": "0.80.3"
|
|
70
70
|
},
|
|
71
71
|
"devDependencies": {
|
|
72
72
|
"typescript": "^6.0.2",
|