@voyantjs/bookings 0.25.0 → 0.26.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/pii.d.ts +26 -0
- package/dist/pii.d.ts.map +1 -1
- package/dist/pii.js +47 -0
- package/dist/route-runtime.d.ts +16 -0
- package/dist/route-runtime.d.ts.map +1 -1
- package/dist/route-runtime.js +1 -0
- package/dist/routes-groups.d.ts +3 -3
- package/dist/routes-public.d.ts +3 -3
- package/dist/routes.d.ts +170 -24
- package/dist/routes.d.ts.map +1 -1
- package/dist/routes.js +61 -1
- package/dist/schema/travel-details.d.ts +37 -6
- package/dist/schema/travel-details.d.ts.map +1 -1
- package/dist/schema/travel-details.js +19 -0
- package/dist/schema-core.d.ts +1 -1
- package/dist/schema-core.js +1 -1
- package/dist/schema-groups.js +1 -1
- package/dist/schema-items.d.ts +2 -2
- package/dist/schema-items.js +2 -2
- package/dist/schema-operations.js +2 -2
- package/dist/schema-relations.js +5 -5
- package/dist/schema.d.ts +8 -8
- package/dist/schema.d.ts.map +1 -1
- package/dist/schema.js +8 -8
- package/dist/service-public.d.ts +8 -8
- package/dist/service.d.ts +43 -29
- package/dist/service.d.ts.map +1 -1
- package/dist/service.js +10 -1
- package/dist/validation-public.d.ts +7 -7
- package/dist/validation-shared.d.ts +3 -3
- package/dist/validation.d.ts +23 -14
- package/dist/validation.d.ts.map +1 -1
- package/dist/validation.js +4 -0
- package/package.json +6 -6
package/dist/routes.js
CHANGED
|
@@ -8,7 +8,7 @@ import { bookingPiiAccessLog } from "./schema.js";
|
|
|
8
8
|
import { bookingsService } from "./service.js";
|
|
9
9
|
import { bookingGroupsService } from "./service-groups.js";
|
|
10
10
|
import { publicBookingsService, resolveSessionPricingSnapshot } from "./service-public.js";
|
|
11
|
-
import { bookingAggregatesQuerySchema, bookingListQuerySchema, cancelBookingSchema, completeBookingSchema, confirmBookingSchema, convertProductSchema, createBookingSchema, expireBookingSchema, expireStaleBookingsSchema, extendBookingHoldSchema, insertBookingDocumentSchema, insertBookingFulfillmentSchema, insertBookingItemSchema, insertBookingItemTravelerSchema, insertBookingNoteSchema, insertSupplierStatusSchema, insertTravelerSchema, internalBookingOverviewLookupQuerySchema, overrideBookingStatusSchema, pricingPreviewSchema, recordBookingRedemptionSchema, reserveBookingFromTransactionSchema, reserveBookingSchema, startBookingSchema, updateBookingFulfillmentSchema, updateBookingItemSchema, updateBookingSchema, updateSupplierStatusSchema, updateTravelerSchema, upsertTravelerTravelDetailsSchema, } from "./validation.js";
|
|
11
|
+
import { bookingAggregatesQuerySchema, bookingListQuerySchema, cancelBookingSchema, completeBookingSchema, confirmBookingSchema, convertProductSchema, createBookingSchema, createTravelerWithTravelDetailsSchema, expireBookingSchema, expireStaleBookingsSchema, extendBookingHoldSchema, insertBookingDocumentSchema, insertBookingFulfillmentSchema, insertBookingItemSchema, insertBookingItemTravelerSchema, insertBookingNoteSchema, insertSupplierStatusSchema, insertTravelerSchema, internalBookingOverviewLookupQuerySchema, overrideBookingStatusSchema, pricingPreviewSchema, recordBookingRedemptionSchema, reserveBookingFromTransactionSchema, reserveBookingSchema, startBookingSchema, updateBookingFulfillmentSchema, updateBookingItemSchema, updateBookingSchema, updateSupplierStatusSchema, updateTravelerSchema, updateTravelerWithTravelDetailsSchema, upsertTravelerTravelDetailsSchema, } from "./validation.js";
|
|
12
12
|
function hasPiiScope(scopes, action) {
|
|
13
13
|
if (!scopes || scopes.length === 0) {
|
|
14
14
|
return false;
|
|
@@ -545,6 +545,66 @@ export const bookingRoutes = new Hono()
|
|
|
545
545
|
return c.json({ error: "Booking not found" }, 404);
|
|
546
546
|
}
|
|
547
547
|
return c.json({ data: row }, 201);
|
|
548
|
+
})
|
|
549
|
+
/**
|
|
550
|
+
* Combined "create traveler + write encrypted travel details" path.
|
|
551
|
+
* When `data.personId` is provided AND a `resolveTravelSnapshot`
|
|
552
|
+
* resolver is wired on the runtime, the route auto-snapshots
|
|
553
|
+
* dietary / accessibility / primary-passport from the linked
|
|
554
|
+
* person record. Explicit input always wins over snapshot.
|
|
555
|
+
*/
|
|
556
|
+
.post("/:id/travelers/with-travel-details", async (c) => {
|
|
557
|
+
try {
|
|
558
|
+
const data = await parseJsonBody(c, createTravelerWithTravelDetailsSchema);
|
|
559
|
+
const runtime = getRouteRuntime(c);
|
|
560
|
+
const kms = await runtime.getKmsProvider();
|
|
561
|
+
const pii = await createAuditedBookingPiiService(c, c.req.param("id"));
|
|
562
|
+
const result = await bookingsService.createTravelerWithTravelDetails(c.get("db"), c.req.param("id"), data, {
|
|
563
|
+
pii,
|
|
564
|
+
userId: c.get("userId"),
|
|
565
|
+
actorId: c.get("userId"),
|
|
566
|
+
resolveTravelSnapshot: runtime.resolveTravelSnapshot
|
|
567
|
+
? (personId) => runtime.resolveTravelSnapshot(c.get("db"), personId, { kms })
|
|
568
|
+
: undefined,
|
|
569
|
+
});
|
|
570
|
+
if (!result) {
|
|
571
|
+
return c.json({ error: "Booking not found" }, 404);
|
|
572
|
+
}
|
|
573
|
+
return c.json({ data: result }, 201);
|
|
574
|
+
}
|
|
575
|
+
catch (error) {
|
|
576
|
+
return handleKmsConfigError(c, error);
|
|
577
|
+
}
|
|
578
|
+
})
|
|
579
|
+
/**
|
|
580
|
+
* Combined "update traveler + (re-)write encrypted travel details"
|
|
581
|
+
* path. Snapshot-on-update is intentionally NOT wired here — once a
|
|
582
|
+
* booking is open, the traveler row is its own source of truth and
|
|
583
|
+
* person-record edits should not retroactively rewrite trip data.
|
|
584
|
+
*/
|
|
585
|
+
.patch("/:id/travelers/:travelerId/with-travel-details", async (c) => {
|
|
586
|
+
try {
|
|
587
|
+
const bookingId = c.req.param("id");
|
|
588
|
+
const travelerId = c.req.param("travelerId");
|
|
589
|
+
// Enforce booking↔traveler pairing before delegating to the
|
|
590
|
+
// service, which writes by traveler id only. Without this guard
|
|
591
|
+
// a caller could pass /bookings/A/travelers/<traveler-from-B>
|
|
592
|
+
// and write to B while the audit/PII context is built from A.
|
|
593
|
+
const traveler = await bookingsService.getTravelerRecordById(c.get("db"), bookingId, travelerId);
|
|
594
|
+
if (!traveler) {
|
|
595
|
+
return c.json({ error: "Traveler not found" }, 404);
|
|
596
|
+
}
|
|
597
|
+
const data = await parseJsonBody(c, updateTravelerWithTravelDetailsSchema);
|
|
598
|
+
const pii = await createAuditedBookingPiiService(c, bookingId);
|
|
599
|
+
const result = await bookingsService.updateTravelerWithTravelDetails(c.get("db"), travelerId, data, { pii, actorId: c.get("userId") });
|
|
600
|
+
if (!result) {
|
|
601
|
+
return c.json({ error: "Traveler not found" }, 404);
|
|
602
|
+
}
|
|
603
|
+
return c.json({ data: result });
|
|
604
|
+
}
|
|
605
|
+
catch (error) {
|
|
606
|
+
return handleKmsConfigError(c, error);
|
|
607
|
+
}
|
|
548
608
|
})
|
|
549
609
|
.patch("/:id/travelers/:travelerId/travel-details", async (c) => {
|
|
550
610
|
const auth = await authorizeBookingPiiAccess(c, {
|
|
@@ -1,8 +1,16 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* Plaintext shape stored inside `identityEncrypted`. Snapshotted at
|
|
4
|
+
* booking-traveler creation from the canonical `crm.people` +
|
|
5
|
+
* `crm.person_documents` records — see `passportPersonDocumentId`
|
|
6
|
+
* for provenance back to the source document row.
|
|
7
|
+
*/
|
|
2
8
|
export declare const bookingTravelerIdentitySchema: z.ZodObject<{
|
|
3
9
|
nationality: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
4
10
|
passportNumber: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
5
11
|
passportExpiry: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
12
|
+
passportIssuingCountry: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
13
|
+
passportIssuingAuthority: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
6
14
|
dateOfBirth: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
7
15
|
}, z.core.$strip>;
|
|
8
16
|
export declare const bookingTravelerDietarySchema: z.ZodObject<{
|
|
@@ -16,6 +24,9 @@ export declare const decryptedBookingTravelerTravelDetailSchema: z.ZodObject<{
|
|
|
16
24
|
nationality: z.ZodNullable<z.ZodString>;
|
|
17
25
|
passportNumber: z.ZodNullable<z.ZodString>;
|
|
18
26
|
passportExpiry: z.ZodNullable<z.ZodString>;
|
|
27
|
+
passportIssuingCountry: z.ZodNullable<z.ZodString>;
|
|
28
|
+
passportIssuingAuthority: z.ZodNullable<z.ZodString>;
|
|
29
|
+
passportPersonDocumentId: z.ZodNullable<z.ZodString>;
|
|
19
30
|
dateOfBirth: z.ZodNullable<z.ZodString>;
|
|
20
31
|
dietaryRequirements: z.ZodNullable<z.ZodString>;
|
|
21
32
|
accessibilityNeeds: z.ZodNullable<z.ZodString>;
|
|
@@ -113,6 +124,23 @@ export declare const bookingTravelerTravelDetails: import("drizzle-orm/pg-core")
|
|
|
113
124
|
enc: string;
|
|
114
125
|
} | null;
|
|
115
126
|
}>;
|
|
127
|
+
passportPersonDocumentId: import("drizzle-orm/pg-core").PgColumn<{
|
|
128
|
+
name: "passport_person_document_id";
|
|
129
|
+
tableName: "booking_traveler_travel_details";
|
|
130
|
+
dataType: "string";
|
|
131
|
+
columnType: "PgText";
|
|
132
|
+
data: string;
|
|
133
|
+
driverParam: string;
|
|
134
|
+
notNull: false;
|
|
135
|
+
hasDefault: false;
|
|
136
|
+
isPrimaryKey: false;
|
|
137
|
+
isAutoincrement: false;
|
|
138
|
+
hasRuntimeDefault: false;
|
|
139
|
+
enumValues: [string, ...string[]];
|
|
140
|
+
baseColumn: never;
|
|
141
|
+
identity: undefined;
|
|
142
|
+
generated: undefined;
|
|
143
|
+
}, {}, {}>;
|
|
116
144
|
isLeadTraveler: import("drizzle-orm/pg-core").PgColumn<{
|
|
117
145
|
name: "is_lead_traveler";
|
|
118
146
|
tableName: "booking_traveler_travel_details";
|
|
@@ -168,27 +196,29 @@ export declare const bookingTravelerTravelDetails: import("drizzle-orm/pg-core")
|
|
|
168
196
|
dialect: "pg";
|
|
169
197
|
}>;
|
|
170
198
|
export declare const bookingTravelerTravelDetailInsertSchema: z.ZodObject<{
|
|
171
|
-
|
|
199
|
+
passportPersonDocumentId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
200
|
+
isLeadTraveler: z.ZodDefault<z.ZodBoolean>;
|
|
201
|
+
identityEncrypted: z.ZodNullable<z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
172
202
|
enc: z.ZodString;
|
|
173
203
|
}, z.core.$strip>>>>;
|
|
174
204
|
dietaryEncrypted: z.ZodNullable<z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
175
205
|
enc: z.ZodString;
|
|
176
206
|
}, z.core.$strip>>>>;
|
|
177
|
-
|
|
178
|
-
identityEncrypted: z.ZodNullable<z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
207
|
+
accessibilityEncrypted: z.ZodNullable<z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
179
208
|
enc: z.ZodString;
|
|
180
209
|
}, z.core.$strip>>>>;
|
|
181
210
|
travelerId: z.ZodString;
|
|
182
211
|
}, z.core.$strip>;
|
|
183
212
|
export declare const bookingTravelerTravelDetailUpdateSchema: z.ZodObject<{
|
|
184
|
-
|
|
213
|
+
passportPersonDocumentId: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
214
|
+
isLeadTraveler: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
215
|
+
identityEncrypted: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
185
216
|
enc: z.ZodString;
|
|
186
217
|
}, z.core.$strip>>>>>;
|
|
187
218
|
dietaryEncrypted: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
188
219
|
enc: z.ZodString;
|
|
189
220
|
}, z.core.$strip>>>>>;
|
|
190
|
-
|
|
191
|
-
identityEncrypted: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
221
|
+
accessibilityEncrypted: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
192
222
|
enc: z.ZodString;
|
|
193
223
|
}, z.core.$strip>>>>>;
|
|
194
224
|
}, z.core.$strip>;
|
|
@@ -203,6 +233,7 @@ export declare const bookingTravelerTravelDetailSelectSchema: z.ZodObject<{
|
|
|
203
233
|
accessibilityEncrypted: z.ZodNullable<z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
204
234
|
enc: z.ZodString;
|
|
205
235
|
}, z.core.$strip>>>>;
|
|
236
|
+
passportPersonDocumentId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
206
237
|
isLeadTraveler: z.ZodDefault<z.ZodBoolean>;
|
|
207
238
|
createdAt: z.ZodDate;
|
|
208
239
|
updatedAt: z.ZodDate;
|
|
@@ -1 +1 @@
|
|
|
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,6BAA6B
|
|
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;;;;;GAKG;AACH,eAAO,MAAM,6BAA6B;;;;;;;iBAOxC,CAAA;AAEF,eAAO,MAAM,4BAA4B;;iBAEvC,CAAA;AAEF,eAAO,MAAM,kCAAkC;;iBAE7C,CAAA;AAkBF,eAAO,MAAM,0CAA0C;;;;;;;;;;;;;;iBACL,CAAA;AAElD,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAqBxC,CAAA;AAWD,eAAO,MAAM,uCAAuC;;;;;;;;;;;;;iBAIhD,CAAA;AAEJ,eAAO,MAAM,uCAAuC;;;;;;;;;;;;iBAEvB,CAAA;AAE7B,eAAO,MAAM,uCAAuC;;;;;;;;;;;;;;;iBAIhD,CAAA;AAEJ,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAA;AACnF,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAA;AACjF,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kCAAkC,CAAC,CAAA;AAC7F,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uCAAuC,CAAC,CAAA;AACjG,MAAM,MAAM,8BAA8B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uCAAuC,CAAC,CAAA;AACpG,MAAM,MAAM,oCAAoC,GAAG,CAAC,CAAC,KAAK,CACxD,OAAO,0CAA0C,CAClD,CAAA"}
|
|
@@ -2,10 +2,18 @@ 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 { bookingTravelers } from "../schema.js";
|
|
5
|
+
/**
|
|
6
|
+
* Plaintext shape stored inside `identityEncrypted`. Snapshotted at
|
|
7
|
+
* booking-traveler creation from the canonical `crm.people` +
|
|
8
|
+
* `crm.person_documents` records — see `passportPersonDocumentId`
|
|
9
|
+
* for provenance back to the source document row.
|
|
10
|
+
*/
|
|
5
11
|
export const bookingTravelerIdentitySchema = z.object({
|
|
6
12
|
nationality: z.string().optional().nullable(),
|
|
7
13
|
passportNumber: z.string().optional().nullable(),
|
|
8
14
|
passportExpiry: z.string().optional().nullable(),
|
|
15
|
+
passportIssuingCountry: z.string().optional().nullable(),
|
|
16
|
+
passportIssuingAuthority: z.string().optional().nullable(),
|
|
9
17
|
dateOfBirth: z.string().optional().nullable(),
|
|
10
18
|
});
|
|
11
19
|
export const bookingTravelerDietarySchema = z.object({
|
|
@@ -19,6 +27,9 @@ const decryptedBookingTravelerTravelDetailRecordSchema = z.object({
|
|
|
19
27
|
nationality: z.string().nullable(),
|
|
20
28
|
passportNumber: z.string().nullable(),
|
|
21
29
|
passportExpiry: z.string().nullable(),
|
|
30
|
+
passportIssuingCountry: z.string().nullable(),
|
|
31
|
+
passportIssuingAuthority: z.string().nullable(),
|
|
32
|
+
passportPersonDocumentId: z.string().nullable(),
|
|
22
33
|
dateOfBirth: z.string().nullable(),
|
|
23
34
|
dietaryRequirements: z.string().nullable(),
|
|
24
35
|
accessibilityNeeds: z.string().nullable(),
|
|
@@ -34,6 +45,13 @@ export const bookingTravelerTravelDetails = pgTable("booking_traveler_travel_det
|
|
|
34
45
|
identityEncrypted: jsonb("identity_encrypted").$type(),
|
|
35
46
|
dietaryEncrypted: jsonb("dietary_encrypted").$type(),
|
|
36
47
|
accessibilityEncrypted: jsonb("accessibility_encrypted").$type(),
|
|
48
|
+
/**
|
|
49
|
+
* Provenance pointer to the `crm.person_documents` row that
|
|
50
|
+
* seeded the identity snapshot. Plaintext (non-toxic) and
|
|
51
|
+
* intentionally has no FK — the snapshot is owned by the booking
|
|
52
|
+
* even if the source document is later edited or deleted.
|
|
53
|
+
*/
|
|
54
|
+
passportPersonDocumentId: text("passport_person_document_id"),
|
|
37
55
|
isLeadTraveler: boolean("is_lead_traveler").notNull().default(false),
|
|
38
56
|
createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
|
|
39
57
|
updatedAt: timestamp("updated_at", { withTimezone: true }).notNull().defaultNow(),
|
|
@@ -43,6 +61,7 @@ const bookingTravelerTravelDetailRecordCoreSchema = z.object({
|
|
|
43
61
|
identityEncrypted: kmsEnvelopeSchema.optional().nullable(),
|
|
44
62
|
dietaryEncrypted: kmsEnvelopeSchema.optional().nullable(),
|
|
45
63
|
accessibilityEncrypted: kmsEnvelopeSchema.optional().nullable(),
|
|
64
|
+
passportPersonDocumentId: z.string().nullable().optional(),
|
|
46
65
|
isLeadTraveler: z.boolean().default(false),
|
|
47
66
|
});
|
|
48
67
|
export const bookingTravelerTravelDetailInsertSchema = bookingTravelerTravelDetailRecordCoreSchema
|
package/dist/schema-core.d.ts
CHANGED
|
@@ -92,7 +92,7 @@ export declare const bookings: import("drizzle-orm/pg-core").PgTableWithColumns<
|
|
|
92
92
|
tableName: "bookings";
|
|
93
93
|
dataType: "string";
|
|
94
94
|
columnType: "PgEnumColumn";
|
|
95
|
-
data: "internal" | "
|
|
95
|
+
data: "internal" | "direct" | "manual" | "affiliate" | "ota" | "reseller" | "api_partner";
|
|
96
96
|
driverParam: string;
|
|
97
97
|
notNull: true;
|
|
98
98
|
hasDefault: true;
|
package/dist/schema-core.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { typeId, typeIdRef } from "@voyantjs/db/lib/typeid-column";
|
|
2
2
|
import { sql } from "drizzle-orm";
|
|
3
3
|
import { boolean, check, date, index, integer, jsonb, pgTable, text, timestamp, } from "drizzle-orm/pg-core";
|
|
4
|
-
import { bookingParticipantTypeEnum, bookingPiiAccessActionEnum, bookingPiiAccessOutcomeEnum, bookingSourceTypeEnum, bookingStatusEnum, bookingTravelerCategoryEnum, } from "./schema-shared";
|
|
4
|
+
import { bookingParticipantTypeEnum, bookingPiiAccessActionEnum, bookingPiiAccessOutcomeEnum, bookingSourceTypeEnum, bookingStatusEnum, bookingTravelerCategoryEnum, } from "./schema-shared.js";
|
|
5
5
|
export const bookings = pgTable("bookings", {
|
|
6
6
|
id: typeId("bookings"),
|
|
7
7
|
bookingNumber: text("booking_number").notNull().unique(),
|
package/dist/schema-groups.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { typeId, typeIdRef } from "@voyantjs/db/lib/typeid-column";
|
|
2
2
|
import { index, jsonb, pgEnum, pgTable, text, timestamp, uniqueIndex } from "drizzle-orm/pg-core";
|
|
3
|
-
import { bookings } from "./schema-core";
|
|
3
|
+
import { bookings } from "./schema-core.js";
|
|
4
4
|
export const bookingGroupKindEnum = pgEnum("booking_group_kind", [
|
|
5
5
|
"shared_room",
|
|
6
6
|
"cruise_party",
|
package/dist/schema-items.d.ts
CHANGED
|
@@ -611,7 +611,7 @@ export declare const bookingAllocations: import("drizzle-orm/pg-core").PgTableWi
|
|
|
611
611
|
tableName: "booking_allocations";
|
|
612
612
|
dataType: "string";
|
|
613
613
|
columnType: "PgEnumColumn";
|
|
614
|
-
data: "unit" | "
|
|
614
|
+
data: "unit" | "pickup" | "resource";
|
|
615
615
|
driverParam: string;
|
|
616
616
|
notNull: true;
|
|
617
617
|
hasDefault: true;
|
|
@@ -858,7 +858,7 @@ export declare const bookingFulfillments: import("drizzle-orm/pg-core").PgTableW
|
|
|
858
858
|
tableName: "booking_fulfillments";
|
|
859
859
|
dataType: "string";
|
|
860
860
|
columnType: "PgEnumColumn";
|
|
861
|
-
data: "pending" | "
|
|
861
|
+
data: "pending" | "issued" | "reissued" | "revoked" | "failed";
|
|
862
862
|
driverParam: string;
|
|
863
863
|
notNull: true;
|
|
864
864
|
hasDefault: true;
|
package/dist/schema-items.js
CHANGED
|
@@ -2,8 +2,8 @@ import { typeId, typeIdRef } from "@voyantjs/db/lib/typeid-column";
|
|
|
2
2
|
import { sql } from "drizzle-orm";
|
|
3
3
|
import { boolean, check, date, index, integer, jsonb, pgTable, text, timestamp, } from "drizzle-orm/pg-core";
|
|
4
4
|
import { availabilitySlotsRef } from "./availability-ref.js";
|
|
5
|
-
import { bookings, bookingTravelers } from "./schema-core";
|
|
6
|
-
import { bookingAllocationStatusEnum, bookingAllocationTypeEnum, bookingFulfillmentDeliveryChannelEnum, bookingFulfillmentStatusEnum, bookingFulfillmentTypeEnum, bookingItemParticipantRoleEnum, bookingItemStatusEnum, bookingItemTypeEnum, bookingRedemptionMethodEnum, } from "./schema-shared";
|
|
5
|
+
import { bookings, bookingTravelers } from "./schema-core.js";
|
|
6
|
+
import { bookingAllocationStatusEnum, bookingAllocationTypeEnum, bookingFulfillmentDeliveryChannelEnum, bookingFulfillmentStatusEnum, bookingFulfillmentTypeEnum, bookingItemParticipantRoleEnum, bookingItemStatusEnum, bookingItemTypeEnum, bookingRedemptionMethodEnum, } from "./schema-shared.js";
|
|
7
7
|
export const bookingItems = pgTable("booking_items", {
|
|
8
8
|
id: typeId("booking_items"),
|
|
9
9
|
bookingId: typeIdRef("booking_id")
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { typeId, typeIdRef } from "@voyantjs/db/lib/typeid-column";
|
|
2
2
|
import { index, integer, jsonb, pgTable, text, timestamp, uniqueIndex } from "drizzle-orm/pg-core";
|
|
3
|
-
import { bookings, bookingTravelers } from "./schema-core";
|
|
4
|
-
import { bookingActivityTypeEnum, bookingDocumentTypeEnum, supplierConfirmationStatusEnum, } from "./schema-shared";
|
|
3
|
+
import { bookings, bookingTravelers } from "./schema-core.js";
|
|
4
|
+
import { bookingActivityTypeEnum, bookingDocumentTypeEnum, supplierConfirmationStatusEnum, } from "./schema-shared.js";
|
|
5
5
|
export const bookingSupplierStatuses = pgTable("booking_supplier_statuses", {
|
|
6
6
|
id: typeId("booking_supplier_statuses"),
|
|
7
7
|
bookingId: typeIdRef("booking_id")
|
package/dist/schema-relations.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { relations } from "drizzle-orm";
|
|
2
2
|
import { availabilitySlotsRef } from "./availability-ref.js";
|
|
3
|
-
import { bookings, bookingTravelers } from "./schema-core";
|
|
4
|
-
import { bookingGroupMembers, bookingGroups } from "./schema-groups";
|
|
5
|
-
import { bookingAllocations, bookingFulfillments, bookingItems, bookingItemTravelers, bookingRedemptionEvents, } from "./schema-items";
|
|
6
|
-
import { bookingActivityLog, bookingDocuments, bookingNotes, bookingSessionStates, bookingSupplierStatuses, } from "./schema-operations";
|
|
7
|
-
import { bookingStaffAssignments } from "./schema-staff";
|
|
3
|
+
import { bookings, bookingTravelers } from "./schema-core.js";
|
|
4
|
+
import { bookingGroupMembers, bookingGroups } from "./schema-groups.js";
|
|
5
|
+
import { bookingAllocations, bookingFulfillments, bookingItems, bookingItemTravelers, bookingRedemptionEvents, } from "./schema-items.js";
|
|
6
|
+
import { bookingActivityLog, bookingDocuments, bookingNotes, bookingSessionStates, bookingSupplierStatuses, } from "./schema-operations.js";
|
|
7
|
+
import { bookingStaffAssignments } from "./schema-staff.js";
|
|
8
8
|
export const bookingsRelations = relations(bookings, ({ many }) => ({
|
|
9
9
|
participants: many(bookingTravelers),
|
|
10
10
|
staffAssignments: many(bookingStaffAssignments),
|
package/dist/schema.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export * from "./schema/travel-details";
|
|
2
|
-
export * from "./schema-core";
|
|
3
|
-
export * from "./schema-groups";
|
|
4
|
-
export * from "./schema-items";
|
|
5
|
-
export * from "./schema-operations";
|
|
6
|
-
export * from "./schema-relations";
|
|
7
|
-
export * from "./schema-shared";
|
|
8
|
-
export * from "./schema-staff";
|
|
1
|
+
export * from "./schema/travel-details.js";
|
|
2
|
+
export * from "./schema-core.js";
|
|
3
|
+
export * from "./schema-groups.js";
|
|
4
|
+
export * from "./schema-items.js";
|
|
5
|
+
export * from "./schema-operations.js";
|
|
6
|
+
export * from "./schema-relations.js";
|
|
7
|
+
export * from "./schema-shared.js";
|
|
8
|
+
export * from "./schema-staff.js";
|
|
9
9
|
//# sourceMappingURL=schema.d.ts.map
|
package/dist/schema.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../src/schema.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../src/schema.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAA;AAC1C,cAAc,kBAAkB,CAAA;AAChC,cAAc,oBAAoB,CAAA;AAClC,cAAc,mBAAmB,CAAA;AACjC,cAAc,wBAAwB,CAAA;AACtC,cAAc,uBAAuB,CAAA;AACrC,cAAc,oBAAoB,CAAA;AAClC,cAAc,mBAAmB,CAAA"}
|
package/dist/schema.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export * from "./schema/travel-details";
|
|
2
|
-
export * from "./schema-core";
|
|
3
|
-
export * from "./schema-groups";
|
|
4
|
-
export * from "./schema-items";
|
|
5
|
-
export * from "./schema-operations";
|
|
6
|
-
export * from "./schema-relations";
|
|
7
|
-
export * from "./schema-shared";
|
|
8
|
-
export * from "./schema-staff";
|
|
1
|
+
export * from "./schema/travel-details.js";
|
|
2
|
+
export * from "./schema-core.js";
|
|
3
|
+
export * from "./schema-groups.js";
|
|
4
|
+
export * from "./schema-items.js";
|
|
5
|
+
export * from "./schema-operations.js";
|
|
6
|
+
export * from "./schema-relations.js";
|
|
7
|
+
export * from "./schema-shared.js";
|
|
8
|
+
export * from "./schema-staff.js";
|
package/dist/service-public.d.ts
CHANGED
|
@@ -124,7 +124,7 @@ export declare const publicBookingsService: {
|
|
|
124
124
|
pricingCategoryId: string | null;
|
|
125
125
|
availabilitySlotId: string | null;
|
|
126
126
|
quantity: number;
|
|
127
|
-
allocationType: "unit" | "
|
|
127
|
+
allocationType: "unit" | "pickup" | "resource";
|
|
128
128
|
status: "cancelled" | "confirmed" | "expired" | "fulfilled" | "held" | "released";
|
|
129
129
|
holdExpiresAt: string | null;
|
|
130
130
|
confirmedAt: string | null;
|
|
@@ -215,7 +215,7 @@ export declare const publicBookingsService: {
|
|
|
215
215
|
pricingCategoryId: string | null;
|
|
216
216
|
availabilitySlotId: string | null;
|
|
217
217
|
quantity: number;
|
|
218
|
-
allocationType: "unit" | "
|
|
218
|
+
allocationType: "unit" | "pickup" | "resource";
|
|
219
219
|
status: "cancelled" | "confirmed" | "expired" | "fulfilled" | "held" | "released";
|
|
220
220
|
holdExpiresAt: string | null;
|
|
221
221
|
confirmedAt: string | null;
|
|
@@ -335,7 +335,7 @@ export declare const publicBookingsService: {
|
|
|
335
335
|
pricingCategoryId: string | null;
|
|
336
336
|
availabilitySlotId: string | null;
|
|
337
337
|
quantity: number;
|
|
338
|
-
allocationType: "unit" | "
|
|
338
|
+
allocationType: "unit" | "pickup" | "resource";
|
|
339
339
|
status: "cancelled" | "confirmed" | "expired" | "fulfilled" | "held" | "released";
|
|
340
340
|
holdExpiresAt: string | null;
|
|
341
341
|
confirmedAt: string | null;
|
|
@@ -467,7 +467,7 @@ export declare const publicBookingsService: {
|
|
|
467
467
|
pricingCategoryId: string | null;
|
|
468
468
|
availabilitySlotId: string | null;
|
|
469
469
|
quantity: number;
|
|
470
|
-
allocationType: "unit" | "
|
|
470
|
+
allocationType: "unit" | "pickup" | "resource";
|
|
471
471
|
status: "cancelled" | "confirmed" | "expired" | "fulfilled" | "held" | "released";
|
|
472
472
|
holdExpiresAt: string | null;
|
|
473
473
|
confirmedAt: string | null;
|
|
@@ -562,7 +562,7 @@ export declare const publicBookingsService: {
|
|
|
562
562
|
pricingCategoryId: string | null;
|
|
563
563
|
availabilitySlotId: string | null;
|
|
564
564
|
quantity: number;
|
|
565
|
-
allocationType: "unit" | "
|
|
565
|
+
allocationType: "unit" | "pickup" | "resource";
|
|
566
566
|
status: "cancelled" | "confirmed" | "expired" | "fulfilled" | "held" | "released";
|
|
567
567
|
holdExpiresAt: string | null;
|
|
568
568
|
confirmedAt: string | null;
|
|
@@ -657,7 +657,7 @@ export declare const publicBookingsService: {
|
|
|
657
657
|
pricingCategoryId: string | null;
|
|
658
658
|
availabilitySlotId: string | null;
|
|
659
659
|
quantity: number;
|
|
660
|
-
allocationType: "unit" | "
|
|
660
|
+
allocationType: "unit" | "pickup" | "resource";
|
|
661
661
|
status: "cancelled" | "confirmed" | "expired" | "fulfilled" | "held" | "released";
|
|
662
662
|
holdExpiresAt: string | null;
|
|
663
663
|
confirmedAt: string | null;
|
|
@@ -742,7 +742,7 @@ export declare const publicBookingsService: {
|
|
|
742
742
|
travelerId: string | null;
|
|
743
743
|
fulfillmentType: "other" | "voucher" | "ticket" | "pdf" | "qr_code" | "barcode" | "mobile";
|
|
744
744
|
deliveryChannel: "email" | "other" | "download" | "api" | "wallet";
|
|
745
|
-
status: "pending" | "
|
|
745
|
+
status: "pending" | "issued" | "reissued" | "revoked" | "failed";
|
|
746
746
|
artifactUrl: string | null;
|
|
747
747
|
}[];
|
|
748
748
|
} | null>;
|
|
@@ -806,7 +806,7 @@ export declare const publicBookingsService: {
|
|
|
806
806
|
travelerId: string | null;
|
|
807
807
|
fulfillmentType: "other" | "voucher" | "ticket" | "pdf" | "qr_code" | "barcode" | "mobile";
|
|
808
808
|
deliveryChannel: "email" | "other" | "download" | "api" | "wallet";
|
|
809
|
-
status: "pending" | "
|
|
809
|
+
status: "pending" | "issued" | "reissued" | "revoked" | "failed";
|
|
810
810
|
artifactUrl: string | null;
|
|
811
811
|
}[];
|
|
812
812
|
} | null>;
|