@voyantjs/finance 0.6.9 → 0.8.0
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/index.d.ts +9 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -1
- package/dist/routes-bookings-quick-create.d.ts +3 -0
- package/dist/routes-bookings-quick-create.d.ts.map +1 -0
- package/dist/routes-bookings-quick-create.js +103 -0
- package/dist/routes-public.d.ts +22 -22
- package/dist/routes.d.ts +279 -18
- package/dist/routes.d.ts.map +1 -1
- package/dist/routes.js +57 -1
- package/dist/schema.d.ts +451 -0
- package/dist/schema.d.ts.map +1 -1
- package/dist/schema.js +79 -0
- package/dist/service-aggregates.d.ts +47 -0
- package/dist/service-aggregates.d.ts.map +1 -0
- package/dist/service-aggregates.js +106 -0
- package/dist/service-bookings-dual-create.d.ts +185 -0
- package/dist/service-bookings-dual-create.d.ts.map +1 -0
- package/dist/service-bookings-dual-create.js +131 -0
- package/dist/service-bookings-quick-create.d.ts +168 -0
- package/dist/service-bookings-quick-create.d.ts.map +1 -0
- package/dist/service-bookings-quick-create.js +312 -0
- package/dist/service-public.d.ts +11 -11
- package/dist/service-public.d.ts.map +1 -1
- package/dist/service-public.js +79 -36
- 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 +147 -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 +180 -17
- package/dist/service.d.ts.map +1 -1
- package/dist/service.js +4 -0
- package/dist/validation-public.d.ts +2 -2
- package/dist/validation-public.d.ts.map +1 -1
- package/dist/validation-public.js +4 -1
- package/dist/validation-shared.d.ts +17 -0
- package/dist/validation-shared.d.ts.map +1 -1
- package/dist/validation-shared.js +12 -0
- package/dist/validation-vouchers.d.ts +62 -0
- package/dist/validation-vouchers.d.ts.map +1 -0
- package/dist/validation-vouchers.js +46 -0
- package/dist/validation.d.ts +1 -0
- package/dist/validation.d.ts.map +1 -1
- package/dist/validation.js +1 -0
- package/package.json +9 -8
package/dist/index.d.ts
CHANGED
|
@@ -20,16 +20,23 @@ export interface FinanceHonoModuleOptions extends FinanceRuntimeOptions, PublicF
|
|
|
20
20
|
export declare function createFinanceHonoModule(options?: FinanceHonoModuleOptions): HonoModule;
|
|
21
21
|
export declare const financeHonoModule: HonoModule;
|
|
22
22
|
export { buildFinanceRouteRuntime, FINANCE_ROUTE_RUNTIME_CONTAINER_KEY, type FinanceRouteRuntime, type FinanceRuntimeOptions, } from "./route-runtime.js";
|
|
23
|
+
export { bookingsQuickCreateExtension } from "./routes-bookings-quick-create.js";
|
|
23
24
|
export { createFinanceAdminDocumentRoutes, type FinanceDocumentRouteOptions, type InvoiceDocumentGenerator, } from "./routes-documents.js";
|
|
24
25
|
export { createFinanceAdminSettlementRoutes, type FinanceSettlementRouteOptions, type InvoiceSettlementPoller, } from "./routes-settlement.js";
|
|
25
|
-
export type { BookingGuarantee, BookingItemCommission, BookingItemTaxLine, BookingPaymentSchedule, CreditNote, CreditNoteLineItem, FinanceNote, Invoice, InvoiceExternalRef, InvoiceLineItem, InvoiceNumberSeries, InvoiceRendition, InvoiceTemplate, NewBookingGuarantee, NewBookingItemCommission, NewBookingItemTaxLine, NewBookingPaymentSchedule, NewCreditNote, NewCreditNoteLineItem, NewFinanceNote, NewInvoice, NewInvoiceExternalRef, NewInvoiceLineItem, NewInvoiceNumberSeries, NewInvoiceRendition, NewInvoiceTemplate, NewPayment, NewPaymentAuthorization, NewPaymentCapture, NewPaymentInstrument, NewPaymentSession, NewSupplierPayment, NewTaxRegime, Payment, PaymentAuthorization, PaymentCapture, PaymentInstrument, PaymentSession, SupplierPayment, TaxRegime, } from "./schema.js";
|
|
26
|
-
export { bookingGuarantees, bookingItemCommissions, bookingItemTaxLines, bookingPaymentSchedules, creditNoteLineItems, creditNotes, financeNotes, invoiceExternalRefs, invoiceLineItems, invoiceNumberSeries, invoiceRenditions, invoices, invoiceTemplates, paymentAuthorizations, paymentCaptures, paymentInstruments, paymentSessions, payments, supplierPayments, taxRegimes, } from "./schema.js";
|
|
26
|
+
export type { BookingGuarantee, BookingItemCommission, BookingItemTaxLine, BookingPaymentSchedule, CreditNote, CreditNoteLineItem, FinanceNote, Invoice, InvoiceExternalRef, InvoiceLineItem, InvoiceNumberSeries, InvoiceRendition, InvoiceTemplate, NewBookingGuarantee, NewBookingItemCommission, NewBookingItemTaxLine, NewBookingPaymentSchedule, NewCreditNote, NewCreditNoteLineItem, NewFinanceNote, NewInvoice, NewInvoiceExternalRef, NewInvoiceLineItem, NewInvoiceNumberSeries, NewInvoiceRendition, NewInvoiceTemplate, NewPayment, NewPaymentAuthorization, NewPaymentCapture, NewPaymentInstrument, NewPaymentSession, NewSupplierPayment, NewTaxRegime, NewVoucher, NewVoucherRedemption, Payment, PaymentAuthorization, PaymentCapture, PaymentInstrument, PaymentSession, SupplierPayment, TaxRegime, Voucher, VoucherRedemption, } from "./schema.js";
|
|
27
|
+
export { bookingGuarantees, bookingItemCommissions, bookingItemTaxLines, bookingPaymentSchedules, creditNoteLineItems, creditNotes, financeNotes, invoiceExternalRefs, invoiceLineItems, invoiceNumberSeries, invoiceRenditions, invoices, invoiceTemplates, paymentAuthorizations, paymentCaptures, paymentInstruments, paymentSessions, payments, supplierPayments, taxRegimes, voucherRedemptions, voucherSourceTypeEnum, voucherStatusEnum, vouchers, } from "./schema.js";
|
|
27
28
|
export type { InvoiceFromBookingData } from "./service.js";
|
|
28
29
|
export { financeService, renderInvoiceBody } from "./service.js";
|
|
30
|
+
export type { BookingDualCreatedEvent, DualCreateBookingInput, DualCreateBookingOutcome, DualCreateBookingResult, DualCreateBookingRuntime, } from "./service-bookings-dual-create.js";
|
|
31
|
+
export { dualCreateBooking, dualCreateBookingSchema, } from "./service-bookings-dual-create.js";
|
|
32
|
+
export type { BookingQuickCreatedEvent, BookingQuickCreateRuntime, QuickCreateBookingInput, QuickCreateBookingOutcome, QuickCreateBookingResult, QuickCreateTravelerInput, } from "./service-bookings-quick-create.js";
|
|
33
|
+
export { quickCreateBooking, quickCreateBookingSchema, } from "./service-bookings-quick-create.js";
|
|
29
34
|
export type { GeneratedInvoiceDocumentRecord, GeneratedInvoiceRenditionArtifact, InvoiceDocumentGeneratedEvent, InvoiceDocumentGeneratorContext, InvoiceDocumentRuntimeOptions, StorageBackedInvoiceDocumentGeneratorOptions, StorageBackedInvoiceDocumentSerializer, StorageBackedInvoiceDocumentUpload, } from "./service-documents.js";
|
|
30
35
|
export { createPdfInvoiceDocumentGenerator, createStorageBackedInvoiceDocumentGenerator, defaultPdfInvoiceDocumentSerializer, defaultStorageBackedInvoiceDocumentSerializer, financeDocumentsService, } from "./service-documents.js";
|
|
31
36
|
export type { FinanceSettlementRuntimeOptions, InvoiceSettledEvent, InvoiceSettlementPollerContext, InvoiceSettlementPollerResult, } from "./service-settlement.js";
|
|
32
37
|
export { financeSettlementService } from "./service-settlement.js";
|
|
38
|
+
export { VoucherServiceError, vouchersService } from "./service-vouchers.js";
|
|
39
|
+
export { migrateVouchersFromPaymentInstruments, type VoucherMigrationOptions, type VoucherMigrationResult, type VoucherMigrationSkip, } from "./service-vouchers-migration.js";
|
|
33
40
|
export type { GeneratedInvoiceDocumentResult, GenerateInvoiceDocumentInput, PolledInvoiceSettlementResult, PollInvoiceSettlementInput, } from "./validation.js";
|
|
34
41
|
export { agingReportQuerySchema, allocateInvoiceNumberInputSchema, applyDefaultBookingPaymentPlanSchema, cancelPaymentSessionSchema, completePaymentSessionSchema, createPaymentSessionFromGuaranteeSchema, createPaymentSessionFromInvoiceSchema, createPaymentSessionFromScheduleSchema, expirePaymentSessionSchema, failPaymentSessionSchema, generatedInvoiceDocumentResultSchema, generateInvoiceDocumentInputSchema, insertBookingGuaranteeSchema, insertBookingItemCommissionSchema, insertBookingItemTaxLineSchema, insertBookingPaymentScheduleSchema, insertCreditNoteLineItemSchema, insertCreditNoteSchema, insertFinanceNoteSchema, insertInvoiceExternalRefSchema, insertInvoiceLineItemSchema, insertInvoiceNumberSeriesSchema, insertInvoiceRenditionSchema, insertInvoiceSchema, insertInvoiceTemplateSchema, insertPaymentAuthorizationSchema, insertPaymentCaptureSchema, insertPaymentInstrumentSchema, insertPaymentSchema, insertPaymentSessionSchema, insertSupplierPaymentSchema, insertTaxRegimeSchema, invoiceFromBookingSchema, invoiceListQuerySchema, invoiceNumberSeriesListQuerySchema, invoiceTemplateListQuerySchema, markPaymentSessionRequiresRedirectSchema, paymentAuthorizationListQuerySchema, paymentCaptureListQuerySchema, paymentInstrumentListQuerySchema, paymentSessionListQuerySchema, polledInvoiceSettlementProviderResultSchema, polledInvoiceSettlementResultSchema, pollInvoiceSettlementInputSchema, profitabilityQuerySchema, renderInvoiceInputSchema, revenueReportQuerySchema, supplierPaymentListQuerySchema, taxRegimeListQuerySchema, updateBookingGuaranteeSchema, updateBookingItemCommissionSchema, updateBookingItemTaxLineSchema, updateBookingPaymentScheduleSchema, updateCreditNoteLineItemSchema, updateCreditNoteSchema, updateInvoiceExternalRefSchema, updateInvoiceLineItemSchema, updateInvoiceNumberSeriesSchema, updateInvoiceRenditionSchema, updateInvoiceSchema, updateInvoiceTemplateSchema, updatePaymentAuthorizationSchema, updatePaymentCaptureSchema, updatePaymentInstrumentSchema, updatePaymentSchema, updatePaymentSessionSchema, updateSupplierPaymentSchema, updateTaxRegimeSchema, } from "./validation.js";
|
|
35
42
|
export type { PublicBookingFinanceDocuments, PublicBookingFinancePayments, PublicBookingPaymentOptions, PublicFinanceBookingDocument, PublicFinanceBookingPayment, PublicFinanceDocumentLookup, PublicFinanceDocumentLookupQuery, PublicPaymentOptionsQuery, PublicPaymentSession, PublicStartPaymentSessionInput, PublicValidateVoucherInput, PublicVoucherValidationResult, } from "./validation-public.js";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot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/B,4BAA4B,EAC5B,mBAAmB,EACnB,2BAA2B,EAC3B,gCAAgC,EAChC,0BAA0B,EAC1B,6BAA6B,EAC7B,mBAAmB,EACnB,0BAA0B,EAC1B,2BAA2B,EAC3B,qBAAqB,GACtB,MAAM,iBAAiB,CAAA;AACxB,YAAY,EACV,6BAA6B,EAC7B,4BAA4B,EAC5B,2BAA2B,EAC3B,4BAA4B,EAC5B,2BAA2B,EAC3B,2BAA2B,EAC3B,gCAAgC,EAChC,yBAAyB,EACzB,oBAAoB,EACpB,8BAA8B,EAC9B,0BAA0B,EAC1B,6BAA6B,GAC9B,MAAM,wBAAwB,CAAA;AAC/B,OAAO,EACL,mCAAmC,EACnC,kCAAkC,EAClC,iCAAiC,EACjC,kCAAkC,EAClC,iCAAiC,EACjC,uCAAuC,EACvC,iCAAiC,EACjC,sCAAsC,EACtC,iCAAiC,EACjC,8BAA8B,EAC9B,+BAA+B,EAC/B,0BAA0B,EAC1B,+BAA+B,EAC/B,2BAA2B,EAC3B,6BAA6B,GAC9B,MAAM,wBAAwB,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -53,11 +53,16 @@ export function createFinanceHonoModule(options = {}) {
|
|
|
53
53
|
}
|
|
54
54
|
export const financeHonoModule = createFinanceHonoModule();
|
|
55
55
|
export { buildFinanceRouteRuntime, FINANCE_ROUTE_RUNTIME_CONTAINER_KEY, } from "./route-runtime.js";
|
|
56
|
+
export { bookingsQuickCreateExtension } from "./routes-bookings-quick-create.js";
|
|
56
57
|
export { createFinanceAdminDocumentRoutes, } from "./routes-documents.js";
|
|
57
58
|
export { createFinanceAdminSettlementRoutes, } from "./routes-settlement.js";
|
|
58
|
-
export { bookingGuarantees, bookingItemCommissions, bookingItemTaxLines, bookingPaymentSchedules, creditNoteLineItems, creditNotes, financeNotes, invoiceExternalRefs, invoiceLineItems, invoiceNumberSeries, invoiceRenditions, invoices, invoiceTemplates, paymentAuthorizations, paymentCaptures, paymentInstruments, paymentSessions, payments, supplierPayments, taxRegimes, } from "./schema.js";
|
|
59
|
+
export { bookingGuarantees, bookingItemCommissions, bookingItemTaxLines, bookingPaymentSchedules, creditNoteLineItems, creditNotes, financeNotes, invoiceExternalRefs, invoiceLineItems, invoiceNumberSeries, invoiceRenditions, invoices, invoiceTemplates, paymentAuthorizations, paymentCaptures, paymentInstruments, paymentSessions, payments, supplierPayments, taxRegimes, voucherRedemptions, voucherSourceTypeEnum, voucherStatusEnum, vouchers, } from "./schema.js";
|
|
59
60
|
export { financeService, renderInvoiceBody } from "./service.js";
|
|
61
|
+
export { dualCreateBooking, dualCreateBookingSchema, } from "./service-bookings-dual-create.js";
|
|
62
|
+
export { quickCreateBooking, quickCreateBookingSchema, } from "./service-bookings-quick-create.js";
|
|
60
63
|
export { createPdfInvoiceDocumentGenerator, createStorageBackedInvoiceDocumentGenerator, defaultPdfInvoiceDocumentSerializer, defaultStorageBackedInvoiceDocumentSerializer, financeDocumentsService, } from "./service-documents.js";
|
|
61
64
|
export { financeSettlementService } from "./service-settlement.js";
|
|
65
|
+
export { VoucherServiceError, vouchersService } from "./service-vouchers.js";
|
|
66
|
+
export { migrateVouchersFromPaymentInstruments, } from "./service-vouchers-migration.js";
|
|
62
67
|
export { agingReportQuerySchema, allocateInvoiceNumberInputSchema, applyDefaultBookingPaymentPlanSchema, cancelPaymentSessionSchema, completePaymentSessionSchema, createPaymentSessionFromGuaranteeSchema, createPaymentSessionFromInvoiceSchema, createPaymentSessionFromScheduleSchema, expirePaymentSessionSchema, failPaymentSessionSchema, generatedInvoiceDocumentResultSchema, generateInvoiceDocumentInputSchema, insertBookingGuaranteeSchema, insertBookingItemCommissionSchema, insertBookingItemTaxLineSchema, insertBookingPaymentScheduleSchema, insertCreditNoteLineItemSchema, insertCreditNoteSchema, insertFinanceNoteSchema, insertInvoiceExternalRefSchema, insertInvoiceLineItemSchema, insertInvoiceNumberSeriesSchema, insertInvoiceRenditionSchema, insertInvoiceSchema, insertInvoiceTemplateSchema, insertPaymentAuthorizationSchema, insertPaymentCaptureSchema, insertPaymentInstrumentSchema, insertPaymentSchema, insertPaymentSessionSchema, insertSupplierPaymentSchema, insertTaxRegimeSchema, invoiceFromBookingSchema, invoiceListQuerySchema, invoiceNumberSeriesListQuerySchema, invoiceTemplateListQuerySchema, markPaymentSessionRequiresRedirectSchema, paymentAuthorizationListQuerySchema, paymentCaptureListQuerySchema, paymentInstrumentListQuerySchema, paymentSessionListQuerySchema, polledInvoiceSettlementProviderResultSchema, polledInvoiceSettlementResultSchema, pollInvoiceSettlementInputSchema, profitabilityQuerySchema, renderInvoiceInputSchema, revenueReportQuerySchema, supplierPaymentListQuerySchema, taxRegimeListQuerySchema, updateBookingGuaranteeSchema, updateBookingItemCommissionSchema, updateBookingItemTaxLineSchema, updateBookingPaymentScheduleSchema, updateCreditNoteLineItemSchema, updateCreditNoteSchema, updateInvoiceExternalRefSchema, updateInvoiceLineItemSchema, updateInvoiceNumberSeriesSchema, updateInvoiceRenditionSchema, updateInvoiceSchema, updateInvoiceTemplateSchema, updatePaymentAuthorizationSchema, updatePaymentCaptureSchema, updatePaymentInstrumentSchema, updatePaymentSchema, updatePaymentSessionSchema, updateSupplierPaymentSchema, updateTaxRegimeSchema, } from "./validation.js";
|
|
63
68
|
export { publicBookingFinanceDocumentsSchema, publicBookingFinancePaymentsSchema, publicBookingPaymentOptionsSchema, publicFinanceBookingDocumentSchema, publicFinanceBookingPaymentSchema, publicFinanceDocumentAvailabilitySchema, publicFinanceDocumentFormatSchema, publicFinanceDocumentLookupQuerySchema, publicFinanceDocumentLookupSchema, publicFinanceInvoiceTypeSchema, publicPaymentOptionsQuerySchema, publicPaymentSessionSchema, publicStartPaymentSessionSchema, publicValidateVoucherSchema, publicVoucherValidationSchema, } from "./validation-public.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"routes-bookings-quick-create.d.ts","sourceRoot":"","sources":["../src/routes-bookings-quick-create.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAA;AAmH1D,eAAO,MAAM,4BAA4B,EAAE,aAQ1C,CAAA"}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { parseJsonBody } from "@voyantjs/hono";
|
|
2
|
+
import { Hono } from "hono";
|
|
3
|
+
import { FINANCE_ROUTE_RUNTIME_CONTAINER_KEY } from "./route-runtime.js";
|
|
4
|
+
import { dualCreateBooking, dualCreateBookingSchema } from "./service-bookings-dual-create.js";
|
|
5
|
+
import { quickCreateBooking, quickCreateBookingSchema } from "./service-bookings-quick-create.js";
|
|
6
|
+
function resolveRuntime(container) {
|
|
7
|
+
try {
|
|
8
|
+
return container.resolve(FINANCE_ROUTE_RUNTIME_CONTAINER_KEY);
|
|
9
|
+
}
|
|
10
|
+
catch {
|
|
11
|
+
return null;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Mounted under `/v1/admin/bookings/*` via the extension's `module` target, so
|
|
16
|
+
* the endpoint's public-facing path lands at `POST /v1/admin/bookings/quick-create`
|
|
17
|
+
* even though the code lives in `@voyantjs/finance`. See the header comment in
|
|
18
|
+
* service-bookings-quick-create.ts for why finance owns this orchestration.
|
|
19
|
+
*/
|
|
20
|
+
const quickCreateRoutes = new Hono()
|
|
21
|
+
.post("/quick-create", async (c) => {
|
|
22
|
+
const input = await parseJsonBody(c, quickCreateBookingSchema);
|
|
23
|
+
const runtime = resolveRuntime(c.var.container);
|
|
24
|
+
const outcome = await quickCreateBooking(c.get("db"), input, {
|
|
25
|
+
userId: c.get("userId"),
|
|
26
|
+
runtime: runtime ? { eventBus: runtime.eventBus } : undefined,
|
|
27
|
+
});
|
|
28
|
+
switch (outcome.status) {
|
|
29
|
+
case "ok":
|
|
30
|
+
return c.json({ data: outcome.result }, 201);
|
|
31
|
+
case "product_not_found":
|
|
32
|
+
return c.json({ error: "Product not found or unavailable" }, 404);
|
|
33
|
+
case "voucher_not_found":
|
|
34
|
+
return c.json({ error: "Voucher not found" }, 404);
|
|
35
|
+
case "voucher_inactive":
|
|
36
|
+
return c.json({ error: "Voucher is not active" }, 409);
|
|
37
|
+
case "voucher_not_started":
|
|
38
|
+
return c.json({ error: "Voucher is not yet valid" }, 409);
|
|
39
|
+
case "voucher_expired":
|
|
40
|
+
return c.json({ error: "Voucher has expired" }, 409);
|
|
41
|
+
case "voucher_insufficient_balance":
|
|
42
|
+
return c.json({ error: "Voucher does not have enough balance" }, 409);
|
|
43
|
+
case "group_not_found":
|
|
44
|
+
return c.json({ error: "Booking group not found" }, 404);
|
|
45
|
+
case "booking_already_in_group":
|
|
46
|
+
return c.json({
|
|
47
|
+
error: "Booking is already a member of a group",
|
|
48
|
+
currentGroupId: outcome.currentGroupId,
|
|
49
|
+
}, 409);
|
|
50
|
+
}
|
|
51
|
+
})
|
|
52
|
+
.post("/dual-create", async (c) => {
|
|
53
|
+
const input = await parseJsonBody(c, dualCreateBookingSchema);
|
|
54
|
+
const runtime = resolveRuntime(c.var.container);
|
|
55
|
+
const outcome = await dualCreateBooking(c.get("db"), input, {
|
|
56
|
+
userId: c.get("userId"),
|
|
57
|
+
runtime: runtime ? { eventBus: runtime.eventBus } : undefined,
|
|
58
|
+
});
|
|
59
|
+
if (outcome.status === "ok") {
|
|
60
|
+
return c.json({ data: outcome.result }, 201);
|
|
61
|
+
}
|
|
62
|
+
// Both failure branches carry a nested quick-create reason. Map them to
|
|
63
|
+
// the same HTTP codes the single quick-create endpoint uses so callers
|
|
64
|
+
// can treat them uniformly, and surface which sub-booking tripped.
|
|
65
|
+
const which = outcome.status === "primary_failed" ? "primary" : "secondary";
|
|
66
|
+
const reason = outcome.reason;
|
|
67
|
+
const body = { which, reasonStatus: reason.status };
|
|
68
|
+
switch (reason.status) {
|
|
69
|
+
case "product_not_found":
|
|
70
|
+
return c.json({ ...body, error: `${which}: product not found or unavailable` }, 404);
|
|
71
|
+
case "voucher_not_found":
|
|
72
|
+
return c.json({ ...body, error: `${which}: voucher not found` }, 404);
|
|
73
|
+
case "voucher_inactive":
|
|
74
|
+
return c.json({ ...body, error: `${which}: voucher is not active` }, 409);
|
|
75
|
+
case "voucher_not_started":
|
|
76
|
+
return c.json({ ...body, error: `${which}: voucher is not yet valid` }, 409);
|
|
77
|
+
case "voucher_expired":
|
|
78
|
+
return c.json({ ...body, error: `${which}: voucher has expired` }, 409);
|
|
79
|
+
case "voucher_insufficient_balance":
|
|
80
|
+
return c.json({ ...body, error: `${which}: voucher does not have enough balance` }, 409);
|
|
81
|
+
case "group_not_found":
|
|
82
|
+
return c.json({ ...body, error: `${which}: group linking failed` }, 500);
|
|
83
|
+
case "booking_already_in_group":
|
|
84
|
+
return c.json({
|
|
85
|
+
...body,
|
|
86
|
+
error: `${which}: booking is already in a group`,
|
|
87
|
+
currentGroupId: reason.currentGroupId,
|
|
88
|
+
}, 409);
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
const bookingsQuickCreateExtensionDef = {
|
|
92
|
+
name: "bookings-quick-create",
|
|
93
|
+
module: "bookings",
|
|
94
|
+
};
|
|
95
|
+
export const bookingsQuickCreateExtension = {
|
|
96
|
+
extension: bookingsQuickCreateExtensionDef,
|
|
97
|
+
// Mount on both surfaces to mirror bookings' own module routes. The legacy
|
|
98
|
+
// `/v1/bookings/...` path is what existing bookings-react hooks hit; the
|
|
99
|
+
// `/v1/admin/bookings/...` path is staff-guarded and the forward-looking
|
|
100
|
+
// convention. Both serve the same handler.
|
|
101
|
+
adminRoutes: quickCreateRoutes,
|
|
102
|
+
routes: quickCreateRoutes,
|
|
103
|
+
};
|
package/dist/routes-public.d.ts
CHANGED
|
@@ -8,16 +8,12 @@ export declare function createPublicFinanceRoutes(options?: PublicFinanceRouteOp
|
|
|
8
8
|
input: {};
|
|
9
9
|
output: {
|
|
10
10
|
data: {
|
|
11
|
-
valid: false;
|
|
12
|
-
reason: "not_found";
|
|
13
|
-
voucher: null;
|
|
14
|
-
} | {
|
|
15
11
|
valid: false;
|
|
16
12
|
reason: "inactive";
|
|
17
13
|
voucher: {
|
|
18
14
|
id: string;
|
|
19
15
|
code: string;
|
|
20
|
-
label: string;
|
|
16
|
+
label: string | null;
|
|
21
17
|
provider: string | null;
|
|
22
18
|
currency: string | null;
|
|
23
19
|
amountCents: number | null;
|
|
@@ -30,7 +26,7 @@ export declare function createPublicFinanceRoutes(options?: PublicFinanceRouteOp
|
|
|
30
26
|
voucher: {
|
|
31
27
|
id: string;
|
|
32
28
|
code: string;
|
|
33
|
-
label: string;
|
|
29
|
+
label: string | null;
|
|
34
30
|
provider: string | null;
|
|
35
31
|
currency: string | null;
|
|
36
32
|
amountCents: number | null;
|
|
@@ -43,7 +39,7 @@ export declare function createPublicFinanceRoutes(options?: PublicFinanceRouteOp
|
|
|
43
39
|
voucher: {
|
|
44
40
|
id: string;
|
|
45
41
|
code: string;
|
|
46
|
-
label: string;
|
|
42
|
+
label: string | null;
|
|
47
43
|
provider: string | null;
|
|
48
44
|
currency: string | null;
|
|
49
45
|
amountCents: number | null;
|
|
@@ -56,7 +52,7 @@ export declare function createPublicFinanceRoutes(options?: PublicFinanceRouteOp
|
|
|
56
52
|
voucher: {
|
|
57
53
|
id: string;
|
|
58
54
|
code: string;
|
|
59
|
-
label: string;
|
|
55
|
+
label: string | null;
|
|
60
56
|
provider: string | null;
|
|
61
57
|
currency: string | null;
|
|
62
58
|
amountCents: number | null;
|
|
@@ -69,7 +65,7 @@ export declare function createPublicFinanceRoutes(options?: PublicFinanceRouteOp
|
|
|
69
65
|
voucher: {
|
|
70
66
|
id: string;
|
|
71
67
|
code: string;
|
|
72
|
-
label: string;
|
|
68
|
+
label: string | null;
|
|
73
69
|
provider: string | null;
|
|
74
70
|
currency: string | null;
|
|
75
71
|
amountCents: number | null;
|
|
@@ -82,7 +78,7 @@ export declare function createPublicFinanceRoutes(options?: PublicFinanceRouteOp
|
|
|
82
78
|
voucher: {
|
|
83
79
|
id: string;
|
|
84
80
|
code: string;
|
|
85
|
-
label: string;
|
|
81
|
+
label: string | null;
|
|
86
82
|
provider: string | null;
|
|
87
83
|
currency: string | null;
|
|
88
84
|
amountCents: number | null;
|
|
@@ -95,13 +91,17 @@ export declare function createPublicFinanceRoutes(options?: PublicFinanceRouteOp
|
|
|
95
91
|
voucher: {
|
|
96
92
|
id: string;
|
|
97
93
|
code: string;
|
|
98
|
-
label: string;
|
|
94
|
+
label: string | null;
|
|
99
95
|
provider: string | null;
|
|
100
96
|
currency: string | null;
|
|
101
97
|
amountCents: number | null;
|
|
102
98
|
remainingAmountCents: number | null;
|
|
103
99
|
expiresAt: string | null;
|
|
104
100
|
};
|
|
101
|
+
} | {
|
|
102
|
+
valid: false;
|
|
103
|
+
reason: "not_found";
|
|
104
|
+
voucher: null;
|
|
105
105
|
};
|
|
106
106
|
};
|
|
107
107
|
outputFormat: "json";
|
|
@@ -560,16 +560,12 @@ export declare const publicFinanceRoutes: import("hono/hono-base").HonoBase<Env,
|
|
|
560
560
|
input: {};
|
|
561
561
|
output: {
|
|
562
562
|
data: {
|
|
563
|
-
valid: false;
|
|
564
|
-
reason: "not_found";
|
|
565
|
-
voucher: null;
|
|
566
|
-
} | {
|
|
567
563
|
valid: false;
|
|
568
564
|
reason: "inactive";
|
|
569
565
|
voucher: {
|
|
570
566
|
id: string;
|
|
571
567
|
code: string;
|
|
572
|
-
label: string;
|
|
568
|
+
label: string | null;
|
|
573
569
|
provider: string | null;
|
|
574
570
|
currency: string | null;
|
|
575
571
|
amountCents: number | null;
|
|
@@ -582,7 +578,7 @@ export declare const publicFinanceRoutes: import("hono/hono-base").HonoBase<Env,
|
|
|
582
578
|
voucher: {
|
|
583
579
|
id: string;
|
|
584
580
|
code: string;
|
|
585
|
-
label: string;
|
|
581
|
+
label: string | null;
|
|
586
582
|
provider: string | null;
|
|
587
583
|
currency: string | null;
|
|
588
584
|
amountCents: number | null;
|
|
@@ -595,7 +591,7 @@ export declare const publicFinanceRoutes: import("hono/hono-base").HonoBase<Env,
|
|
|
595
591
|
voucher: {
|
|
596
592
|
id: string;
|
|
597
593
|
code: string;
|
|
598
|
-
label: string;
|
|
594
|
+
label: string | null;
|
|
599
595
|
provider: string | null;
|
|
600
596
|
currency: string | null;
|
|
601
597
|
amountCents: number | null;
|
|
@@ -608,7 +604,7 @@ export declare const publicFinanceRoutes: import("hono/hono-base").HonoBase<Env,
|
|
|
608
604
|
voucher: {
|
|
609
605
|
id: string;
|
|
610
606
|
code: string;
|
|
611
|
-
label: string;
|
|
607
|
+
label: string | null;
|
|
612
608
|
provider: string | null;
|
|
613
609
|
currency: string | null;
|
|
614
610
|
amountCents: number | null;
|
|
@@ -621,7 +617,7 @@ export declare const publicFinanceRoutes: import("hono/hono-base").HonoBase<Env,
|
|
|
621
617
|
voucher: {
|
|
622
618
|
id: string;
|
|
623
619
|
code: string;
|
|
624
|
-
label: string;
|
|
620
|
+
label: string | null;
|
|
625
621
|
provider: string | null;
|
|
626
622
|
currency: string | null;
|
|
627
623
|
amountCents: number | null;
|
|
@@ -634,7 +630,7 @@ export declare const publicFinanceRoutes: import("hono/hono-base").HonoBase<Env,
|
|
|
634
630
|
voucher: {
|
|
635
631
|
id: string;
|
|
636
632
|
code: string;
|
|
637
|
-
label: string;
|
|
633
|
+
label: string | null;
|
|
638
634
|
provider: string | null;
|
|
639
635
|
currency: string | null;
|
|
640
636
|
amountCents: number | null;
|
|
@@ -647,13 +643,17 @@ export declare const publicFinanceRoutes: import("hono/hono-base").HonoBase<Env,
|
|
|
647
643
|
voucher: {
|
|
648
644
|
id: string;
|
|
649
645
|
code: string;
|
|
650
|
-
label: string;
|
|
646
|
+
label: string | null;
|
|
651
647
|
provider: string | null;
|
|
652
648
|
currency: string | null;
|
|
653
649
|
amountCents: number | null;
|
|
654
650
|
remainingAmountCents: number | null;
|
|
655
651
|
expiresAt: string | null;
|
|
656
652
|
};
|
|
653
|
+
} | {
|
|
654
|
+
valid: false;
|
|
655
|
+
reason: "not_found";
|
|
656
|
+
voucher: null;
|
|
657
657
|
};
|
|
658
658
|
};
|
|
659
659
|
outputFormat: "json";
|