@voyantjs/bookings 0.81.7 → 0.81.9

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.
@@ -64,6 +64,7 @@ export declare function redactBookingContact<T extends {
64
64
  contactEmail?: string | null;
65
65
  contactPhone?: string | null;
66
66
  contactAddressLine1?: string | null;
67
+ contactAddressLine2?: string | null;
67
68
  contactPostalCode?: string | null;
68
69
  }>(row: T): T;
69
70
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"pii-redaction.d.ts","sourceRoot":"","sources":["../src/pii-redaction.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAMH,MAAM,WAAW,gBAAgB;IAC/B,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACrB,MAAM,CAAC,EAAE,MAAM,EAAE,GAAG,IAAI,CAAA;IACxB,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC1B,iBAAiB,CAAC,EAAE,OAAO,CAAA;CAC5B;AAED;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,gBAAgB,GAAG,OAAO,CASrE;AAED;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,GAAG,IAAI,CAQ3E;AAED;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,GAAG,IAAI,CAK3E;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,GAAG,IAAI,CAG5E;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAClC,CAAC,SAAS;IACR,gBAAgB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAChC,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC/B,YAAY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AG,IAAI,GAAG,SAAS,GAAG,MAAM,GAAG,IAAI,CAK3E;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,GAAG,IAAI,CAG5E;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAClC,CAAC,SAAS;IACR,gBAAgB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAChC,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC/B,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC5B,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC5B,mBAAmB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACnC,mBAAmB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACnC,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAClC,EACD,GAAG,EAAE,CAAC,GAAG,CAAC,CAWX;AAED;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CACpC,CAAC,SAAS;IACR,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACzB,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACxB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACrB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACrB,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC/B,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CACtB,EACD,GAAG,EAAE,CAAC,GAAG,CAAC,CAUX"}
@@ -94,6 +94,7 @@ export function redactBookingContact(row) {
94
94
  contactEmail: redactEmail(row.contactEmail),
95
95
  contactPhone: redactPhone(row.contactPhone),
96
96
  contactAddressLine1: redactString(row.contactAddressLine1),
97
+ contactAddressLine2: redactString(row.contactAddressLine2),
97
98
  contactPostalCode: redactString(row.contactPostalCode),
98
99
  };
99
100
  }
package/dist/pii.d.ts CHANGED
@@ -1,14 +1,15 @@
1
1
  import type { KeyRef, KmsProvider } from "@voyantjs/utils";
2
2
  import type { PostgresJsDatabase } from "drizzle-orm/postgres-js";
