@voyantjs/bookings 0.3.1 → 0.4.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/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/routes-public.d.ts +1 -1
- package/dist/routes.d.ts +99 -18
- package/dist/routes.d.ts.map +1 -1
- package/dist/routes.js +10 -1
- package/dist/schema/travel-details.d.ts +3 -3
- package/dist/schema/travel-details.d.ts.map +1 -1
- package/dist/schema/travel-details.js +1 -1
- package/dist/schema-items.d.ts +1 -1
- package/dist/schema-operations.d.ts +1 -1
- package/dist/service-public.d.ts +66 -2
- package/dist/service-public.d.ts.map +1 -1
- package/dist/service-public.js +130 -117
- package/dist/service.d.ts +20 -20
- package/dist/validation-public.d.ts +9 -2
- package/dist/validation-public.d.ts.map +1 -1
- package/dist/validation-public.js +10 -0
- package/dist/validation-shared.d.ts +2 -2
- package/dist/validation.d.ts +5 -5
- package/package.json +6 -6
package/dist/index.d.ts
CHANGED
|
@@ -19,5 +19,5 @@ export { bookingParticipantDietarySchema, bookingParticipantIdentitySchema, book
|
|
|
19
19
|
export type { Booking, BookingActivity, BookingAllocation, BookingDocument, BookingFulfillment, BookingItem, BookingItemParticipant, BookingNote, BookingParticipant, BookingPassenger, BookingPiiAccessLog, BookingRedemptionEvent, BookingSessionState, BookingSupplierStatus, NewBooking, NewBookingActivity, NewBookingAllocation, NewBookingDocument, NewBookingFulfillment, NewBookingItem, NewBookingItemParticipant, NewBookingNote, NewBookingParticipant, NewBookingPassenger, NewBookingPiiAccessLog, NewBookingRedemptionEvent, NewBookingSessionState, NewBookingSupplierStatus, } from "./schema.js";
|
|
20
20
|
export { bookingActivityLog, bookingAllocations, bookingDocuments, bookingFulfillments, bookingItemParticipants, bookingItems, bookingNotes, bookingParticipants, bookingPassengers, bookingPiiAccessLog, bookingRedemptionEvents, bookingSessionStates, bookingSupplierStatuses, bookings, } from "./schema.js";
|
|
21
21
|
export { publicBookingsService } from "./service-public.js";
|
|
22
|
-
export { bookingListQuerySchema, cancelBookingSchema, confirmBookingSchema, convertProductSchema, createBookingSchema, expireBookingSchema, expireStaleBookingsSchema, extendBookingHoldSchema, insertBookingAllocationSchema, insertBookingDocumentSchema, insertBookingFulfillmentSchema, insertBookingItemParticipantSchema, insertBookingItemSchema, insertBookingNoteSchema, insertBookingSchema, insertParticipantSchema, insertPassengerSchema, insertSupplierStatusSchema, publicBookingOverviewLookupQuerySchema, publicBookingSessionMutationSchema, publicBookingSessionRepriceItemSchema, publicBookingSessionRepriceResultSchema, publicBookingSessionRepriceSummarySchema, publicBookingSessionStateSchema, publicCreateBookingSessionSchema, publicRepriceBookingSessionSchema, publicUpdateBookingSessionSchema, publicUpsertBookingSessionStateSchema, recordBookingRedemptionSchema, reserveBookingFromTransactionSchema, reserveBookingSchema, updateBookingAllocationSchema, updateBookingFulfillmentSchema, updateBookingItemSchema, updateBookingSchema, updateBookingStatusSchema, updateParticipantSchema, updatePassengerSchema, updateSupplierStatusSchema, upsertParticipantTravelDetailsSchema, } from "./validation.js";
|
|
22
|
+
export { bookingListQuerySchema, cancelBookingSchema, confirmBookingSchema, convertProductSchema, createBookingSchema, expireBookingSchema, expireStaleBookingsSchema, extendBookingHoldSchema, insertBookingAllocationSchema, insertBookingDocumentSchema, insertBookingFulfillmentSchema, insertBookingItemParticipantSchema, insertBookingItemSchema, insertBookingNoteSchema, insertBookingSchema, insertParticipantSchema, insertPassengerSchema, insertSupplierStatusSchema, internalBookingOverviewLookupQuerySchema, publicBookingOverviewLookupQuerySchema, publicBookingSessionMutationSchema, publicBookingSessionRepriceItemSchema, publicBookingSessionRepriceResultSchema, publicBookingSessionRepriceSummarySchema, publicBookingSessionStateSchema, publicCreateBookingSessionSchema, publicRepriceBookingSessionSchema, publicUpdateBookingSessionSchema, publicUpsertBookingSessionStateSchema, recordBookingRedemptionSchema, reserveBookingFromTransactionSchema, reserveBookingSchema, updateBookingAllocationSchema, updateBookingFulfillmentSchema, updateBookingItemSchema, updateBookingSchema, updateBookingStatusSchema, updateParticipantSchema, updatePassengerSchema, updateSupplierStatusSchema, upsertParticipantTravelDetailsSchema, } from "./validation.js";
|
|
23
23
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAA;AAChE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AAKvD,OAAO,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAA;AACrE,OAAO,EACL,KAAK,oBAAoB,EACzB,KAAK,wBAAwB,EAC7B,uBAAuB,EACvB,KAAK,yCAAyC,GAC/C,MAAM,UAAU,CAAA;AACjB,YAAY,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAA;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AAC9C,OAAO,EACL,KAAK,4BAA4B,EACjC,KAAK,6BAA6B,EAClC,uBAAuB,GACxB,MAAM,kBAAkB,CAAA;AAEzB,eAAO,MAAM,eAAe,EAAE,kBAK7B,CAAA;AAED,eAAO,MAAM,gBAAgB;;CAE5B,CAAA;AAED,eAAO,MAAM,cAAc,EAAE,MAG5B,CAAA;AAED,eAAO,MAAM,kBAAkB,EAAE,UAKhC,CAAA;AAED,YAAY,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAChD,YAAY,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AAC7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AACxD,YAAY,EACV,yBAAyB,EACzB,0BAA0B,EAC1B,8BAA8B,EAC9B,uCAAuC,EACvC,iCAAiC,GAClC,MAAM,4BAA4B,CAAA;AACnC,OAAO,EAC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,EACjC,gCAAgC,EAChC,qCAAqC,EACrC,6BAA6B,EAC7B,mCAAmC,EACnC,oBAAoB,EACpB,6BAA6B,EAC7B,8BAA8B,EAC9B,uBAAuB,EACvB,mBAAmB,EACnB,yBAAyB,EACzB,uBAAuB,EACvB,qBAAqB,EACrB,0BAA0B,EAC1B,oCAAoC,GACrC,MAAM,iBAAiB,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -27,4 +27,4 @@ export { publicBookingRoutes } from "./routes-public.js";
|
|
|
27
27
|
export { bookingParticipantDietarySchema, bookingParticipantIdentitySchema, bookingParticipantTravelDetailInsertSchema, bookingParticipantTravelDetailSelectSchema, bookingParticipantTravelDetails, bookingParticipantTravelDetailUpdateSchema, decryptedBookingParticipantTravelDetailSchema, } from "./schema/travel-details.js";
|
|
28
28
|
export { bookingActivityLog, bookingAllocations, bookingDocuments, bookingFulfillments, bookingItemParticipants, bookingItems, bookingNotes, bookingParticipants, bookingPassengers, bookingPiiAccessLog, bookingRedemptionEvents, bookingSessionStates, bookingSupplierStatuses, bookings, } from "./schema.js";
|
|
29
29
|
export { publicBookingsService } from "./service-public.js";
|
|
30
|
-
export { bookingListQuerySchema, cancelBookingSchema, confirmBookingSchema, convertProductSchema, createBookingSchema, expireBookingSchema, expireStaleBookingsSchema, extendBookingHoldSchema, insertBookingAllocationSchema, insertBookingDocumentSchema, insertBookingFulfillmentSchema, insertBookingItemParticipantSchema, insertBookingItemSchema, insertBookingNoteSchema, insertBookingSchema, insertParticipantSchema, insertPassengerSchema, insertSupplierStatusSchema, publicBookingOverviewLookupQuerySchema, publicBookingSessionMutationSchema, publicBookingSessionRepriceItemSchema, publicBookingSessionRepriceResultSchema, publicBookingSessionRepriceSummarySchema, publicBookingSessionStateSchema, publicCreateBookingSessionSchema, publicRepriceBookingSessionSchema, publicUpdateBookingSessionSchema, publicUpsertBookingSessionStateSchema, recordBookingRedemptionSchema, reserveBookingFromTransactionSchema, reserveBookingSchema, updateBookingAllocationSchema, updateBookingFulfillmentSchema, updateBookingItemSchema, updateBookingSchema, updateBookingStatusSchema, updateParticipantSchema, updatePassengerSchema, updateSupplierStatusSchema, upsertParticipantTravelDetailsSchema, } from "./validation.js";
|
|
30
|
+
export { bookingListQuerySchema, cancelBookingSchema, confirmBookingSchema, convertProductSchema, createBookingSchema, expireBookingSchema, expireStaleBookingsSchema, extendBookingHoldSchema, insertBookingAllocationSchema, insertBookingDocumentSchema, insertBookingFulfillmentSchema, insertBookingItemParticipantSchema, insertBookingItemSchema, insertBookingNoteSchema, insertBookingSchema, insertParticipantSchema, insertPassengerSchema, insertSupplierStatusSchema, internalBookingOverviewLookupQuerySchema, publicBookingOverviewLookupQuerySchema, publicBookingSessionMutationSchema, publicBookingSessionRepriceItemSchema, publicBookingSessionRepriceResultSchema, publicBookingSessionRepriceSummarySchema, publicBookingSessionStateSchema, publicCreateBookingSessionSchema, publicRepriceBookingSessionSchema, publicUpdateBookingSessionSchema, publicUpsertBookingSessionStateSchema, recordBookingRedemptionSchema, reserveBookingFromTransactionSchema, reserveBookingSchema, updateBookingAllocationSchema, updateBookingFulfillmentSchema, updateBookingItemSchema, updateBookingSchema, updateBookingStatusSchema, updateParticipantSchema, updatePassengerSchema, updateSupplierStatusSchema, upsertParticipantTravelDetailsSchema, } from "./validation.js";
|
package/dist/routes-public.d.ts
CHANGED
|
@@ -565,7 +565,7 @@ export declare const publicBookingRoutes: import("hono/hono-base").HonoBase<Env,
|
|
|
565
565
|
bookingItemId: string | null;
|
|
566
566
|
participantId: string | null;
|
|
567
567
|
fulfillmentType: "other" | "voucher" | "ticket" | "pdf" | "qr_code" | "barcode" | "mobile";
|
|
568
|
-
deliveryChannel: "
|
|
568
|
+
deliveryChannel: "email" | "other" | "download" | "api" | "wallet";
|
|
569
569
|
status: "pending" | "issued" | "reissued" | "revoked" | "failed";
|
|
570
570
|
artifactUrl: string | null;
|
|
571
571
|
}[];
|
package/dist/routes.d.ts
CHANGED
|
@@ -42,6 +42,87 @@ export declare const bookingRoutes: import("hono/hono-base").HonoBase<Env, {
|
|
|
42
42
|
status: import("hono/utils/http-status").ContentfulStatusCode;
|
|
43
43
|
};
|
|
44
44
|
};
|
|
45
|
+
} & {
|
|
46
|
+
"/overview": {
|
|
47
|
+
$get: {
|
|
48
|
+
input: {};
|
|
49
|
+
output: {
|
|
50
|
+
error: string;
|
|
51
|
+
};
|
|
52
|
+
outputFormat: "json";
|
|
53
|
+
status: 404;
|
|
54
|
+
} | {
|
|
55
|
+
input: {};
|
|
56
|
+
output: {
|
|
57
|
+
data: {
|
|
58
|
+
bookingId: string;
|
|
59
|
+
bookingNumber: string;
|
|
60
|
+
status: "cancelled" | "draft" | "on_hold" | "confirmed" | "in_progress" | "completed" | "expired";
|
|
61
|
+
sellCurrency: string;
|
|
62
|
+
sellAmountCents: number | null;
|
|
63
|
+
startDate: string | null;
|
|
64
|
+
endDate: string | null;
|
|
65
|
+
pax: number | null;
|
|
66
|
+
confirmedAt: string | null;
|
|
67
|
+
cancelledAt: string | null;
|
|
68
|
+
completedAt: string | null;
|
|
69
|
+
participants: {
|
|
70
|
+
id: string;
|
|
71
|
+
participantType: "staff" | "other" | "traveler" | "booker" | "contact" | "occupant";
|
|
72
|
+
firstName: string;
|
|
73
|
+
lastName: string;
|
|
74
|
+
isPrimary: boolean;
|
|
75
|
+
}[];
|
|
76
|
+
items: {
|
|
77
|
+
id: string;
|
|
78
|
+
title: string;
|
|
79
|
+
description: string | null;
|
|
80
|
+
itemType: "other" | "unit" | "extra" | "service" | "fee" | "tax" | "discount" | "adjustment" | "accommodation" | "transport";
|
|
81
|
+
status: "cancelled" | "draft" | "on_hold" | "confirmed" | "expired" | "fulfilled";
|
|
82
|
+
serviceDate: string | null;
|
|
83
|
+
startsAt: string | null;
|
|
84
|
+
endsAt: string | null;
|
|
85
|
+
quantity: number;
|
|
86
|
+
sellCurrency: string;
|
|
87
|
+
unitSellAmountCents: number | null;
|
|
88
|
+
totalSellAmountCents: number | null;
|
|
89
|
+
costCurrency: string | null;
|
|
90
|
+
unitCostAmountCents: number | null;
|
|
91
|
+
totalCostAmountCents: number | null;
|
|
92
|
+
notes: string | null;
|
|
93
|
+
productId: string | null;
|
|
94
|
+
optionId: string | null;
|
|
95
|
+
optionUnitId: string | null;
|
|
96
|
+
pricingCategoryId: string | null;
|
|
97
|
+
participantLinks: {
|
|
98
|
+
id: string;
|
|
99
|
+
participantId: string;
|
|
100
|
+
role: string;
|
|
101
|
+
isPrimary: boolean;
|
|
102
|
+
}[];
|
|
103
|
+
}[];
|
|
104
|
+
documents: {
|
|
105
|
+
id: string;
|
|
106
|
+
participantId: string | null;
|
|
107
|
+
type: "visa" | "other" | "insurance" | "health" | "passport_copy";
|
|
108
|
+
fileName: string;
|
|
109
|
+
fileUrl: string;
|
|
110
|
+
}[];
|
|
111
|
+
fulfillments: {
|
|
112
|
+
id: string;
|
|
113
|
+
bookingItemId: string | null;
|
|
114
|
+
participantId: string | null;
|
|
115
|
+
fulfillmentType: "other" | "voucher" | "ticket" | "pdf" | "qr_code" | "barcode" | "mobile";
|
|
116
|
+
deliveryChannel: "email" | "other" | "download" | "api" | "wallet";
|
|
117
|
+
status: "pending" | "issued" | "reissued" | "revoked" | "failed";
|
|
118
|
+
artifactUrl: string | null;
|
|
119
|
+
}[];
|
|
120
|
+
};
|
|
121
|
+
};
|
|
122
|
+
outputFormat: "json";
|
|
123
|
+
status: import("hono/utils/http-status").ContentfulStatusCode;
|
|
124
|
+
};
|
|
125
|
+
};
|
|
45
126
|
} & {
|
|
46
127
|
"/:id": {
|
|
47
128
|
$get: {
|
|
@@ -106,11 +187,11 @@ export declare const bookingRoutes: import("hono/hono-base").HonoBase<Env, {
|
|
|
106
187
|
status: "cancelled" | "draft" | "on_hold" | "confirmed" | "in_progress" | "completed" | "expired";
|
|
107
188
|
createdAt: string;
|
|
108
189
|
updatedAt: string;
|
|
190
|
+
organizationId: string | null;
|
|
109
191
|
startDate: string | null;
|
|
110
192
|
endDate: string | null;
|
|
111
193
|
bookingNumber: string;
|
|
112
194
|
personId: string | null;
|
|
113
|
-
organizationId: string | null;
|
|
114
195
|
sourceType: "internal" | "direct" | "manual" | "affiliate" | "ota" | "reseller" | "api_partner";
|
|
115
196
|
externalBookingRef: string | null;
|
|
116
197
|
communicationLanguage: string | null;
|
|
@@ -173,11 +254,11 @@ export declare const bookingRoutes: import("hono/hono-base").HonoBase<Env, {
|
|
|
173
254
|
status: "cancelled" | "draft" | "on_hold" | "confirmed" | "in_progress" | "completed" | "expired";
|
|
174
255
|
createdAt: string;
|
|
175
256
|
updatedAt: string;
|
|
257
|
+
organizationId: string | null;
|
|
176
258
|
startDate: string | null;
|
|
177
259
|
endDate: string | null;
|
|
178
260
|
bookingNumber: string;
|
|
179
261
|
personId: string | null;
|
|
180
|
-
organizationId: string | null;
|
|
181
262
|
sourceType: "internal" | "direct" | "manual" | "affiliate" | "ota" | "reseller" | "api_partner";
|
|
182
263
|
externalBookingRef: string | null;
|
|
183
264
|
communicationLanguage: string | null;
|
|
@@ -344,11 +425,11 @@ export declare const bookingRoutes: import("hono/hono-base").HonoBase<Env, {
|
|
|
344
425
|
status: "cancelled" | "draft" | "on_hold" | "confirmed" | "in_progress" | "completed" | "expired";
|
|
345
426
|
createdAt: string;
|
|
346
427
|
updatedAt: string;
|
|
428
|
+
organizationId: string | null;
|
|
347
429
|
startDate: string | null;
|
|
348
430
|
endDate: string | null;
|
|
349
431
|
bookingNumber: string;
|
|
350
432
|
personId: string | null;
|
|
351
|
-
organizationId: string | null;
|
|
352
433
|
sourceType: "internal" | "direct" | "manual" | "affiliate" | "ota" | "reseller" | "api_partner";
|
|
353
434
|
externalBookingRef: string | null;
|
|
354
435
|
communicationLanguage: string | null;
|
|
@@ -990,12 +1071,12 @@ export declare const bookingRoutes: import("hono/hono-base").HonoBase<Env, {
|
|
|
990
1071
|
createdAt: string;
|
|
991
1072
|
updatedAt: string;
|
|
992
1073
|
email: string | null;
|
|
1074
|
+
firstName: string;
|
|
1075
|
+
lastName: string;
|
|
993
1076
|
personId: string | null;
|
|
994
1077
|
bookingId: string;
|
|
995
1078
|
participantType: "staff" | "other" | "traveler" | "booker" | "contact" | "occupant";
|
|
996
1079
|
travelerCategory: "other" | "adult" | "child" | "infant" | "senior" | null;
|
|
997
|
-
firstName: string;
|
|
998
|
-
lastName: string;
|
|
999
1080
|
phone: string | null;
|
|
1000
1081
|
preferredLanguage: string | null;
|
|
1001
1082
|
accessibilityNeeds: string | null;
|
|
@@ -1440,11 +1521,11 @@ export declare const bookingRoutes: import("hono/hono-base").HonoBase<Env, {
|
|
|
1440
1521
|
notes: string | null;
|
|
1441
1522
|
createdAt: string;
|
|
1442
1523
|
updatedAt: string;
|
|
1443
|
-
sellCurrency: string;
|
|
1444
|
-
bookingId: string;
|
|
1445
1524
|
metadata: {
|
|
1446
1525
|
[x: string]: import("hono/utils/types").JSONValue;
|
|
1447
1526
|
} | null;
|
|
1527
|
+
sellCurrency: string;
|
|
1528
|
+
bookingId: string;
|
|
1448
1529
|
title: string;
|
|
1449
1530
|
description: string | null;
|
|
1450
1531
|
itemType: "other" | "unit" | "extra" | "service" | "fee" | "tax" | "discount" | "adjustment" | "accommodation" | "transport";
|
|
@@ -1605,10 +1686,10 @@ export declare const bookingRoutes: import("hono/hono-base").HonoBase<Env, {
|
|
|
1605
1686
|
data: {
|
|
1606
1687
|
id: string;
|
|
1607
1688
|
createdAt: string;
|
|
1689
|
+
role: "other" | "traveler" | "occupant" | "primary_contact" | "service_assignee" | "beneficiary";
|
|
1608
1690
|
isPrimary: boolean;
|
|
1609
1691
|
participantId: string;
|
|
1610
1692
|
bookingItemId: string;
|
|
1611
|
-
role: "other" | "traveler" | "occupant" | "primary_contact" | "service_assignee" | "beneficiary";
|
|
1612
1693
|
};
|
|
1613
1694
|
};
|
|
1614
1695
|
outputFormat: "json";
|
|
@@ -1663,7 +1744,7 @@ export declare const bookingRoutes: import("hono/hono-base").HonoBase<Env, {
|
|
|
1663
1744
|
bookingId: string;
|
|
1664
1745
|
supplierServiceId: string | null;
|
|
1665
1746
|
serviceName: string;
|
|
1666
|
-
status: "cancelled" | "
|
|
1747
|
+
status: "cancelled" | "pending" | "confirmed" | "rejected";
|
|
1667
1748
|
supplierReference: string | null;
|
|
1668
1749
|
costCurrency: string;
|
|
1669
1750
|
costAmountCents: number;
|
|
@@ -1699,7 +1780,7 @@ export declare const bookingRoutes: import("hono/hono-base").HonoBase<Env, {
|
|
|
1699
1780
|
output: {
|
|
1700
1781
|
data: {
|
|
1701
1782
|
id: string;
|
|
1702
|
-
status: "cancelled" | "
|
|
1783
|
+
status: "cancelled" | "pending" | "confirmed" | "rejected";
|
|
1703
1784
|
notes: string | null;
|
|
1704
1785
|
createdAt: string;
|
|
1705
1786
|
updatedAt: string;
|
|
@@ -1745,7 +1826,7 @@ export declare const bookingRoutes: import("hono/hono-base").HonoBase<Env, {
|
|
|
1745
1826
|
bookingId: string;
|
|
1746
1827
|
supplierServiceId: string | null;
|
|
1747
1828
|
serviceName: string;
|
|
1748
|
-
status: "cancelled" | "
|
|
1829
|
+
status: "cancelled" | "pending" | "confirmed" | "rejected";
|
|
1749
1830
|
supplierReference: string | null;
|
|
1750
1831
|
costCurrency: string;
|
|
1751
1832
|
costAmountCents: number;
|
|
@@ -1774,7 +1855,7 @@ export declare const bookingRoutes: import("hono/hono-base").HonoBase<Env, {
|
|
|
1774
1855
|
bookingItemId: string | null;
|
|
1775
1856
|
participantId: string | null;
|
|
1776
1857
|
fulfillmentType: "other" | "voucher" | "ticket" | "pdf" | "qr_code" | "barcode" | "mobile";
|
|
1777
|
-
deliveryChannel: "
|
|
1858
|
+
deliveryChannel: "email" | "other" | "download" | "api" | "wallet";
|
|
1778
1859
|
status: "pending" | "issued" | "reissued" | "revoked" | "failed";
|
|
1779
1860
|
artifactUrl: string | null;
|
|
1780
1861
|
payload: {
|
|
@@ -1819,7 +1900,7 @@ export declare const bookingRoutes: import("hono/hono-base").HonoBase<Env, {
|
|
|
1819
1900
|
participantId: string | null;
|
|
1820
1901
|
bookingItemId: string | null;
|
|
1821
1902
|
fulfillmentType: "other" | "voucher" | "ticket" | "pdf" | "qr_code" | "barcode" | "mobile";
|
|
1822
|
-
deliveryChannel: "
|
|
1903
|
+
deliveryChannel: "email" | "other" | "download" | "api" | "wallet";
|
|
1823
1904
|
artifactUrl: string | null;
|
|
1824
1905
|
payload: {
|
|
1825
1906
|
[x: string]: import("hono/utils/types").JSONValue;
|
|
@@ -1862,7 +1943,7 @@ export declare const bookingRoutes: import("hono/hono-base").HonoBase<Env, {
|
|
|
1862
1943
|
bookingItemId: string | null;
|
|
1863
1944
|
participantId: string | null;
|
|
1864
1945
|
fulfillmentType: "other" | "voucher" | "ticket" | "pdf" | "qr_code" | "barcode" | "mobile";
|
|
1865
|
-
deliveryChannel: "
|
|
1946
|
+
deliveryChannel: "email" | "other" | "download" | "api" | "wallet";
|
|
1866
1947
|
status: "pending" | "issued" | "reissued" | "revoked" | "failed";
|
|
1867
1948
|
artifactUrl: string | null;
|
|
1868
1949
|
payload: {
|
|
@@ -1930,12 +2011,12 @@ export declare const bookingRoutes: import("hono/hono-base").HonoBase<Env, {
|
|
|
1930
2011
|
id: string;
|
|
1931
2012
|
createdAt: string;
|
|
1932
2013
|
method: "other" | "manual" | "api" | "scan";
|
|
1933
|
-
redeemedAt: string;
|
|
1934
|
-
bookingId: string;
|
|
1935
|
-
participantId: string | null;
|
|
1936
2014
|
metadata: {
|
|
1937
2015
|
[x: string]: import("hono/utils/types").JSONValue;
|
|
1938
2016
|
} | null;
|
|
2017
|
+
redeemedAt: string;
|
|
2018
|
+
bookingId: string;
|
|
2019
|
+
participantId: string | null;
|
|
1939
2020
|
bookingItemId: string | null;
|
|
1940
2021
|
redeemedBy: string | null;
|
|
1941
2022
|
location: string | null;
|
|
@@ -2084,11 +2165,11 @@ export declare const bookingRoutes: import("hono/hono-base").HonoBase<Env, {
|
|
|
2084
2165
|
id: string;
|
|
2085
2166
|
notes: string | null;
|
|
2086
2167
|
createdAt: string;
|
|
2168
|
+
expiresAt: string | null;
|
|
2087
2169
|
bookingId: string;
|
|
2088
2170
|
participantId: string | null;
|
|
2089
2171
|
fileName: string;
|
|
2090
2172
|
fileUrl: string;
|
|
2091
|
-
expiresAt: string | null;
|
|
2092
2173
|
};
|
|
2093
2174
|
};
|
|
2094
2175
|
outputFormat: "json";
|
package/dist/routes.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../src/routes.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AAC7D,OAAO,EAAE,KAAK,GAAG,EAAiB,MAAM,oBAAoB,CAAA;
|
|
1
|
+
{"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../src/routes.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AAC7D,OAAO,EAAE,KAAK,GAAG,EAAiB,MAAM,oBAAoB,CAAA;AA2J5D,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qCA44BtB,CAAA;AAEJ,MAAM,MAAM,aAAa,GAAG,OAAO,aAAa,CAAA;AAChD,MAAM,MAAM,mBAAmB,GAAG,OAAO,mBAAmB,CAAA"}
|
package/dist/routes.js
CHANGED
|
@@ -4,7 +4,8 @@ import { createBookingPiiService } from "./pii.js";
|
|
|
4
4
|
import { getRuntimeEnv } from "./routes-shared.js";
|
|
5
5
|
import { bookingPiiAccessLog } from "./schema.js";
|
|
6
6
|
import { bookingsService } from "./service.js";
|
|
7
|
-
import {
|
|
7
|
+
import { publicBookingsService } from "./service-public.js";
|
|
8
|
+
import { bookingListQuerySchema, cancelBookingSchema, confirmBookingSchema, convertProductSchema, createBookingSchema, expireBookingSchema, expireStaleBookingsSchema, extendBookingHoldSchema, insertBookingDocumentSchema, insertBookingFulfillmentSchema, insertBookingItemParticipantSchema, insertBookingItemSchema, insertBookingNoteSchema, insertParticipantSchema, insertPassengerSchema, insertSupplierStatusSchema, internalBookingOverviewLookupQuerySchema, recordBookingRedemptionSchema, reserveBookingFromTransactionSchema, reserveBookingSchema, updateBookingFulfillmentSchema, updateBookingItemSchema, updateBookingSchema, updateBookingStatusSchema, updateParticipantSchema, updatePassengerSchema, updateSupplierStatusSchema, upsertParticipantTravelDetailsSchema, } from "./validation.js";
|
|
8
9
|
function hasPiiScope(scopes, action) {
|
|
9
10
|
if (!scopes || scopes.length === 0) {
|
|
10
11
|
return false;
|
|
@@ -97,6 +98,14 @@ export const bookingRoutes = new Hono()
|
|
|
97
98
|
.get("/", async (c) => {
|
|
98
99
|
const query = bookingListQuerySchema.parse(Object.fromEntries(new URL(c.req.url).searchParams));
|
|
99
100
|
return c.json(await bookingsService.listBookings(c.get("db"), query));
|
|
101
|
+
})
|
|
102
|
+
// 1a. GET /overview — Internal/admin booking overview lookup
|
|
103
|
+
.get("/overview", async (c) => {
|
|
104
|
+
const overview = await publicBookingsService.getOverviewByLookup(c.get("db"), internalBookingOverviewLookupQuerySchema.parse(Object.fromEntries(new URL(c.req.url).searchParams)));
|
|
105
|
+
if (!overview) {
|
|
106
|
+
return c.json({ error: "Booking overview not found" }, 404);
|
|
107
|
+
}
|
|
108
|
+
return c.json({ data: overview });
|
|
100
109
|
})
|
|
101
110
|
// 2. GET /:id — Get single booking
|
|
102
111
|
.get("/:id", async (c) => {
|
|
@@ -151,11 +151,11 @@ export declare const bookingParticipantTravelDetailInsertSchema: z.ZodObject<{
|
|
|
151
151
|
isLeadTraveler: z.ZodDefault<z.ZodBoolean>;
|
|
152
152
|
}, z.core.$strip>;
|
|
153
153
|
export declare const bookingParticipantTravelDetailUpdateSchema: z.ZodObject<{
|
|
154
|
-
|
|
155
|
-
identityEncrypted: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
154
|
+
dietaryEncrypted: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
156
155
|
enc: z.ZodString;
|
|
157
156
|
}, z.core.$strip>>>>>;
|
|
158
|
-
|
|
157
|
+
isLeadTraveler: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
158
|
+
identityEncrypted: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
159
159
|
enc: z.ZodString;
|
|
160
160
|
}, z.core.$strip>>>>>;
|
|
161
161
|
}, z.core.$strip>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"travel-details.d.ts","sourceRoot":"","sources":["../../src/schema/travel-details.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"travel-details.d.ts","sourceRoot":"","sources":["../../src/schema/travel-details.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAIvB,eAAO,MAAM,gCAAgC;;;;;iBAK3C,CAAA;AAEF,eAAO,MAAM,+BAA+B;;iBAE1C,CAAA;AAEF,eAAO,MAAM,6CAA6C;;;;;;;;;;iBAUxD,CAAA;AAEF,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAa3C,CAAA;AASD,eAAO,MAAM,0CAA0C;;;;;;;;;iBAA2C,CAAA;AAClG,eAAO,MAAM,0CAA0C;;;;;;;;iBAEvB,CAAA;AAChC,eAAO,MAAM,0CAA0C;;;;;;;;;;;iBAInD,CAAA;AAEJ,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gCAAgC,CAAC,CAAA;AACzF,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,+BAA+B,CAAC,CAAA;AACvF,MAAM,MAAM,8BAA8B,GAAG,OAAO,+BAA+B,CAAC,YAAY,CAAA;AAChG,MAAM,MAAM,iCAAiC,GAAG,OAAO,+BAA+B,CAAC,YAAY,CAAA;AACnG,MAAM,MAAM,uCAAuC,GAAG,CAAC,CAAC,KAAK,CAC3D,OAAO,6CAA6C,CACrD,CAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { kmsEnvelopeSchema } from "@voyantjs/db/schema/iam
|
|
1
|
+
import { kmsEnvelopeSchema } from "@voyantjs/db/schema/iam";
|
|
2
2
|
import { boolean, index, jsonb, pgTable, text, timestamp } from "drizzle-orm/pg-core";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
import { bookingParticipants } from "../schema.js";
|
package/dist/schema-items.d.ts
CHANGED
|
@@ -841,7 +841,7 @@ export declare const bookingFulfillments: import("drizzle-orm/pg-core").PgTableW
|
|
|
841
841
|
tableName: "booking_fulfillments";
|
|
842
842
|
dataType: "string";
|
|
843
843
|
columnType: "PgEnumColumn";
|
|
844
|
-
data: "
|
|
844
|
+
data: "email" | "other" | "download" | "api" | "wallet";
|
|
845
845
|
driverParam: string;
|
|
846
846
|
notNull: true;
|
|
847
847
|
hasDefault: false;
|
|
@@ -75,7 +75,7 @@ export declare const bookingSupplierStatuses: import("drizzle-orm/pg-core").PgTa
|
|
|
75
75
|
tableName: "booking_supplier_statuses";
|
|
76
76
|
dataType: "string";
|
|
77
77
|
columnType: "PgEnumColumn";
|
|
78
|
-
data: "cancelled" | "
|
|
78
|
+
data: "cancelled" | "pending" | "confirmed" | "rejected";
|
|
79
79
|
driverParam: string;
|
|
80
80
|
notNull: true;
|
|
81
81
|
hasDefault: true;
|
package/dist/service-public.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { PostgresJsDatabase } from "drizzle-orm/postgres-js";
|
|
2
|
-
import type { PublicBookingOverviewLookupQuery, PublicBookingSessionMutationInput, PublicBookingSessionRepriceInput, PublicCreateBookingSessionInput, PublicUpdateBookingSessionInput, PublicUpsertBookingSessionStateInput } from "./validation-public.js";
|
|
2
|
+
import type { InternalBookingOverviewLookupQuery, PublicBookingOverviewLookupQuery, PublicBookingSessionMutationInput, PublicBookingSessionRepriceInput, PublicCreateBookingSessionInput, PublicUpdateBookingSessionInput, PublicUpsertBookingSessionStateInput } from "./validation-public.js";
|
|
3
3
|
export declare const publicBookingsService: {
|
|
4
4
|
createSession(db: PostgresJsDatabase, input: PublicCreateBookingSessionInput, userId?: string): Promise<{
|
|
5
5
|
status: Exclude<string, "ok">;
|
|
@@ -700,7 +700,71 @@ export declare const publicBookingsService: {
|
|
|
700
700
|
bookingItemId: string | null;
|
|
701
701
|
participantId: string | null;
|
|
702
702
|
fulfillmentType: "other" | "voucher" | "ticket" | "pdf" | "qr_code" | "barcode" | "mobile";
|
|
703
|
-
deliveryChannel: "
|
|
703
|
+
deliveryChannel: "email" | "other" | "download" | "api" | "wallet";
|
|
704
|
+
status: "pending" | "issued" | "reissued" | "revoked" | "failed";
|
|
705
|
+
artifactUrl: string | null;
|
|
706
|
+
}[];
|
|
707
|
+
} | null>;
|
|
708
|
+
getOverviewByLookup(db: PostgresJsDatabase, query: InternalBookingOverviewLookupQuery): Promise<{
|
|
709
|
+
bookingId: string;
|
|
710
|
+
bookingNumber: string;
|
|
711
|
+
status: "cancelled" | "draft" | "on_hold" | "confirmed" | "in_progress" | "completed" | "expired";
|
|
712
|
+
sellCurrency: string;
|
|
713
|
+
sellAmountCents: number | null;
|
|
714
|
+
startDate: string | null;
|
|
715
|
+
endDate: string | null;
|
|
716
|
+
pax: number | null;
|
|
717
|
+
confirmedAt: string | null;
|
|
718
|
+
cancelledAt: string | null;
|
|
719
|
+
completedAt: string | null;
|
|
720
|
+
participants: {
|
|
721
|
+
id: string;
|
|
722
|
+
participantType: "staff" | "other" | "traveler" | "booker" | "contact" | "occupant";
|
|
723
|
+
firstName: string;
|
|
724
|
+
lastName: string;
|
|
725
|
+
isPrimary: boolean;
|
|
726
|
+
}[];
|
|
727
|
+
items: {
|
|
728
|
+
id: string;
|
|
729
|
+
title: string;
|
|
730
|
+
description: string | null;
|
|
731
|
+
itemType: "other" | "unit" | "extra" | "service" | "fee" | "tax" | "discount" | "adjustment" | "accommodation" | "transport";
|
|
732
|
+
status: "cancelled" | "draft" | "on_hold" | "confirmed" | "expired" | "fulfilled";
|
|
733
|
+
serviceDate: string | null;
|
|
734
|
+
startsAt: string | null;
|
|
735
|
+
endsAt: string | null;
|
|
736
|
+
quantity: number;
|
|
737
|
+
sellCurrency: string;
|
|
738
|
+
unitSellAmountCents: number | null;
|
|
739
|
+
totalSellAmountCents: number | null;
|
|
740
|
+
costCurrency: string | null;
|
|
741
|
+
unitCostAmountCents: number | null;
|
|
742
|
+
totalCostAmountCents: number | null;
|
|
743
|
+
notes: string | null;
|
|
744
|
+
productId: string | null;
|
|
745
|
+
optionId: string | null;
|
|
746
|
+
optionUnitId: string | null;
|
|
747
|
+
pricingCategoryId: string | null;
|
|
748
|
+
participantLinks: {
|
|
749
|
+
id: string;
|
|
750
|
+
participantId: string;
|
|
751
|
+
role: string;
|
|
752
|
+
isPrimary: boolean;
|
|
753
|
+
}[];
|
|
754
|
+
}[];
|
|
755
|
+
documents: {
|
|
756
|
+
id: string;
|
|
757
|
+
participantId: string | null;
|
|
758
|
+
type: "visa" | "other" | "insurance" | "health" | "passport_copy";
|
|
759
|
+
fileName: string;
|
|
760
|
+
fileUrl: string;
|
|
761
|
+
}[];
|
|
762
|
+
fulfillments: {
|
|
763
|
+
id: string;
|
|
764
|
+
bookingItemId: string | null;
|
|
765
|
+
participantId: string | null;
|
|
766
|
+
fulfillmentType: "other" | "voucher" | "ticket" | "pdf" | "qr_code" | "barcode" | "mobile";
|
|
767
|
+
deliveryChannel: "email" | "other" | "download" | "api" | "wallet";
|
|
704
768
|
status: "pending" | "issued" | "reissued" | "revoked" | "failed";
|
|
705
769
|
artifactUrl: string | null;
|
|
706
770
|
}[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service-public.d.ts","sourceRoot":"","sources":["../src/service-public.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAoBjE,OAAO,KAAK,EACV,gCAAgC,EAChC,iCAAiC,EACjC,gCAAgC,EAEhC,+BAA+B,EAC/B,+BAA+B,EAC/B,oCAAoC,EACrC,MAAM,wBAAwB,CAAA;
|
|
1
|
+
{"version":3,"file":"service-public.d.ts","sourceRoot":"","sources":["../src/service-public.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAoBjE,OAAO,KAAK,EACV,kCAAkC,EAClC,gCAAgC,EAChC,iCAAiC,EACjC,gCAAgC,EAEhC,+BAA+B,EAC/B,+BAA+B,EAC/B,oCAAoC,EACrC,MAAM,wBAAwB,CAAA;AAyuB/B,eAAO,MAAM,qBAAqB;sBAE1B,kBAAkB,SACf,+BAA+B,WAC7B,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAlHT,MAAM;mCACK,MAAM;0BACf,MAAM;+BACD,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uBAuLH,kBAAkB,aAAa,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oBA1LhD,MAAM;+BACK,MAAM;sBACf,MAAM;2BACD,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBA2LI,kBAAkB,aAAa,MAAM;;;;;;;;;;2BAUzD,kBAAkB,aACX,MAAM,SACV,oCAAoC;;;;;;;;;;;;;;;;sBAYvC,kBAAkB,aACX,MAAM,SACV,+BA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AM;2BACD,OAAO;;;;;;;;;;;;;;;;;;;;4BAw9BQ,kBAAkB,SAAS,kCAAkC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oBA39BnF,MAAM;+BACK,MAAM;sBACf,MAAM;2BACD,OAAO;;;;;;;;;;;;;;;;;;;;CA29BvB,CAAA"}
|
package/dist/service-public.js
CHANGED
|
@@ -124,6 +124,132 @@ async function generateBookingNumber(db) {
|
|
|
124
124
|
}
|
|
125
125
|
throw new Error("Unable to generate a unique booking number");
|
|
126
126
|
}
|
|
127
|
+
async function buildOverviewSnapshot(db, query) {
|
|
128
|
+
const bookingLookupNumber = query.bookingNumber ?? query.bookingCode ?? null;
|
|
129
|
+
const [booking] = await db
|
|
130
|
+
.select()
|
|
131
|
+
.from(bookings)
|
|
132
|
+
.where(query.bookingId
|
|
133
|
+
? eq(bookings.id, query.bookingId)
|
|
134
|
+
: bookingLookupNumber
|
|
135
|
+
? eq(bookings.bookingNumber, bookingLookupNumber)
|
|
136
|
+
: eq(bookings.id, "__missing__"))
|
|
137
|
+
.limit(1);
|
|
138
|
+
if (!booking) {
|
|
139
|
+
return null;
|
|
140
|
+
}
|
|
141
|
+
const [participants, items, itemParticipantLinks, documents, fulfillments] = await Promise.all([
|
|
142
|
+
db
|
|
143
|
+
.select()
|
|
144
|
+
.from(bookingParticipants)
|
|
145
|
+
.where(eq(bookingParticipants.bookingId, booking.id))
|
|
146
|
+
.orderBy(asc(bookingParticipants.createdAt)),
|
|
147
|
+
db
|
|
148
|
+
.select()
|
|
149
|
+
.from(bookingItems)
|
|
150
|
+
.where(eq(bookingItems.bookingId, booking.id))
|
|
151
|
+
.orderBy(asc(bookingItems.createdAt)),
|
|
152
|
+
db
|
|
153
|
+
.select({
|
|
154
|
+
id: bookingItemParticipants.id,
|
|
155
|
+
bookingItemId: bookingItemParticipants.bookingItemId,
|
|
156
|
+
participantId: bookingItemParticipants.participantId,
|
|
157
|
+
role: bookingItemParticipants.role,
|
|
158
|
+
isPrimary: bookingItemParticipants.isPrimary,
|
|
159
|
+
})
|
|
160
|
+
.from(bookingItemParticipants)
|
|
161
|
+
.innerJoin(bookingItems, eq(bookingItems.id, bookingItemParticipants.bookingItemId))
|
|
162
|
+
.where(eq(bookingItems.bookingId, booking.id))
|
|
163
|
+
.orderBy(asc(bookingItemParticipants.createdAt)),
|
|
164
|
+
db
|
|
165
|
+
.select()
|
|
166
|
+
.from(bookingDocuments)
|
|
167
|
+
.where(eq(bookingDocuments.bookingId, booking.id))
|
|
168
|
+
.orderBy(asc(bookingDocuments.createdAt)),
|
|
169
|
+
db
|
|
170
|
+
.select()
|
|
171
|
+
.from(bookingFulfillments)
|
|
172
|
+
.where(eq(bookingFulfillments.bookingId, booking.id))
|
|
173
|
+
.orderBy(asc(bookingFulfillments.createdAt)),
|
|
174
|
+
]);
|
|
175
|
+
const email = query.email?.trim().toLowerCase() ?? null;
|
|
176
|
+
if (email) {
|
|
177
|
+
const authorized = participants.some((participant) => participant.email?.toLowerCase() === email);
|
|
178
|
+
if (!authorized) {
|
|
179
|
+
return null;
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
const itemLinksByItemId = new Map();
|
|
183
|
+
for (const link of itemParticipantLinks) {
|
|
184
|
+
const existing = itemLinksByItemId.get(link.bookingItemId) ?? [];
|
|
185
|
+
existing.push({
|
|
186
|
+
id: link.id,
|
|
187
|
+
participantId: link.participantId,
|
|
188
|
+
role: link.role,
|
|
189
|
+
isPrimary: link.isPrimary,
|
|
190
|
+
});
|
|
191
|
+
itemLinksByItemId.set(link.bookingItemId, existing);
|
|
192
|
+
}
|
|
193
|
+
return {
|
|
194
|
+
bookingId: booking.id,
|
|
195
|
+
bookingNumber: booking.bookingNumber,
|
|
196
|
+
status: booking.status,
|
|
197
|
+
sellCurrency: booking.sellCurrency,
|
|
198
|
+
sellAmountCents: booking.sellAmountCents ?? null,
|
|
199
|
+
startDate: normalizeDate(booking.startDate),
|
|
200
|
+
endDate: normalizeDate(booking.endDate),
|
|
201
|
+
pax: booking.pax ?? null,
|
|
202
|
+
confirmedAt: normalizeDateTime(booking.confirmedAt),
|
|
203
|
+
cancelledAt: normalizeDateTime(booking.cancelledAt),
|
|
204
|
+
completedAt: normalizeDateTime(booking.completedAt),
|
|
205
|
+
participants: participants.map((participant) => ({
|
|
206
|
+
id: participant.id,
|
|
207
|
+
participantType: participant.participantType,
|
|
208
|
+
firstName: participant.firstName,
|
|
209
|
+
lastName: participant.lastName,
|
|
210
|
+
isPrimary: participant.isPrimary,
|
|
211
|
+
})),
|
|
212
|
+
items: items.map((item) => ({
|
|
213
|
+
id: item.id,
|
|
214
|
+
title: item.title,
|
|
215
|
+
description: item.description ?? null,
|
|
216
|
+
itemType: item.itemType,
|
|
217
|
+
status: item.status,
|
|
218
|
+
serviceDate: normalizeDate(item.serviceDate),
|
|
219
|
+
startsAt: normalizeDateTime(item.startsAt),
|
|
220
|
+
endsAt: normalizeDateTime(item.endsAt),
|
|
221
|
+
quantity: item.quantity,
|
|
222
|
+
sellCurrency: item.sellCurrency,
|
|
223
|
+
unitSellAmountCents: item.unitSellAmountCents ?? null,
|
|
224
|
+
totalSellAmountCents: item.totalSellAmountCents ?? null,
|
|
225
|
+
costCurrency: item.costCurrency ?? null,
|
|
226
|
+
unitCostAmountCents: item.unitCostAmountCents ?? null,
|
|
227
|
+
totalCostAmountCents: item.totalCostAmountCents ?? null,
|
|
228
|
+
notes: item.notes ?? null,
|
|
229
|
+
productId: item.productId ?? null,
|
|
230
|
+
optionId: item.optionId ?? null,
|
|
231
|
+
optionUnitId: item.optionUnitId ?? null,
|
|
232
|
+
pricingCategoryId: item.pricingCategoryId ?? null,
|
|
233
|
+
participantLinks: itemLinksByItemId.get(item.id) ?? [],
|
|
234
|
+
})),
|
|
235
|
+
documents: documents.map((document) => ({
|
|
236
|
+
id: document.id,
|
|
237
|
+
participantId: document.participantId ?? null,
|
|
238
|
+
type: document.type,
|
|
239
|
+
fileName: document.fileName,
|
|
240
|
+
fileUrl: document.fileUrl,
|
|
241
|
+
})),
|
|
242
|
+
fulfillments: fulfillments.map((fulfillment) => ({
|
|
243
|
+
id: fulfillment.id,
|
|
244
|
+
bookingItemId: fulfillment.bookingItemId ?? null,
|
|
245
|
+
participantId: fulfillment.participantId ?? null,
|
|
246
|
+
fulfillmentType: fulfillment.fulfillmentType,
|
|
247
|
+
deliveryChannel: fulfillment.deliveryChannel,
|
|
248
|
+
status: fulfillment.status,
|
|
249
|
+
artifactUrl: fulfillment.artifactUrl ?? null,
|
|
250
|
+
})),
|
|
251
|
+
};
|
|
252
|
+
}
|
|
127
253
|
function buildUnitWarnings(unit, quantity, sessionPax) {
|
|
128
254
|
const warnings = [];
|
|
129
255
|
if (!unit) {
|
|
@@ -766,122 +892,9 @@ export const publicBookingsService = {
|
|
|
766
892
|
return session ? { status: "ok", session } : { status: "not_found" };
|
|
767
893
|
},
|
|
768
894
|
async getOverview(db, query) {
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
.limit(1);
|
|
774
|
-
if (!booking) {
|
|
775
|
-
return null;
|
|
776
|
-
}
|
|
777
|
-
const [participants, items, itemParticipantLinks, documents, fulfillments] = await Promise.all([
|
|
778
|
-
db
|
|
779
|
-
.select()
|
|
780
|
-
.from(bookingParticipants)
|
|
781
|
-
.where(eq(bookingParticipants.bookingId, booking.id))
|
|
782
|
-
.orderBy(asc(bookingParticipants.createdAt)),
|
|
783
|
-
db
|
|
784
|
-
.select()
|
|
785
|
-
.from(bookingItems)
|
|
786
|
-
.where(eq(bookingItems.bookingId, booking.id))
|
|
787
|
-
.orderBy(asc(bookingItems.createdAt)),
|
|
788
|
-
db
|
|
789
|
-
.select({
|
|
790
|
-
id: bookingItemParticipants.id,
|
|
791
|
-
bookingItemId: bookingItemParticipants.bookingItemId,
|
|
792
|
-
participantId: bookingItemParticipants.participantId,
|
|
793
|
-
role: bookingItemParticipants.role,
|
|
794
|
-
isPrimary: bookingItemParticipants.isPrimary,
|
|
795
|
-
})
|
|
796
|
-
.from(bookingItemParticipants)
|
|
797
|
-
.innerJoin(bookingItems, eq(bookingItems.id, bookingItemParticipants.bookingItemId))
|
|
798
|
-
.where(eq(bookingItems.bookingId, booking.id))
|
|
799
|
-
.orderBy(asc(bookingItemParticipants.createdAt)),
|
|
800
|
-
db
|
|
801
|
-
.select()
|
|
802
|
-
.from(bookingDocuments)
|
|
803
|
-
.where(eq(bookingDocuments.bookingId, booking.id))
|
|
804
|
-
.orderBy(asc(bookingDocuments.createdAt)),
|
|
805
|
-
db
|
|
806
|
-
.select()
|
|
807
|
-
.from(bookingFulfillments)
|
|
808
|
-
.where(eq(bookingFulfillments.bookingId, booking.id))
|
|
809
|
-
.orderBy(asc(bookingFulfillments.createdAt)),
|
|
810
|
-
]);
|
|
811
|
-
const email = query.email.trim().toLowerCase();
|
|
812
|
-
const authorized = participants.some((participant) => participant.email?.toLowerCase() === email);
|
|
813
|
-
if (!authorized) {
|
|
814
|
-
return null;
|
|
815
|
-
}
|
|
816
|
-
const itemLinksByItemId = new Map();
|
|
817
|
-
for (const link of itemParticipantLinks) {
|
|
818
|
-
const existing = itemLinksByItemId.get(link.bookingItemId) ?? [];
|
|
819
|
-
existing.push({
|
|
820
|
-
id: link.id,
|
|
821
|
-
participantId: link.participantId,
|
|
822
|
-
role: link.role,
|
|
823
|
-
isPrimary: link.isPrimary,
|
|
824
|
-
});
|
|
825
|
-
itemLinksByItemId.set(link.bookingItemId, existing);
|
|
826
|
-
}
|
|
827
|
-
return {
|
|
828
|
-
bookingId: booking.id,
|
|
829
|
-
bookingNumber: booking.bookingNumber,
|
|
830
|
-
status: booking.status,
|
|
831
|
-
sellCurrency: booking.sellCurrency,
|
|
832
|
-
sellAmountCents: booking.sellAmountCents ?? null,
|
|
833
|
-
startDate: normalizeDate(booking.startDate),
|
|
834
|
-
endDate: normalizeDate(booking.endDate),
|
|
835
|
-
pax: booking.pax ?? null,
|
|
836
|
-
confirmedAt: normalizeDateTime(booking.confirmedAt),
|
|
837
|
-
cancelledAt: normalizeDateTime(booking.cancelledAt),
|
|
838
|
-
completedAt: normalizeDateTime(booking.completedAt),
|
|
839
|
-
participants: participants.map((participant) => ({
|
|
840
|
-
id: participant.id,
|
|
841
|
-
participantType: participant.participantType,
|
|
842
|
-
firstName: participant.firstName,
|
|
843
|
-
lastName: participant.lastName,
|
|
844
|
-
isPrimary: participant.isPrimary,
|
|
845
|
-
})),
|
|
846
|
-
items: items.map((item) => ({
|
|
847
|
-
id: item.id,
|
|
848
|
-
title: item.title,
|
|
849
|
-
description: item.description ?? null,
|
|
850
|
-
itemType: item.itemType,
|
|
851
|
-
status: item.status,
|
|
852
|
-
serviceDate: normalizeDate(item.serviceDate),
|
|
853
|
-
startsAt: normalizeDateTime(item.startsAt),
|
|
854
|
-
endsAt: normalizeDateTime(item.endsAt),
|
|
855
|
-
quantity: item.quantity,
|
|
856
|
-
sellCurrency: item.sellCurrency,
|
|
857
|
-
unitSellAmountCents: item.unitSellAmountCents ?? null,
|
|
858
|
-
totalSellAmountCents: item.totalSellAmountCents ?? null,
|
|
859
|
-
costCurrency: item.costCurrency ?? null,
|
|
860
|
-
unitCostAmountCents: item.unitCostAmountCents ?? null,
|
|
861
|
-
totalCostAmountCents: item.totalCostAmountCents ?? null,
|
|
862
|
-
notes: item.notes ?? null,
|
|
863
|
-
productId: item.productId ?? null,
|
|
864
|
-
optionId: item.optionId ?? null,
|
|
865
|
-
optionUnitId: item.optionUnitId ?? null,
|
|
866
|
-
pricingCategoryId: item.pricingCategoryId ?? null,
|
|
867
|
-
participantLinks: itemLinksByItemId.get(item.id) ?? [],
|
|
868
|
-
})),
|
|
869
|
-
documents: documents.map((document) => ({
|
|
870
|
-
id: document.id,
|
|
871
|
-
participantId: document.participantId ?? null,
|
|
872
|
-
type: document.type,
|
|
873
|
-
fileName: document.fileName,
|
|
874
|
-
fileUrl: document.fileUrl,
|
|
875
|
-
})),
|
|
876
|
-
fulfillments: fulfillments.map((fulfillment) => ({
|
|
877
|
-
id: fulfillment.id,
|
|
878
|
-
bookingItemId: fulfillment.bookingItemId ?? null,
|
|
879
|
-
participantId: fulfillment.participantId ?? null,
|
|
880
|
-
fulfillmentType: fulfillment.fulfillmentType,
|
|
881
|
-
deliveryChannel: fulfillment.deliveryChannel,
|
|
882
|
-
status: fulfillment.status,
|
|
883
|
-
artifactUrl: fulfillment.artifactUrl ?? null,
|
|
884
|
-
})),
|
|
885
|
-
};
|
|
895
|
+
return buildOverviewSnapshot(db, query);
|
|
896
|
+
},
|
|
897
|
+
async getOverviewByLookup(db, query) {
|
|
898
|
+
return buildOverviewSnapshot(db, query);
|
|
886
899
|
},
|
|
887
900
|
};
|
package/dist/service.d.ts
CHANGED
|
@@ -99,11 +99,11 @@ export declare const bookingsService: {
|
|
|
99
99
|
status: "cancelled" | "draft" | "on_hold" | "confirmed" | "in_progress" | "completed" | "expired";
|
|
100
100
|
createdAt: Date;
|
|
101
101
|
updatedAt: Date;
|
|
102
|
+
organizationId: string | null;
|
|
102
103
|
startDate: string | null;
|
|
103
104
|
endDate: string | null;
|
|
104
105
|
bookingNumber: string;
|
|
105
106
|
personId: string | null;
|
|
106
|
-
organizationId: string | null;
|
|
107
107
|
sourceType: "internal" | "direct" | "manual" | "affiliate" | "ota" | "reseller" | "api_partner";
|
|
108
108
|
externalBookingRef: string | null;
|
|
109
109
|
communicationLanguage: string | null;
|
|
@@ -157,11 +157,11 @@ export declare const bookingsService: {
|
|
|
157
157
|
status: "cancelled" | "draft" | "on_hold" | "confirmed" | "in_progress" | "completed" | "expired";
|
|
158
158
|
createdAt: Date;
|
|
159
159
|
updatedAt: Date;
|
|
160
|
+
organizationId: string | null;
|
|
160
161
|
startDate: string | null;
|
|
161
162
|
endDate: string | null;
|
|
162
163
|
bookingNumber: string;
|
|
163
164
|
personId: string | null;
|
|
164
|
-
organizationId: string | null;
|
|
165
165
|
sourceType: "internal" | "direct" | "manual" | "affiliate" | "ota" | "reseller" | "api_partner";
|
|
166
166
|
externalBookingRef: string | null;
|
|
167
167
|
communicationLanguage: string | null;
|
|
@@ -797,11 +797,11 @@ export declare const bookingsService: {
|
|
|
797
797
|
status: "cancelled" | "draft" | "on_hold" | "confirmed" | "in_progress" | "completed" | "expired";
|
|
798
798
|
createdAt: Date;
|
|
799
799
|
updatedAt: Date;
|
|
800
|
+
organizationId: string | null;
|
|
800
801
|
startDate: string | null;
|
|
801
802
|
endDate: string | null;
|
|
802
803
|
bookingNumber: string;
|
|
803
804
|
personId: string | null;
|
|
804
|
-
organizationId: string | null;
|
|
805
805
|
sourceType: "internal" | "direct" | "manual" | "affiliate" | "ota" | "reseller" | "api_partner";
|
|
806
806
|
externalBookingRef: string | null;
|
|
807
807
|
communicationLanguage: string | null;
|
|
@@ -829,11 +829,11 @@ export declare const bookingsService: {
|
|
|
829
829
|
status: "cancelled" | "draft" | "on_hold" | "confirmed" | "in_progress" | "completed" | "expired";
|
|
830
830
|
createdAt: Date;
|
|
831
831
|
updatedAt: Date;
|
|
832
|
+
organizationId: string | null;
|
|
832
833
|
startDate: string | null;
|
|
833
834
|
endDate: string | null;
|
|
834
835
|
bookingNumber: string;
|
|
835
836
|
personId: string | null;
|
|
836
|
-
organizationId: string | null;
|
|
837
837
|
sourceType: "internal" | "direct" | "manual" | "affiliate" | "ota" | "reseller" | "api_partner";
|
|
838
838
|
externalBookingRef: string | null;
|
|
839
839
|
communicationLanguage: string | null;
|
|
@@ -1617,12 +1617,12 @@ export declare const bookingsService: {
|
|
|
1617
1617
|
createdAt: Date;
|
|
1618
1618
|
updatedAt: Date;
|
|
1619
1619
|
email: string | null;
|
|
1620
|
+
firstName: string;
|
|
1621
|
+
lastName: string;
|
|
1620
1622
|
personId: string | null;
|
|
1621
1623
|
bookingId: string;
|
|
1622
1624
|
participantType: "staff" | "other" | "traveler" | "booker" | "contact" | "occupant";
|
|
1623
1625
|
travelerCategory: "other" | "adult" | "child" | "infant" | "senior" | null;
|
|
1624
|
-
firstName: string;
|
|
1625
|
-
lastName: string;
|
|
1626
1626
|
phone: string | null;
|
|
1627
1627
|
preferredLanguage: string | null;
|
|
1628
1628
|
accessibilityNeeds: string | null;
|
|
@@ -2617,9 +2617,9 @@ export declare const bookingsService: {
|
|
|
2617
2617
|
notes: string | null;
|
|
2618
2618
|
createdAt: Date;
|
|
2619
2619
|
updatedAt: Date;
|
|
2620
|
+
metadata: Record<string, unknown> | null;
|
|
2620
2621
|
sellCurrency: string;
|
|
2621
2622
|
bookingId: string;
|
|
2622
|
-
metadata: Record<string, unknown> | null;
|
|
2623
2623
|
title: string;
|
|
2624
2624
|
description: string | null;
|
|
2625
2625
|
itemType: "other" | "unit" | "extra" | "service" | "fee" | "tax" | "discount" | "adjustment" | "accommodation" | "transport";
|
|
@@ -2883,10 +2883,10 @@ export declare const bookingsService: {
|
|
|
2883
2883
|
addItemParticipant(db: PostgresJsDatabase, itemId: string, data: CreateBookingItemParticipantInput): Promise<{
|
|
2884
2884
|
id: string;
|
|
2885
2885
|
createdAt: Date;
|
|
2886
|
+
role: "other" | "traveler" | "occupant" | "primary_contact" | "service_assignee" | "beneficiary";
|
|
2886
2887
|
isPrimary: boolean;
|
|
2887
2888
|
participantId: string;
|
|
2888
2889
|
bookingItemId: string;
|
|
2889
|
-
role: "other" | "traveler" | "occupant" | "primary_contact" | "service_assignee" | "beneficiary";
|
|
2890
2890
|
} | null | undefined>;
|
|
2891
2891
|
removeItemParticipant(db: PostgresJsDatabase, linkId: string): Promise<{
|
|
2892
2892
|
id: string;
|
|
@@ -2965,7 +2965,7 @@ export declare const bookingsService: {
|
|
|
2965
2965
|
tableName: "booking_supplier_statuses";
|
|
2966
2966
|
dataType: "string";
|
|
2967
2967
|
columnType: "PgEnumColumn";
|
|
2968
|
-
data: "cancelled" | "
|
|
2968
|
+
data: "cancelled" | "pending" | "confirmed" | "rejected";
|
|
2969
2969
|
driverParam: string;
|
|
2970
2970
|
notNull: true;
|
|
2971
2971
|
hasDefault: true;
|
|
@@ -3101,7 +3101,7 @@ export declare const bookingsService: {
|
|
|
3101
3101
|
bookingId: string;
|
|
3102
3102
|
supplierServiceId: string | null;
|
|
3103
3103
|
serviceName: string;
|
|
3104
|
-
status: "cancelled" | "
|
|
3104
|
+
status: "cancelled" | "pending" | "confirmed" | "rejected";
|
|
3105
3105
|
supplierReference: string | null;
|
|
3106
3106
|
costCurrency: string;
|
|
3107
3107
|
costAmountCents: number;
|
|
@@ -3183,7 +3183,7 @@ export declare const bookingsService: {
|
|
|
3183
3183
|
tableName: "booking_supplier_statuses";
|
|
3184
3184
|
dataType: "string";
|
|
3185
3185
|
columnType: "PgEnumColumn";
|
|
3186
|
-
data: "cancelled" | "
|
|
3186
|
+
data: "cancelled" | "pending" | "confirmed" | "rejected";
|
|
3187
3187
|
driverParam: string;
|
|
3188
3188
|
notNull: true;
|
|
3189
3189
|
hasDefault: true;
|
|
@@ -3325,7 +3325,7 @@ export declare const bookingsService: {
|
|
|
3325
3325
|
notes?: string | null;
|
|
3326
3326
|
}, userId?: string): Promise<{
|
|
3327
3327
|
id: string;
|
|
3328
|
-
status: "cancelled" | "
|
|
3328
|
+
status: "cancelled" | "pending" | "confirmed" | "rejected";
|
|
3329
3329
|
notes: string | null;
|
|
3330
3330
|
createdAt: Date;
|
|
3331
3331
|
updatedAt: Date;
|
|
@@ -3351,7 +3351,7 @@ export declare const bookingsService: {
|
|
|
3351
3351
|
bookingId: string;
|
|
3352
3352
|
supplierServiceId: string | null;
|
|
3353
3353
|
serviceName: string;
|
|
3354
|
-
status: "cancelled" | "
|
|
3354
|
+
status: "cancelled" | "pending" | "confirmed" | "rejected";
|
|
3355
3355
|
supplierReference: string | null;
|
|
3356
3356
|
costCurrency: string;
|
|
3357
3357
|
costAmountCents: number;
|
|
@@ -3451,7 +3451,7 @@ export declare const bookingsService: {
|
|
|
3451
3451
|
tableName: "booking_fulfillments";
|
|
3452
3452
|
dataType: "string";
|
|
3453
3453
|
columnType: "PgEnumColumn";
|
|
3454
|
-
data: "
|
|
3454
|
+
data: "email" | "other" | "download" | "api" | "wallet";
|
|
3455
3455
|
driverParam: string;
|
|
3456
3456
|
notNull: true;
|
|
3457
3457
|
hasDefault: false;
|
|
@@ -3590,7 +3590,7 @@ export declare const bookingsService: {
|
|
|
3590
3590
|
bookingItemId: string | null;
|
|
3591
3591
|
participantId: string | null;
|
|
3592
3592
|
fulfillmentType: "other" | "voucher" | "ticket" | "pdf" | "qr_code" | "barcode" | "mobile";
|
|
3593
|
-
deliveryChannel: "
|
|
3593
|
+
deliveryChannel: "email" | "other" | "download" | "api" | "wallet";
|
|
3594
3594
|
status: "pending" | "issued" | "reissued" | "revoked" | "failed";
|
|
3595
3595
|
artifactUrl: string | null;
|
|
3596
3596
|
payload: Record<string, unknown> | null;
|
|
@@ -3689,7 +3689,7 @@ export declare const bookingsService: {
|
|
|
3689
3689
|
tableName: "booking_fulfillments";
|
|
3690
3690
|
dataType: "string";
|
|
3691
3691
|
columnType: "PgEnumColumn";
|
|
3692
|
-
data: "
|
|
3692
|
+
data: "email" | "other" | "download" | "api" | "wallet";
|
|
3693
3693
|
driverParam: string;
|
|
3694
3694
|
notNull: true;
|
|
3695
3695
|
hasDefault: false;
|
|
@@ -3832,7 +3832,7 @@ export declare const bookingsService: {
|
|
|
3832
3832
|
participantId: string | null;
|
|
3833
3833
|
bookingItemId: string | null;
|
|
3834
3834
|
fulfillmentType: "other" | "voucher" | "ticket" | "pdf" | "qr_code" | "barcode" | "mobile";
|
|
3835
|
-
deliveryChannel: "
|
|
3835
|
+
deliveryChannel: "email" | "other" | "download" | "api" | "wallet";
|
|
3836
3836
|
artifactUrl: string | null;
|
|
3837
3837
|
payload: Record<string, unknown> | null;
|
|
3838
3838
|
issuedAt: Date | null;
|
|
@@ -3844,7 +3844,7 @@ export declare const bookingsService: {
|
|
|
3844
3844
|
bookingItemId: string | null;
|
|
3845
3845
|
participantId: string | null;
|
|
3846
3846
|
fulfillmentType: "other" | "voucher" | "ticket" | "pdf" | "qr_code" | "barcode" | "mobile";
|
|
3847
|
-
deliveryChannel: "
|
|
3847
|
+
deliveryChannel: "email" | "other" | "download" | "api" | "wallet";
|
|
3848
3848
|
status: "pending" | "issued" | "reissued" | "revoked" | "failed";
|
|
3849
3849
|
artifactUrl: string | null;
|
|
3850
3850
|
payload: Record<string, unknown> | null;
|
|
@@ -4215,10 +4215,10 @@ export declare const bookingsService: {
|
|
|
4215
4215
|
id: string;
|
|
4216
4216
|
createdAt: Date;
|
|
4217
4217
|
method: "other" | "manual" | "api" | "scan";
|
|
4218
|
+
metadata: Record<string, unknown> | null;
|
|
4218
4219
|
redeemedAt: Date;
|
|
4219
4220
|
bookingId: string;
|
|
4220
4221
|
participantId: string | null;
|
|
4221
|
-
metadata: Record<string, unknown> | null;
|
|
4222
4222
|
bookingItemId: string | null;
|
|
4223
4223
|
redeemedBy: string | null;
|
|
4224
4224
|
location: string | null;
|
|
@@ -4986,11 +4986,11 @@ export declare const bookingsService: {
|
|
|
4986
4986
|
id: string;
|
|
4987
4987
|
notes: string | null;
|
|
4988
4988
|
createdAt: Date;
|
|
4989
|
+
expiresAt: Date | null;
|
|
4989
4990
|
bookingId: string;
|
|
4990
4991
|
participantId: string | null;
|
|
4991
4992
|
fileName: string;
|
|
4992
4993
|
fileUrl: string;
|
|
4993
|
-
expiresAt: Date | null;
|
|
4994
4994
|
} | null | undefined>;
|
|
4995
4995
|
deleteDocument(db: PostgresJsDatabase, documentId: string): Promise<{
|
|
4996
4996
|
id: string;
|
|
@@ -217,6 +217,12 @@ export declare const publicBookingOverviewLookupQuerySchema: z.ZodObject<{
|
|
|
217
217
|
bookingNumber: z.ZodString;
|
|
218
218
|
email: z.ZodString;
|
|
219
219
|
}, z.core.$strip>;
|
|
220
|
+
export declare const internalBookingOverviewLookupQuerySchema: z.ZodObject<{
|
|
221
|
+
bookingId: z.ZodOptional<z.ZodString>;
|
|
222
|
+
bookingNumber: z.ZodOptional<z.ZodString>;
|
|
223
|
+
bookingCode: z.ZodOptional<z.ZodString>;
|
|
224
|
+
email: z.ZodOptional<z.ZodString>;
|
|
225
|
+
}, z.core.$strip>;
|
|
220
226
|
export declare const publicBookingSessionParticipantSchema: z.ZodObject<{
|
|
221
227
|
id: z.ZodString;
|
|
222
228
|
participantType: z.ZodEnum<{
|
|
@@ -746,9 +752,9 @@ export declare const publicBookingOverviewFulfillmentSchema: z.ZodObject<{
|
|
|
746
752
|
mobile: "mobile";
|
|
747
753
|
}>;
|
|
748
754
|
deliveryChannel: z.ZodEnum<{
|
|
755
|
+
email: "email";
|
|
749
756
|
other: "other";
|
|
750
757
|
download: "download";
|
|
751
|
-
email: "email";
|
|
752
758
|
api: "api";
|
|
753
759
|
wallet: "wallet";
|
|
754
760
|
}>;
|
|
@@ -875,9 +881,9 @@ export declare const publicBookingOverviewSchema: z.ZodObject<{
|
|
|
875
881
|
mobile: "mobile";
|
|
876
882
|
}>;
|
|
877
883
|
deliveryChannel: z.ZodEnum<{
|
|
884
|
+
email: "email";
|
|
878
885
|
other: "other";
|
|
879
886
|
download: "download";
|
|
880
|
-
email: "email";
|
|
881
887
|
api: "api";
|
|
882
888
|
wallet: "wallet";
|
|
883
889
|
}>;
|
|
@@ -898,4 +904,5 @@ export type PublicBookingSessionState = z.infer<typeof publicBookingSessionState
|
|
|
898
904
|
export type PublicUpsertBookingSessionStateInput = z.infer<typeof publicUpsertBookingSessionStateSchema>;
|
|
899
905
|
export type PublicBookingSessionRepriceInput = z.infer<typeof publicRepriceBookingSessionSchema>;
|
|
900
906
|
export type PublicBookingOverviewLookupQuery = z.infer<typeof publicBookingOverviewLookupQuerySchema>;
|
|
907
|
+
export type InternalBookingOverviewLookupQuery = z.infer<typeof internalBookingOverviewLookupQuerySchema>;
|
|
901
908
|
//# sourceMappingURL=validation-public.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validation-public.d.ts","sourceRoot":"","sources":["../src/validation-public.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAA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,CAAC,CAAA;AAClG,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,+BAA+B,CAAC,CAAA;AACvF,MAAM,MAAM,oCAAoC,GAAG,CAAC,CAAC,KAAK,CACxD,OAAO,qCAAqC,CAC7C,CAAA;AACD,MAAM,MAAM,gCAAgC,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iCAAiC,CAAC,CAAA;AAChG,MAAM,MAAM,gCAAgC,GAAG,CAAC,CAAC,KAAK,CACpD,OAAO,sCAAsC,CAC9C,CAAA;AACD,MAAM,MAAM,kCAAkC,GAAG,CAAC,CAAC,KAAK,CACtD,OAAO,wCAAwC,CAChD,CAAA"}
|
|
@@ -109,6 +109,16 @@ export const publicBookingOverviewLookupQuerySchema = z.object({
|
|
|
109
109
|
bookingNumber: z.string().min(1).max(50),
|
|
110
110
|
email: z.string().email(),
|
|
111
111
|
});
|
|
112
|
+
export const internalBookingOverviewLookupQuerySchema = z
|
|
113
|
+
.object({
|
|
114
|
+
bookingId: z.string().min(1).max(50).optional(),
|
|
115
|
+
bookingNumber: z.string().min(1).max(50).optional(),
|
|
116
|
+
bookingCode: z.string().min(1).max(50).optional(),
|
|
117
|
+
email: z.string().email().optional(),
|
|
118
|
+
})
|
|
119
|
+
.refine((value) => Boolean(value.bookingId || value.bookingNumber || value.bookingCode), {
|
|
120
|
+
message: "Provide a bookingId, bookingNumber, or bookingCode",
|
|
121
|
+
});
|
|
112
122
|
export const publicBookingSessionParticipantSchema = z.object({
|
|
113
123
|
id: z.string(),
|
|
114
124
|
participantType: bookingParticipantTypeSchema,
|
|
@@ -10,8 +10,8 @@ export declare const bookingStatusSchema: z.ZodEnum<{
|
|
|
10
10
|
}>;
|
|
11
11
|
export declare const supplierConfirmationStatusSchema: z.ZodEnum<{
|
|
12
12
|
cancelled: "cancelled";
|
|
13
|
-
confirmed: "confirmed";
|
|
14
13
|
pending: "pending";
|
|
14
|
+
confirmed: "confirmed";
|
|
15
15
|
rejected: "rejected";
|
|
16
16
|
}>;
|
|
17
17
|
export declare const bookingSourceTypeSchema: z.ZodEnum<{
|
|
@@ -89,9 +89,9 @@ export declare const bookingFulfillmentTypeSchema: z.ZodEnum<{
|
|
|
89
89
|
mobile: "mobile";
|
|
90
90
|
}>;
|
|
91
91
|
export declare const bookingFulfillmentDeliveryChannelSchema: z.ZodEnum<{
|
|
92
|
+
email: "email";
|
|
92
93
|
other: "other";
|
|
93
94
|
download: "download";
|
|
94
|
-
email: "email";
|
|
95
95
|
api: "api";
|
|
96
96
|
wallet: "wallet";
|
|
97
97
|
}>;
|
package/dist/validation.d.ts
CHANGED
|
@@ -192,11 +192,11 @@ export declare const reserveBookingItemSchema: z.ZodObject<{
|
|
|
192
192
|
metadata: z.ZodNullable<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
193
193
|
}, z.core.$strip>;
|
|
194
194
|
export declare const reserveBookingSchema: z.ZodObject<{
|
|
195
|
+
organizationId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
195
196
|
startDate: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
196
197
|
endDate: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
197
198
|
bookingNumber: z.ZodString;
|
|
198
199
|
personId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
199
|
-
organizationId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
200
200
|
sourceType: z.ZodDefault<z.ZodEnum<{
|
|
201
201
|
internal: "internal";
|
|
202
202
|
direct: "direct";
|
|
@@ -518,9 +518,9 @@ export declare const insertBookingFulfillmentSchema: z.ZodObject<{
|
|
|
518
518
|
mobile: "mobile";
|
|
519
519
|
}>;
|
|
520
520
|
deliveryChannel: z.ZodEnum<{
|
|
521
|
+
email: "email";
|
|
521
522
|
other: "other";
|
|
522
523
|
download: "download";
|
|
523
|
-
email: "email";
|
|
524
524
|
api: "api";
|
|
525
525
|
wallet: "wallet";
|
|
526
526
|
}>;
|
|
@@ -549,9 +549,9 @@ export declare const updateBookingFulfillmentSchema: z.ZodObject<{
|
|
|
549
549
|
mobile: "mobile";
|
|
550
550
|
}>>;
|
|
551
551
|
deliveryChannel: z.ZodOptional<z.ZodEnum<{
|
|
552
|
+
email: "email";
|
|
552
553
|
other: "other";
|
|
553
554
|
download: "download";
|
|
554
|
-
email: "email";
|
|
555
555
|
api: "api";
|
|
556
556
|
wallet: "wallet";
|
|
557
557
|
}>>;
|
|
@@ -598,8 +598,8 @@ export declare const insertSupplierStatusSchema: z.ZodObject<{
|
|
|
598
598
|
serviceName: z.ZodString;
|
|
599
599
|
status: z.ZodDefault<z.ZodEnum<{
|
|
600
600
|
cancelled: "cancelled";
|
|
601
|
-
confirmed: "confirmed";
|
|
602
601
|
pending: "pending";
|
|
602
|
+
confirmed: "confirmed";
|
|
603
603
|
rejected: "rejected";
|
|
604
604
|
}>>;
|
|
605
605
|
supplierReference: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
@@ -612,8 +612,8 @@ export declare const updateSupplierStatusSchema: z.ZodObject<{
|
|
|
612
612
|
serviceName: z.ZodOptional<z.ZodString>;
|
|
613
613
|
status: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
|
|
614
614
|
cancelled: "cancelled";
|
|
615
|
-
confirmed: "confirmed";
|
|
616
615
|
pending: "pending";
|
|
616
|
+
confirmed: "confirmed";
|
|
617
617
|
rejected: "rejected";
|
|
618
618
|
}>>>;
|
|
619
619
|
supplierReference: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodString>>>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@voyantjs/bookings",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.1",
|
|
4
4
|
"license": "FSL-1.1-Apache-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -49,14 +49,14 @@
|
|
|
49
49
|
"drizzle-orm": "^0.45.2",
|
|
50
50
|
"hono": "^4.12.10",
|
|
51
51
|
"zod": "^4.3.6",
|
|
52
|
-
"@voyantjs/core": "0.
|
|
53
|
-
"@voyantjs/db": "0.
|
|
54
|
-
"@voyantjs/hono": "0.
|
|
55
|
-
"@voyantjs/utils": "0.
|
|
52
|
+
"@voyantjs/core": "0.4.1",
|
|
53
|
+
"@voyantjs/db": "0.4.1",
|
|
54
|
+
"@voyantjs/hono": "0.4.1",
|
|
55
|
+
"@voyantjs/utils": "0.4.1"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
58
|
"typescript": "^6.0.2",
|
|
59
|
-
"@voyantjs/products": "0.
|
|
59
|
+
"@voyantjs/products": "0.4.1",
|
|
60
60
|
"@voyantjs/voyant-typescript-config": "0.1.0"
|
|
61
61
|
},
|
|
62
62
|
"files": [
|