3
- import { type BookingTravelerBedPreference, type DecryptedBookingTravelerTravelDetail, type TravelerAllocationMap } from "./schema/travel-details.js";
3
+ import { type BookingTravelerBedPreference, type BookingTravelerIdentity, type DecryptedBookingTravelerTravelDetail, type TravelerAllocationMap } from "./schema/travel-details.js";
4
4
  export interface UpsertBookingTravelerTravelDetailInput {
5
5
  nationality?: string | null;
6
- passportNumber?: string | null;
7
- passportExpiry?: string | null;
8
- passportIssuingCountry?: string | null;
9
- passportIssuingAuthority?: string | null;
6
+ documentType?: BookingTravelerIdentity["documentType"];
7
+ documentNumber?: string | null;
8
+ documentExpiry?: string | null;
9
+ documentIssuingCountry?: string | null;
10
+ documentIssuingAuthority?: string | null;
10
11
  /** Provenance of the snapshot (id of the `crm.person_documents` row that seeded it). */
11
- passportPersonDocumentId?: string | null;
12
+ documentPersonDocumentId?: string | null;
12
13
  dateOfBirth?: string | null;
13
14
  dietaryRequirements?: string | null;
14
15
  accessibilityNeeds?: string | null;
@@ -27,11 +28,12 @@ export interface BookingTravelerSnapshot {
27
28
  dateOfBirth?: string | null;
28
29
  dietaryRequirements?: string | null;
29
30
  accessibilityNeeds?: string | null;
30
- passportNumber?: string | null;
31
- passportExpiry?: string | null;
32
- passportIssuingCountry?: string | null;
33
- passportIssuingAuthority?: string | null;
34
- passportPersonDocumentId?: string | null;
31
+ documentType?: BookingTravelerIdentity["documentType"];
32
+ documentNumber?: string | null;
33
+ documentExpiry?: string | null;
34
+ documentIssuingCountry?: string | null;
35
+ documentIssuingAuthority?: string | null;
36
+ documentPersonDocumentId?: string | null;
35
37
  }
36
38
  /**
37
39
  * Apply a person-derived snapshot to a booking-traveler input,
package/dist/pii.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"pii.d.ts","sourceRoot":"","sources":["../src/p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EAClB,KAAK,EAAE,sCAAsC,EAC7C,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,GACtB,OAAO,CAAC,oCAAoC,GAAG,IAAI,CAAC,CAAA;IACvD,2BAA2B,CACzB,EAAE,EAAE,kBAAkB,EACtB,UAAU,EAAE,MAAM,EAClB,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,GACtB,OAAO,CAAC;QAAE,UAAU,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC,CAAA;CAC1C;AAuKD,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,wBAAwB,GAAG,iBAAiB,CAuJ5F"}
package/dist/pii.js CHANGED
@@ -12,36 +12,47 @@ export function applyTravelDetailSnapshot(input, snapshot) {
12
12
  if (!snapshot)
13
13
  return input;
14
14
  const merged = { ...input };
15
+ const applySnapshotField = (key) => {
16
+ if (merged[key] === undefined && snapshot[key] != null) {
17
+ merged[key] = snapshot[key];
18
+ }
19
+ };
15
20
  for (const key of [
16
21
  "dateOfBirth",
17
22
  "dietaryRequirements",
18
23
  "accessibilityNeeds",
19
- "passportNumber",
20
- "passportExpiry",
21
- "passportIssuingCountry",
22
- "passportIssuingAuthority",
23
- "passportPersonDocumentId",
24
+ "documentType",
25
+ "documentNumber",
26
+ "documentExpiry",
27
+ "documentIssuingCountry",
28
+ "documentIssuingAuthority",
29
+ "documentPersonDocumentId",
24
30
  ]) {
25
- if (merged[key] === undefined && snapshot[key] != null) {
26
- merged[key] = snapshot[key];
27
- }
31
+ applySnapshotField(key);
28
32
  }
29
33
  return merged;
30
34
  }
31
35
  function buildIdentityPayload(input) {
36
+ const hasDocumentFields = input.documentNumber != null ||
37
+ input.documentExpiry != null ||
38
+ input.documentIssuingCountry != null ||
39
+ input.documentIssuingAuthority != null ||
40
+ input.documentPersonDocumentId != null;
32
41
  const payload = bookingTravelerIdentitySchema.parse({
33
42
  nationality: input.nationality ?? null,
34
- passportNumber: input.passportNumber ?? null,
35
- passportExpiry: input.passportExpiry ?? null,
36
- passportIssuingCountry: input.passportIssuingCountry ?? null,
37
- passportIssuingAuthority: input.passportIssuingAuthority ?? null,
43
+ documentType: input.documentType ?? (hasDocumentFields ? "passport" : null),
44
+ documentNumber: input.documentNumber ?? null,
45
+ documentExpiry: input.documentExpiry ?? null,
46
+ documentIssuingCountry: input.documentIssuingCountry ?? null,
47
+ documentIssuingAuthority: input.documentIssuingAuthority ?? null,
38
48
  dateOfBirth: input.dateOfBirth ?? null,
39
49
  });
40
50
  if (!payload.nationality &&
41
- !payload.passportNumber &&
42
- !payload.passportExpiry &&
43
- !payload.passportIssuingCountry &&
44
- !payload.passportIssuingAuthority &&
51
+ !payload.documentType &&
52
+ !payload.documentNumber &&
53
+ !payload.documentExpiry &&
54
+ !payload.documentIssuingCountry &&
55
+ !payload.documentIssuingAuthority &&
45
56
  !payload.dateOfBirth) {
46
57
  return null;
47
58
  }
@@ -79,11 +90,12 @@ async function loadExistingTravelDetails(db, travelerId, options, keyRef) {
79
90
  const accessibility = await decryptOptionalJsonEnvelope(options.kms, keyRef, row.accessibilityEncrypted, bookingTravelerAccessibilitySchema);
80
91
  return {
81
92
  nationality: identity?.nationality ?? null,
82
- passportNumber: identity?.passportNumber ?? null,
83
- passportExpiry: identity?.passportExpiry ?? null,
84
- passportIssuingCountry: identity?.passportIssuingCountry ?? null,
85
- passportIssuingAuthority: identity?.passportIssuingAuthority ?? null,
86
- passportPersonDocumentId: row.passportPersonDocumentId ?? null,
93
+ documentType: identity?.documentType ?? null,
94
+ documentNumber: identity?.documentNumber ?? null,
95
+ documentExpiry: identity?.documentExpiry ?? null,
96
+ documentIssuingCountry: identity?.documentIssuingCountry ?? null,
97
+ documentIssuingAuthority: identity?.documentIssuingAuthority ?? null,
98
+ documentPersonDocumentId: row.documentPersonDocumentId ?? null,
87
99
  dateOfBirth: identity?.dateOfBirth ?? null,
88
100
  dietaryRequirements: dietary?.dietaryRequirements ?? null,
89
101
  accessibilityNeeds: accessibility?.accessibilityNeeds ?? null,
@@ -97,21 +109,22 @@ async function loadExistingTravelDetails(db, travelerId, options, keyRef) {
97
109
  function mergeTravelDetailInput(existing, input) {
98
110
  return {
99
111
  nationality: input.nationality === undefined ? (existing?.nationality ?? null) : input.nationality,
100
- passportNumber: input.passportNumber === undefined
101
- ? (existing?.passportNumber ?? null)
102
- : input.passportNumber,
103
- passportExpiry: input.passportExpiry === undefined
104
- ? (existing?.passportExpiry ?? null)
105
- : input.passportExpiry,
106
- passportIssuingCountry: input.passportIssuingCountry === undefined
107
- ? (existing?.passportIssuingCountry ?? null)
108
- : input.passportIssuingCountry,
109
- passportIssuingAuthority: input.passportIssuingAuthority === undefined
110
- ? (existing?.passportIssuingAuthority ?? null)
111
- : input.passportIssuingAuthority,
112
- passportPersonDocumentId: input.passportPersonDocumentId === undefined
113
- ? (existing?.passportPersonDocumentId ?? null)
114
- : input.passportPersonDocumentId,
112
+ documentNumber: input.documentNumber === undefined
113
+ ? (existing?.documentNumber ?? null)
114
+ : input.documentNumber,
115
+ documentType: input.documentType === undefined ? (existing?.documentType ?? null) : input.documentType,
116
+ documentExpiry: input.documentExpiry === undefined
117
+ ? (existing?.documentExpiry ?? null)
118
+ : input.documentExpiry,
119
+ documentIssuingCountry: input.documentIssuingCountry === undefined
120
+ ? (existing?.documentIssuingCountry ?? null)
121
+ : input.documentIssuingCountry,
122
+ documentIssuingAuthority: input.documentIssuingAuthority === undefined
123
+ ? (existing?.documentIssuingAuthority ?? null)
124
+ : input.documentIssuingAuthority,
125
+ documentPersonDocumentId: input.documentPersonDocumentId === undefined
126
+ ? (existing?.documentPersonDocumentId ?? null)
127
+ : input.documentPersonDocumentId,
115
128
  dateOfBirth: input.dateOfBirth === undefined ? (existing?.dateOfBirth ?? null) : input.dateOfBirth,
116
129
  dietaryRequirements: input.dietaryRequirements === undefined
117
130
  ? (existing?.dietaryRequirements ?? null)
@@ -149,11 +162,12 @@ export function createBookingPiiService(options) {
149
162
  return {
150
163
  travelerId: row.travelerId,
151
164
  nationality: identity?.nationality ?? null,
152
- passportNumber: identity?.passportNumber ?? null,
153
- passportExpiry: identity?.passportExpiry ?? null,
154
- passportIssuingCountry: identity?.passportIssuingCountry ?? null,
155
- passportIssuingAuthority: identity?.passportIssuingAuthority ?? null,
156
- passportPersonDocumentId: row.passportPersonDocumentId ?? null,
165
+ documentType: identity?.documentType ?? null,
166
+ documentNumber: identity?.documentNumber ?? null,
167
+ documentExpiry: identity?.documentExpiry ?? null,
168
+ documentIssuingCountry: identity?.documentIssuingCountry ?? null,
169
+ documentIssuingAuthority: identity?.documentIssuingAuthority ?? null,
170
+ documentPersonDocumentId: row.documentPersonDocumentId ?? null,
157
171
  dateOfBirth: identity?.dateOfBirth ?? null,
158
172
  dietaryRequirements: dietary?.dietaryRequirements ?? null,
159
173
  accessibilityNeeds: accessibility?.accessibilityNeeds ?? null,
@@ -188,7 +202,7 @@ export function createBookingPiiService(options) {
188
202
  identityEncrypted,
189
203
  dietaryEncrypted,
190
204
  accessibilityEncrypted,
191
- passportPersonDocumentId: mergedInput.passportPersonDocumentId ?? null,
205
+ documentPersonDocumentId: mergedInput.documentPersonDocumentId ?? null,
192
206
  isLeadTraveler: mergedInput.isLeadTraveler ?? false,
193
207
  sharingGroupId: mergedInput.sharingGroupId ?? null,
194
208
  roomTypeId: mergedInput.roomTypeId ?? null,
@@ -202,7 +216,7 @@ export function createBookingPiiService(options) {
202
216
  identityEncrypted,
203
217
  dietaryEncrypted,
204
218
  accessibilityEncrypted,
205
- passportPersonDocumentId: mergedInput.passportPersonDocumentId ?? null,
219
+ documentPersonDocumentId: mergedInput.documentPersonDocumentId ?? null,
206
220
  isLeadTraveler: mergedInput.isLeadTraveler ?? false,
207
221
  sharingGroupId: mergedInput.sharingGroupId ?? null,
208
222
  roomTypeId: mergedInput.roomTypeId ?? null,
@@ -104,6 +104,7 @@ export declare const bookingGroupRoutes: import("hono/hono-base").HonoBase<Env,
104
104
  contactRegion: string | null;
105
105
  contactCity: string | null;
106
106
  contactAddressLine1: string | null;
107
+ contactAddressLine2: string | null;
107
108
  contactPostalCode: string | null;
108
109
  sellCurrency: string;
109
110
  baseCurrency: string | null;
@@ -253,6 +254,7 @@ export declare const bookingGroupRoutes: import("hono/hono-base").HonoBase<Env,
253
254
  contactRegion: string | null;
254
255
  contactCity: string | null;
255
256
  contactAddressLine1: string | null;
257
+ contactAddressLine2: string | null;
256
258
  contactPostalCode: string | null;
257
259
  sellCurrency: string;
258
260
  baseCurrency: string | null;
@@ -1 +1 @@
1
- {"version":3,"file":"routes-groups.d.ts","sourceRoot":"","sources":["../src/routes-groups.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAA;AAQ1D,KAAK,GAAG,GAAG;IACT,SAAS,EAAE;QACT,EAAE,EAAE,UAAU,CAAC,OAAO,oBAAoB,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAAA;QAChE,MAAM,CAAC,EAAE,MAAM,CAAA;KAChB,CAAA;CACF,CAAA;AAED,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBA0E3B,CAAA;AAEJ,MAAM,MAAM,kBAAkB,GAAG,OAAO,kBAAkB,CAAA"}
1
+ {"version":3,"file":"routes-groups.d.ts","sourceRoot":"","sources":["../src/routes-groups.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAA;AAQ1D,KAAK,GAAG,GAAG;IACT,SAAS,EAAE;QACT,EAAE,EAAE,UAAU,CAAC,OAAO,oBAAoB,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAAA;QAChE,MAAM,CAAC,EAAE,MAAM,CAAA;KAChB,CAAA;CACF,CAAA;AAED,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBA0E3B,CAAA;AAEJ,MAAM,MAAM,kBAAkB,GAAG,OAAO,kBAAkB,CAAA"}
package/dist/routes.d.ts CHANGED
@@ -109,6 +109,7 @@ export declare const bookingRoutes: import("hono/hono-base").HonoBase<Env, ({
109
109
  contactRegion: string | null;
110
110
  contactCity: string | null;
111
111
  contactAddressLine1: string | null;
112
+ contactAddressLine2: string | null;
112
113
  contactPostalCode: string | null;
113
114
  sellCurrency: string;
114
115
  baseCurrency: string | null;
@@ -421,6 +422,7 @@ export declare const bookingRoutes: import("hono/hono-base").HonoBase<Env, ({
421
422
  contactRegion: string | null;
422
423
  contactCity: string | null;
423
424
  contactAddressLine1: string | null;
425
+ contactAddressLine2: string | null;
424
426
  contactPostalCode: string | null;
425
427
  sellCurrency: string;
426
428
  baseCurrency: string | null;
@@ -576,6 +578,7 @@ export declare const bookingRoutes: import("hono/hono-base").HonoBase<Env, ({
576
578
  contactRegion: string | null;
577
579
  contactCity: string | null;
578
580
  contactAddressLine1: string | null;
581
+ contactAddressLine2: string | null;
579
582
  contactPostalCode: string | null;
580
583
  sellCurrency: string;
581
584
  baseCurrency: string | null;
@@ -666,6 +669,7 @@ export declare const bookingRoutes: import("hono/hono-base").HonoBase<Env, ({
666
669
  contactRegion: string | null;
667
670
  contactCity: string | null;
668
671
  contactAddressLine1: string | null;
672
+ contactAddressLine2: string | null;
669
673
  contactPostalCode: string | null;
670
674
  sellCurrency: string;
671
675
  baseCurrency: string | null;
@@ -824,6 +828,7 @@ export declare const bookingRoutes: import("hono/hono-base").HonoBase<Env, ({
824
828
  contactRegion: string | null;
825
829
  contactCity: string | null;
826
830
  contactAddressLine1: string | null;
831
+ contactAddressLine2: string | null;
827
832
  contactPostalCode: string | null;
828
833
  sellCurrency: string;
829
834
  baseCurrency: string | null;
@@ -904,6 +909,7 @@ export declare const bookingRoutes: import("hono/hono-base").HonoBase<Env, ({
904
909
  contactRegion: string | null;
905
910
  contactCity: string | null;
906
911
  contactAddressLine1: string | null;
912
+ contactAddressLine2: string | null;
907
913
  contactPostalCode: string | null;
908
914
  sellCurrency: string;
909
915
  baseCurrency: string | null;
@@ -1031,6 +1037,7 @@ export declare const bookingRoutes: import("hono/hono-base").HonoBase<Env, ({
1031
1037
  contactRegion: string | null;
1032
1038
  contactCity: string | null;
1033
1039
  contactAddressLine1: string | null;
1040
+ contactAddressLine2: string | null;
1034
1041
  contactPostalCode: string | null;
1035
1042
  sellCurrency: string;
1036
1043
  baseCurrency: string | null;
@@ -1347,11 +1354,12 @@ export declare const bookingRoutes: import("hono/hono-base").HonoBase<Env, ({
1347
1354
  travelDetails: {
1348
1355
  travelerId: string;
1349
1356
  nationality: string | null;
1350
- passportNumber: string | null;
1351
- passportExpiry: string | null;
1352
- passportIssuingCountry: string | null;
1353
- passportIssuingAuthority: string | null;
1354
- passportPersonDocumentId: string | null;
1357
+ documentType: "passport" | "visa" | "other" | "id_card" | "driver_license" | null;
1358
+ documentNumber: string | null;
1359
+ documentExpiry: string | null;
1360
+ documentIssuingCountry: string | null;
1361
+ documentIssuingAuthority: string | null;
1362
+ documentPersonDocumentId: string | null;
1355
1363
  dateOfBirth: string | null;
1356
1364
  dietaryRequirements: string | null;
1357
1365
  accessibilityNeeds: string | null;
@@ -1429,11 +1437,12 @@ export declare const bookingRoutes: import("hono/hono-base").HonoBase<Env, ({
1429
1437
  travelDetails: {
1430
1438
  travelerId: string;
1431
1439
  nationality: string | null;
1432
- passportNumber: string | null;
1433
- passportExpiry: string | null;
1434
- passportIssuingCountry: string | null;
1435
- passportIssuingAuthority: string | null;
1436
- passportPersonDocumentId: string | null;
1440
+ documentType: "passport" | "visa" | "other" | "id_card" | "driver_license" | null;
1441
+ documentNumber: string | null;
1442
+ documentExpiry: string | null;
1443
+ documentIssuingCountry: string | null;
1444
+ documentIssuingAuthority: string | null;
1445
+ documentPersonDocumentId: string | null;
1437
1446
  dateOfBirth: string | null;
1438
1447
  dietaryRequirements: string | null;
1439
1448
  accessibilityNeeds: string | null;
@@ -2484,6 +2493,7 @@ export declare const bookingRoutes: import("hono/hono-base").HonoBase<Env, ({
2484
2493
  contactRegion: string | null;
2485
2494
  contactCity: string | null;
2486
2495
  contactAddressLine1: string | null;
2496
+ contactAddressLine2: string | null;
2487
2497
  contactPostalCode: string | null;
2488
2498
  sellCurrency: string;
2489
2499
  baseCurrency: string | null;
@@ -2633,6 +2643,7 @@ export declare const bookingRoutes: import("hono/hono-base").HonoBase<Env, ({
2633
2643
  contactRegion: string | null;
2634
2644
  contactCity: string | null;
2635
2645
  contactAddressLine1: string | null;
2646
+ contactAddressLine2: string | null;
2636
2647
  contactPostalCode: string | null;
2637
2648
  sellCurrency: string;
2638
2649
  baseCurrency: string | null;
@@ -1 +1 @@
1
- {"version":3,"file":"routes.d.ts","sour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Q;;;;;;;;;;;;;;;;;;;;;;CAQpB,CAAA"}
package/dist/routes.js CHANGED
@@ -38,11 +38,12 @@ const TRAVELER_IDENTITY_DISCLOSED_FIELDS = [
38
38
  ];
39
39
  const TRAVELER_TRAVEL_DETAIL_DISCLOSED_FIELDS = [
40
40
  "nationality",
41
- "passportNumber",
42
- "passportExpiry",
43
- "passportIssuingCountry",
44
- "passportIssuingAuthority",
45
- "passportPersonDocumentId",
41
+ "documentType",
42
+ "documentNumber",
43
+ "documentExpiry",
44
+ "documentIssuingCountry",
45
+ "documentIssuingAuthority",
46
+ "documentPersonDocumentId",
46
47
  "dateOfBirth",
47
48
  "dietaryRequirements",
48
49
  "accessibilityNeeds",
@@ -2,17 +2,55 @@ import { z } from "zod";
2
2
  /**
3
3
  * Plaintext shape stored inside `identityEncrypted`. Snapshotted at
4
4
  * booking-traveler creation from the canonical `crm.people` +
5
- * `crm.person_documents` records — see `passportPersonDocumentId`
5
+ * `crm.person_documents` records — see `documentPersonDocumentId`
6
6
  * for provenance back to the source document row.
7
7
  */
8
- export declare const bookingTravelerIdentitySchema: z.ZodObject<{
8
+ export declare const bookingTravelerIdentityDocumentTypeSchema: z.ZodEnum<{
9
+ passport: "passport";
10
+ visa: "visa";
11
+ other: "other";
12
+ id_card: "id_card";
13
+ driver_license: "driver_license";
14
+ }>;
15
+ export declare const bookingTravelerIdentitySchema: z.ZodPipe<z.ZodObject<{
9
16
  nationality: z.ZodNullable<z.ZodOptional<z.ZodString>>;
17
+ documentType: z.ZodNullable<z.ZodOptional<z.ZodEnum<{
18
+ passport: "passport";
19
+ visa: "visa";
20
+ other: "other";
21
+ id_card: "id_card";
22
+ driver_license: "driver_license";
23
+ }>>>;
24
+ documentNumber: z.ZodNullable<z.ZodOptional<z.ZodString>>;
25
+ documentExpiry: z.ZodNullable<z.ZodOptional<z.ZodString>>;
26
+ documentIssuingCountry: z.ZodNullable<z.ZodOptional<z.ZodString>>;
27
+ documentIssuingAuthority: z.ZodNullable<z.ZodOptional<z.ZodString>>;
10
28
  passportNumber: z.ZodNullable<z.ZodOptional<z.ZodString>>;
11
29
  passportExpiry: z.ZodNullable<z.ZodOptional<z.ZodString>>;
12
30
  passportIssuingCountry: z.ZodNullable<z.ZodOptional<z.ZodString>>;
13
31
  passportIssuingAuthority: z.ZodNullable<z.ZodOptional<z.ZodString>>;
14
32
  dateOfBirth: z.ZodNullable<z.ZodOptional<z.ZodString>>;
15
- }, z.core.$strip>;
33
+ }, z.core.$strip>, z.ZodTransform<{
34
+ nationality: string | null;
35
+ documentType: "passport" | "visa" | "other" | "id_card" | "driver_license" | null;
36
+ documentNumber: string | null;
37
+ documentExpiry: string | null;
38
+ documentIssuingCountry: string | null;
39
+ documentIssuingAuthority: string | null;
40
+ dateOfBirth: string | null;
41
+ }, {
42
+ nationality?: string | null | undefined;
43
+ documentType?: "passport" | "visa" | "other" | "id_card" | "driver_license" | null | undefined;
44
+ documentNumber?: string | null | undefined;
45
+ documentExpiry?: string | null | undefined;
46
+ documentIssuingCountry?: string | null | undefined;
47
+ documentIssuingAuthority?: string | null | undefined;
48
+ passportNumber?: string | null | undefined;
49
+ passportExpiry?: string | null | undefined;
50
+ passportIssuingCountry?: string | null | undefined;
51
+ passportIssuingAuthority?: string | null | undefined;
52
+ dateOfBirth?: string | null | undefined;
53
+ }>>;
16
54
  export declare const bookingTravelerDietarySchema: z.ZodObject<{
17
55
  dietaryRequirements: z.ZodNullable<z.ZodOptional<z.ZodString>>;
18
56
  }, z.core.$strip>;
@@ -29,11 +67,18 @@ export declare const travelerAllocationMapSchema: z.ZodRecord<z.ZodString, z.Zod
29
67
  export declare const decryptedBookingTravelerTravelDetailSchema: z.ZodObject<{
30
68
  travelerId: z.ZodString;
31
69
  nationality: z.ZodNullable<z.ZodString>;
32
- passportNumber: z.ZodNullable<z.ZodString>;
33
- passportExpiry: z.ZodNullable<z.ZodString>;
34
- passportIssuingCountry: z.ZodNullable<z.ZodString>;
35
- passportIssuingAuthority: z.ZodNullable<z.ZodString>;
36
- passportPersonDocumentId: z.ZodNullable<z.ZodString>;
70
+ documentType: z.ZodNullable<z.ZodEnum<{
71
+ passport: "passport";
72
+ visa: "visa";
73
+ other: "other";
74
+ id_card: "id_card";
75
+ driver_license: "driver_license";
76
+ }>>;
77
+ documentNumber: z.ZodNullable<z.ZodString>;
78
+ documentExpiry: z.ZodNullable<z.ZodString>;
79
+ documentIssuingCountry: z.ZodNullable<z.ZodString>;
80
+ documentIssuingAuthority: z.ZodNullable<z.ZodString>;
81
+ documentPersonDocumentId: z.ZodNullable<z.ZodString>;
37
82
  dateOfBirth: z.ZodNullable<z.ZodString>;
38
83
  dietaryRequirements: z.ZodNullable<z.ZodString>;
39
84
  accessibilityNeeds: z.ZodNullable<z.ZodString>;
@@ -140,8 +185,8 @@ export declare const bookingTravelerTravelDetails: import("drizzle-orm/pg-core")
140
185
  enc: string;
141
186
  } | null;
142
187
  }>;
143
- passportPersonDocumentId: import("drizzle-orm/pg-core").PgColumn<{
144
- name: "passport_person_document_id";
188
+ documentPersonDocumentId: import("drizzle-orm/pg-core").PgColumn<{
189
+ name: "document_person_document_id";
145
190
  tableName: "booking_traveler_travel_details";
146
191
  dataType: "string";
147
192
  columnType: "PgText";
@@ -285,7 +330,7 @@ export declare const bookingTravelerTravelDetails: import("drizzle-orm/pg-core")
285
330
  }>;
286
331
  export declare const bookingTravelerTravelDetailInsertSchema: z.ZodObject<{
287
332
  allocations: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
288
- passportPersonDocumentId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
333
+ documentPersonDocumentId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
289
334
  isLeadTraveler: z.ZodDefault<z.ZodBoolean>;
290
335
  sharingGroupId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
291
336
  roomTypeId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -308,7 +353,7 @@ export declare const bookingTravelerTravelDetailInsertSchema: z.ZodObject<{
308
353
  }, z.core.$strip>;
309
354
  export declare const bookingTravelerTravelDetailUpdateSchema: z.ZodObject<{
310
355
  allocations: z.ZodOptional<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>>;
311
- passportPersonDocumentId: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
356
+ documentPersonDocumentId: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
312
357
  isLeadTraveler: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
313
358
  sharingGroupId: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
314
359
  roomTypeId: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
@@ -339,7 +384,7 @@ export declare const bookingTravelerTravelDetailSelectSchema: z.ZodObject<{
339
384
  accessibilityEncrypted: z.ZodNullable<z.ZodOptional<z.ZodLazy<z.ZodNullable<z.ZodObject<{
340
385
  enc: z.ZodString;
341
386
  }, z.core.$strip>>>>>;
342
- passportPersonDocumentId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
387
+ documentPersonDocumentId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
343
388
  isLeadTraveler: z.ZodDefault<z.ZodBoolean>;
344
389
  sharingGroupId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
345
390
  roomTypeId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -1 +1 @@
1
- {"version":3,"file":"travel-details.d.ts","sourceRoot":"","sources":["../../src/schema/travel-details.ts"],"names":[],"mappings":"AAGA,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;AAEF,eAAO,MAAM,kCAAkC;;;;;EAK7C,CAAA;AAEF,eAAO,MAAM,2BAA2B,uCAAmC,CAAA;AAs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;AACjF,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kCAAkC,CAAC,CAAA;AAC7F,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kCAAkC,CAAC,CAAA;AAC7F,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAA;AAC/E,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"}
@@ -6,17 +6,44 @@ import { bookingTravelers } from "../schema.js";
6
6
  /**
7
7
  * Plaintext shape stored inside `identityEncrypted`. Snapshotted at
8
8
  * booking-traveler creation from the canonical `crm.people` +
9
- * `crm.person_documents` records — see `passportPersonDocumentId`
9
+ * `crm.person_documents` records — see `documentPersonDocumentId`
10
10
  * for provenance back to the source document row.
11
11
  */
12
- export const bookingTravelerIdentitySchema = z.object({
12
+ export const bookingTravelerIdentityDocumentTypeSchema = z.enum([
13
+ "passport",
14
+ "id_card",
15
+ "driver_license",
16
+ "visa",
17
+ "other",
18
+ ]);
19
+ const legacyBookingTravelerIdentitySchema = z.object({
13
20
  nationality: z.string().optional().nullable(),
21
+ documentType: bookingTravelerIdentityDocumentTypeSchema.optional().nullable(),
22
+ documentNumber: z.string().optional().nullable(),
23
+ documentExpiry: z.string().optional().nullable(),
24
+ documentIssuingCountry: z.string().optional().nullable(),
25
+ documentIssuingAuthority: z.string().optional().nullable(),
14
26
  passportNumber: z.string().optional().nullable(),
15
27
  passportExpiry: z.string().optional().nullable(),
16
28
  passportIssuingCountry: z.string().optional().nullable(),
17
29
  passportIssuingAuthority: z.string().optional().nullable(),
18
30
  dateOfBirth: z.string().optional().nullable(),
19
31
  });
32
+ export const bookingTravelerIdentitySchema = legacyBookingTravelerIdentitySchema.transform((value) => {
33
+ const legacyHasPassport = value.passportNumber != null ||
34
+ value.passportExpiry != null ||
35
+ value.passportIssuingCountry != null ||
36
+ value.passportIssuingAuthority != null;
37
+ return {
38
+ nationality: value.nationality ?? null,
39
+ documentType: value.documentType ?? (legacyHasPassport ? "passport" : null),
40
+ documentNumber: value.documentNumber ?? value.passportNumber ?? null,
41
+ documentExpiry: value.documentExpiry ?? value.passportExpiry ?? null,
42
+ documentIssuingCountry: value.documentIssuingCountry ?? value.passportIssuingCountry ?? null,
43
+ documentIssuingAuthority: value.documentIssuingAuthority ?? value.passportIssuingAuthority ?? null,
44
+ dateOfBirth: value.dateOfBirth ?? null,
45
+ };
46
+ });
20
47
  export const bookingTravelerDietarySchema = z.object({
21
48
  dietaryRequirements: z.string().optional().nullable(),
22
49
  });
@@ -33,11 +60,12 @@ export const travelerAllocationMapSchema = z.record(z.string(), z.string());
33
60
  const decryptedBookingTravelerTravelDetailRecordSchema = z.object({
34
61
  travelerId: z.string(),
35
62
  nationality: z.string().nullable(),
36
- passportNumber: z.string().nullable(),
37
- passportExpiry: z.string().nullable(),
38
- passportIssuingCountry: z.string().nullable(),
39
- passportIssuingAuthority: z.string().nullable(),
40
- passportPersonDocumentId: z.string().nullable(),
63
+ documentType: bookingTravelerIdentityDocumentTypeSchema.nullable(),
64
+ documentNumber: z.string().nullable(),
65
+ documentExpiry: z.string().nullable(),
66
+ documentIssuingCountry: z.string().nullable(),
67
+ documentIssuingAuthority: z.string().nullable(),
68
+ documentPersonDocumentId: z.string().nullable(),
41
69
  dateOfBirth: z.string().nullable(),
42
70
  dietaryRequirements: z.string().nullable(),
43
71
  accessibilityNeeds: z.string().nullable(),
@@ -63,7 +91,7 @@ export const bookingTravelerTravelDetails = pgTable("booking_traveler_travel_det
63
91
  * intentionally has no FK — the snapshot is owned by the booking
64
92
  * even if the source document is later edited or deleted.
65
93
  */
66
- passportPersonDocumentId: text("passport_person_document_id"),
94
+ documentPersonDocumentId: text("document_person_document_id"),
67
95
  isLeadTraveler: boolean("is_lead_traveler").notNull().default(false),
68
96
  /**
69
97
  * Groups travelers across different bookings who share one resource
@@ -112,7 +140,7 @@ const bookingTravelerTravelDetailRecordCoreSchema = z.object({
112
140
  .lazy(() => kmsEnvelopeSchema)
113
141
  .optional()
114
142
  .nullable(),
115
- passportPersonDocumentId: z.string().nullable().optional(),
143
+ documentPersonDocumentId: z.string().nullable().optional(),
116
144
  isLeadTraveler: z.boolean().default(false),
117
145
  sharingGroupId: z.string().nullable().optional(),
118
146
  roomTypeId: z.string().nullable().optional(),