@voyantjs/transactions 0.6.7 → 0.6.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.
Files changed (60) hide show
  1. package/dist/index.d.ts +6 -6
  2. package/dist/index.d.ts.map +1 -1
  3. package/dist/index.js +3 -3
  4. package/dist/pii.d.ts +16 -9
  5. package/dist/pii.d.ts.map +1 -1
  6. package/dist/pii.js +76 -70
  7. package/dist/routes-offers.d.ts +462 -28
  8. package/dist/routes-offers.d.ts.map +1 -1
  9. package/dist/routes-offers.js +199 -84
  10. package/dist/routes-orders.d.ts +461 -27
  11. package/dist/routes-orders.d.ts.map +1 -1
  12. package/dist/routes-orders.js +199 -84
  13. package/dist/routes-shared.d.ts +20 -13
  14. package/dist/routes-shared.d.ts.map +1 -1
  15. package/dist/routes-shared.js +7 -6
  16. package/dist/schema/participant-identity.d.ts +43 -6
  17. package/dist/schema/participant-identity.d.ts.map +1 -1
  18. package/dist/schema/participant-identity.js +12 -5
  19. package/dist/schema-audit.d.ts +4 -4
  20. package/dist/schema-audit.js +3 -3
  21. package/dist/schema-contacts.d.ts +529 -0
  22. package/dist/schema-contacts.d.ts.map +1 -0
  23. package/dist/schema-contacts.js +57 -0
  24. package/dist/schema-offers.d.ts +177 -3
  25. package/dist/schema-offers.d.ts.map +1 -1
  26. package/dist/schema-offers.js +26 -15
  27. package/dist/schema-orders.d.ts +177 -3
  28. package/dist/schema-orders.d.ts.map +1 -1
  29. package/dist/schema-orders.js +31 -20
  30. package/dist/schema-relations.d.ts +24 -0
  31. package/dist/schema-relations.d.ts.map +1 -1
  32. package/dist/schema-relations.js +40 -2
  33. package/dist/schema-shared.d.ts +3 -1
  34. package/dist/schema-shared.d.ts.map +1 -1
  35. package/dist/schema-shared.js +8 -2
  36. package/dist/schema-staff.d.ts +529 -0
  37. package/dist/schema-staff.d.ts.map +1 -0
  38. package/dist/schema-staff.js +57 -0
  39. package/dist/schema.d.ts +2 -0
  40. package/dist/schema.d.ts.map +1 -1
  41. package/dist/schema.js +2 -0
  42. package/dist/service-offers.d.ts +275 -29
  43. package/dist/service-offers.d.ts.map +1 -1
  44. package/dist/service-offers.js +306 -43
  45. package/dist/service-orders.d.ts +227 -25
  46. package/dist/service-orders.d.ts.map +1 -1
  47. package/dist/service-orders.js +127 -22
  48. package/dist/service-shared.d.ts +144 -22
  49. package/dist/service-shared.d.ts.map +1 -1
  50. package/dist/service-shared.js +30 -2
  51. package/dist/service.d.ts +62 -22
  52. package/dist/service.d.ts.map +1 -1
  53. package/dist/service.js +42 -2
  54. package/dist/storefront-offers.d.ts +39 -5
  55. package/dist/storefront-offers.d.ts.map +1 -1
  56. package/dist/storefront-offers.js +3 -3
  57. package/dist/validation.d.ts +674 -36
  58. package/dist/validation.d.ts.map +1 -1
  59. package/dist/validation.js +186 -29
  60. package/package.json +5 -5
@@ -172,6 +172,176 @@ export declare const offers: import("drizzle-orm/pg-core").PgTableWithColumns<{
172
172
  identity: undefined;
173
173
  generated: undefined;
174
174
  }, {}, {}>;
175
+ contactFirstName: import("drizzle-orm/pg-core").PgColumn<{
176
+ name: "contact_first_name";
177
+ tableName: "offers";
178
+ dataType: "string";
179
+ columnType: "PgText";
180
+ data: string;
181
+ driverParam: string;
182
+ notNull: false;
183
+ hasDefault: false;
184
+ isPrimaryKey: false;
185
+ isAutoincrement: false;
186
+ hasRuntimeDefault: false;
187
+ enumValues: [string, ...string[]];
188
+ baseColumn: never;
189
+ identity: undefined;
190
+ generated: undefined;
191
+ }, {}, {}>;
192
+ contactLastName: import("drizzle-orm/pg-core").PgColumn<{
193
+ name: "contact_last_name";
194
+ tableName: "offers";
195
+ dataType: "string";
196
+ columnType: "PgText";
197
+ data: string;
198
+ driverParam: string;
199
+ notNull: false;
200
+ hasDefault: false;
201
+ isPrimaryKey: false;
202
+ isAutoincrement: false;
203
+ hasRuntimeDefault: false;
204
+ enumValues: [string, ...string[]];
205
+ baseColumn: never;
206
+ identity: undefined;
207
+ generated: undefined;
208
+ }, {}, {}>;
209
+ contactEmail: import("drizzle-orm/pg-core").PgColumn<{
210
+ name: "contact_email";
211
+ tableName: "offers";
212
+ dataType: "string";
213
+ columnType: "PgText";
214
+ data: string;
215
+ driverParam: string;
216
+ notNull: false;
217
+ hasDefault: false;
218
+ isPrimaryKey: false;
219
+ isAutoincrement: false;
220
+ hasRuntimeDefault: false;
221
+ enumValues: [string, ...string[]];
222
+ baseColumn: never;
223
+ identity: undefined;
224
+ generated: undefined;
225
+ }, {}, {}>;
226
+ contactPhone: import("drizzle-orm/pg-core").PgColumn<{
227
+ name: "contact_phone";
228
+ tableName: "offers";
229
+ dataType: "string";
230
+ columnType: "PgText";
231
+ data: string;
232
+ driverParam: string;
233
+ notNull: false;
234
+ hasDefault: false;
235
+ isPrimaryKey: false;
236
+ isAutoincrement: false;
237
+ hasRuntimeDefault: false;
238
+ enumValues: [string, ...string[]];
239
+ baseColumn: never;
240
+ identity: undefined;
241
+ generated: undefined;
242
+ }, {}, {}>;
243
+ contactPreferredLanguage: import("drizzle-orm/pg-core").PgColumn<{
244
+ name: "contact_preferred_language";
245
+ tableName: "offers";
246
+ dataType: "string";
247
+ columnType: "PgText";
248
+ data: string;
249
+ driverParam: string;
250
+ notNull: false;
251
+ hasDefault: false;
252
+ isPrimaryKey: false;
253
+ isAutoincrement: false;
254
+ hasRuntimeDefault: false;
255
+ enumValues: [string, ...string[]];
256
+ baseColumn: never;
257
+ identity: undefined;
258
+ generated: undefined;
259
+ }, {}, {}>;
260
+ contactCountry: import("drizzle-orm/pg-core").PgColumn<{
261
+ name: "contact_country";
262
+ tableName: "offers";
263
+ dataType: "string";
264
+ columnType: "PgText";
265
+ data: string;
266
+ driverParam: string;
267
+ notNull: false;
268
+ hasDefault: false;
269
+ isPrimaryKey: false;
270
+ isAutoincrement: false;
271
+ hasRuntimeDefault: false;
272
+ enumValues: [string, ...string[]];
273
+ baseColumn: never;
274
+ identity: undefined;
275
+ generated: undefined;
276
+ }, {}, {}>;
277
+ contactRegion: import("drizzle-orm/pg-core").PgColumn<{
278
+ name: "contact_region";
279
+ tableName: "offers";
280
+ dataType: "string";
281
+ columnType: "PgText";
282
+ data: string;
283
+ driverParam: string;
284
+ notNull: false;
285
+ hasDefault: false;
286
+ isPrimaryKey: false;
287
+ isAutoincrement: false;
288
+ hasRuntimeDefault: false;
289
+ enumValues: [string, ...string[]];
290
+ baseColumn: never;
291
+ identity: undefined;
292
+ generated: undefined;
293
+ }, {}, {}>;
294
+ contactCity: import("drizzle-orm/pg-core").PgColumn<{
295
+ name: "contact_city";
296
+ tableName: "offers";
297
+ dataType: "string";
298
+ columnType: "PgText";
299
+ data: string;
300
+ driverParam: string;
301
+ notNull: false;
302
+ hasDefault: false;
303
+ isPrimaryKey: false;
304
+ isAutoincrement: false;
305
+ hasRuntimeDefault: false;
306
+ enumValues: [string, ...string[]];
307
+ baseColumn: never;
308
+ identity: undefined;
309
+ generated: undefined;
310
+ }, {}, {}>;
311
+ contactAddressLine1: import("drizzle-orm/pg-core").PgColumn<{
312
+ name: "contact_address_line1";
313
+ tableName: "offers";
314
+ dataType: "string";
315
+ columnType: "PgText";
316
+ data: string;
317
+ driverParam: string;
318
+ notNull: false;
319
+ hasDefault: false;
320
+ isPrimaryKey: false;
321
+ isAutoincrement: false;
322
+ hasRuntimeDefault: false;
323
+ enumValues: [string, ...string[]];
324
+ baseColumn: never;
325
+ identity: undefined;
326
+ generated: undefined;
327
+ }, {}, {}>;
328
+ contactPostalCode: import("drizzle-orm/pg-core").PgColumn<{
329
+ name: "contact_postal_code";
330
+ tableName: "offers";
331
+ dataType: "string";
332
+ columnType: "PgText";
333
+ data: string;
334
+ driverParam: string;
335
+ notNull: false;
336
+ hasDefault: false;
337
+ isPrimaryKey: false;
338
+ isAutoincrement: false;
339
+ hasRuntimeDefault: false;
340
+ enumValues: [string, ...string[]];
341
+ baseColumn: never;
342
+ identity: undefined;
343
+ generated: undefined;
344
+ }, {}, {}>;
175
345
  currency: import("drizzle-orm/pg-core").PgColumn<{
176
346
  name: "currency";
177
347
  tableName: "offers";
@@ -524,14 +694,14 @@ export declare const offerParticipants: import("drizzle-orm/pg-core").PgTableWit
524
694
  tableName: "offer_participants";
525
695
  dataType: "string";
526
696
  columnType: "PgEnumColumn";
527
- data: "staff" | "other" | "traveler" | "booker" | "contact" | "occupant";
697
+ data: "staff" | "other" | "traveler" | "occupant";
528
698
  driverParam: string;
529
699
  notNull: true;
530
700
  hasDefault: true;
531
701
  isPrimaryKey: false;
532
702
  isAutoincrement: false;
533
703
  hasRuntimeDefault: false;
534
- enumValues: ["traveler", "booker", "contact", "occupant", "staff", "other"];
704
+ enumValues: ["traveler", "occupant", "staff", "other"];
535
705
  baseColumn: never;
536
706
  identity: undefined;
537
707
  generated: undefined;
@@ -1219,7 +1389,7 @@ export declare const offerItemParticipants: import("drizzle-orm/pg-core").PgTabl
1219
1389
  identity: undefined;
1220
1390
  generated: undefined;
1221
1391
  }, {}, {}>;
1222
- participantId: import("drizzle-orm/pg-core").PgColumn<{
1392
+ travelerId: import("drizzle-orm/pg-core").PgColumn<{
1223
1393
  name: string;
1224
1394
  tableName: "offer_item_participants";
1225
1395
  dataType: "string";
@@ -1294,8 +1464,12 @@ export type Offer = typeof offers.$inferSelect;
1294
1464
  export type NewOffer = typeof offers.$inferInsert;
1295
1465
  export type OfferParticipant = typeof offerParticipants.$inferSelect;
1296
1466
  export type NewOfferParticipant = typeof offerParticipants.$inferInsert;
1467
+ export type OfferTraveler = OfferParticipant;
1468
+ export type NewOfferTraveler = NewOfferParticipant;
1297
1469
  export type OfferItem = typeof offerItems.$inferSelect;
1298
1470
  export type NewOfferItem = typeof offerItems.$inferInsert;
1299
1471
  export type OfferItemParticipant = typeof offerItemParticipants.$inferSelect;
1300
1472
  export type NewOfferItemParticipant = typeof offerItemParticipants.$inferInsert;
1473
+ export type OfferItemTraveler = OfferItemParticipant;
1474
+ export type NewOfferItemTraveler = NewOfferItemParticipant;
1301
1475
  //# sourceMappingURL=schema-offers.d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pD,MAAM,MAAM,oBAAoB,GAAG,uBAAuB,CAAA"}
@@ -12,6 +12,16 @@ export const offers = pgTable("offers", {
12
12
  quoteId: text("quote_id"),
13
13
  marketId: text("market_id"),
14
14
  sourceChannelId: text("source_channel_id"),
15
+ contactFirstName: text("contact_first_name"),
16
+ contactLastName: text("contact_last_name"),
17
+ contactEmail: text("contact_email"),
18
+ contactPhone: text("contact_phone"),
19
+ contactPreferredLanguage: text("contact_preferred_language"),
20
+ contactCountry: text("contact_country"),
21
+ contactRegion: text("contact_region"),
22
+ contactCity: text("contact_city"),
23
+ contactAddressLine1: text("contact_address_line1"),
24
+ contactPostalCode: text("contact_postal_code"),
15
25
  currency: text("currency").notNull(),
16
26
  baseCurrency: text("base_currency"),
17
27
  fxRateSetId: text("fx_rate_set_id"),
@@ -30,12 +40,13 @@ export const offers = pgTable("offers", {
30
40
  createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
31
41
  updatedAt: timestamp("updated_at", { withTimezone: true }).notNull().defaultNow(),
32
42
  }, (table) => [
33
- index("idx_offers_status").on(table.status),
34
- index("idx_offers_person").on(table.personId),
35
- index("idx_offers_organization").on(table.organizationId),
36
- index("idx_offers_opportunity").on(table.opportunityId),
37
- index("idx_offers_quote").on(table.quoteId),
38
- index("idx_offers_market").on(table.marketId),
43
+ index("idx_offers_created").on(table.createdAt),
44
+ index("idx_offers_status_created").on(table.status, table.createdAt),
45
+ index("idx_offers_person_created").on(table.personId, table.createdAt),
46
+ index("idx_offers_organization_created").on(table.organizationId, table.createdAt),
47
+ index("idx_offers_opportunity_created").on(table.opportunityId, table.createdAt),
48
+ index("idx_offers_quote_created").on(table.quoteId, table.createdAt),
49
+ index("idx_offers_market_created").on(table.marketId, table.createdAt),
39
50
  index("idx_offers_channel").on(table.sourceChannelId),
40
51
  index("idx_offers_fx_rate_set").on(table.fxRateSetId),
41
52
  index("idx_offers_valid_until").on(table.validUntil),
@@ -62,7 +73,7 @@ export const offerParticipants = pgTable("offer_participants", {
62
73
  updatedAt: timestamp("updated_at", { withTimezone: true }).notNull().defaultNow(),
63
74
  }, (table) => [
64
75
  index("idx_offer_participants_offer_created").on(table.offerId, table.createdAt),
65
- index("idx_offer_participants_person").on(table.personId),
76
+ index("idx_offer_participants_person_created").on(table.personId, table.createdAt),
66
77
  index("idx_offer_participants_type").on(table.participantType),
67
78
  ]);
68
79
  export const offerItems = pgTable("offer_items", {
@@ -96,18 +107,18 @@ export const offerItems = pgTable("offer_items", {
96
107
  updatedAt: timestamp("updated_at", { withTimezone: true }).notNull().defaultNow(),
97
108
  }, (table) => [
98
109
  index("idx_offer_items_offer_created").on(table.offerId, table.createdAt),
99
- index("idx_offer_items_product").on(table.productId),
100
- index("idx_offer_items_option").on(table.optionId),
101
- index("idx_offer_items_unit").on(table.unitId),
102
- index("idx_offer_items_slot").on(table.slotId),
103
- index("idx_offer_items_status").on(table.status),
110
+ index("idx_offer_items_product_created").on(table.productId, table.createdAt),
111
+ index("idx_offer_items_option_created").on(table.optionId, table.createdAt),
112
+ index("idx_offer_items_unit_created").on(table.unitId, table.createdAt),
113
+ index("idx_offer_items_slot_created").on(table.slotId, table.createdAt),
114
+ index("idx_offer_items_status_created").on(table.status, table.createdAt),
104
115
  ]);
105
116
  export const offerItemParticipants = pgTable("offer_item_participants", {
106
117
  id: typeId("offer_item_participants"),
107
118
  offerItemId: typeIdRef("offer_item_id")
108
119
  .notNull()
109
120
  .references(() => offerItems.id, { onDelete: "cascade" }),
110
- participantId: typeIdRef("participant_id")
121
+ travelerId: typeIdRef("traveler_id")
111
122
  .notNull()
112
123
  .references(() => offerParticipants.id, { onDelete: "cascade" }),
113
124
  role: transactionItemParticipantRoleEnum("role").notNull().default("traveler"),
@@ -115,6 +126,6 @@ export const offerItemParticipants = pgTable("offer_item_participants", {
115
126
  createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
116
127
  }, (table) => [
117
128
  index("idx_offer_item_participants_item_created").on(table.offerItemId, table.createdAt),
118
- index("idx_offer_item_participants_participant").on(table.participantId),
119
- uniqueIndex("uidx_offer_item_participants").on(table.offerItemId, table.participantId),
129
+ index("idx_offer_item_participants_participant_created").on(table.travelerId, table.createdAt),
130
+ uniqueIndex("uidx_offer_item_participants").on(table.offerItemId, table.travelerId),
120
131
  ]);
@@ -189,6 +189,176 @@ export declare const orders: import("drizzle-orm/pg-core").PgTableWithColumns<{
189
189
  identity: undefined;
190
190
  generated: undefined;
191
191
  }, {}, {}>;
192
+ contactFirstName: import("drizzle-orm/pg-core").PgColumn<{
193
+ name: "contact_first_name";
194
+ tableName: "orders";
195
+ dataType: "string";
196
+ columnType: "PgText";
197
+ data: string;
198
+ driverParam: string;
199
+ notNull: false;
200
+ hasDefault: false;
201
+ isPrimaryKey: false;
202
+ isAutoincrement: false;
203
+ hasRuntimeDefault: false;
204
+ enumValues: [string, ...string[]];
205
+ baseColumn: never;
206
+ identity: undefined;
207
+ generated: undefined;
208
+ }, {}, {}>;
209
+ contactLastName: import("drizzle-orm/pg-core").PgColumn<{
210
+ name: "contact_last_name";
211
+ tableName: "orders";
212
+ dataType: "string";
213
+ columnType: "PgText";
214
+ data: string;
215
+ driverParam: string;
216
+ notNull: false;
217
+ hasDefault: false;
218
+ isPrimaryKey: false;
219
+ isAutoincrement: false;
220
+ hasRuntimeDefault: false;
221
+ enumValues: [string, ...string[]];
222
+ baseColumn: never;
223
+ identity: undefined;
224
+ generated: undefined;
225
+ }, {}, {}>;
226
+ contactEmail: import("drizzle-orm/pg-core").PgColumn<{
227
+ name: "contact_email";
228
+ tableName: "orders";
229
+ dataType: "string";
230
+ columnType: "PgText";
231
+ data: string;
232
+ driverParam: string;
233
+ notNull: false;
234
+ hasDefault: false;
235
+ isPrimaryKey: false;
236
+ isAutoincrement: false;
237
+ hasRuntimeDefault: false;
238
+ enumValues: [string, ...string[]];
239
+ baseColumn: never;
240
+ identity: undefined;
241
+ generated: undefined;
242
+ }, {}, {}>;
243
+ contactPhone: import("drizzle-orm/pg-core").PgColumn<{
244
+ name: "contact_phone";
245
+ tableName: "orders";
246
+ dataType: "string";
247
+ columnType: "PgText";
248
+ data: string;
249
+ driverParam: string;
250
+ notNull: false;
251
+ hasDefault: false;
252
+ isPrimaryKey: false;
253
+ isAutoincrement: false;
254
+ hasRuntimeDefault: false;
255
+ enumValues: [string, ...string[]];
256
+ baseColumn: never;
257
+ identity: undefined;
258
+ generated: undefined;
259
+ }, {}, {}>;
260
+ contactPreferredLanguage: import("drizzle-orm/pg-core").PgColumn<{
261
+ name: "contact_preferred_language";
262
+ tableName: "orders";
263
+ dataType: "string";
264
+ columnType: "PgText";
265
+ data: string;
266
+ driverParam: string;
267
+ notNull: false;
268
+ hasDefault: false;
269
+ isPrimaryKey: false;
270
+ isAutoincrement: false;
271
+ hasRuntimeDefault: false;
272
+ enumValues: [string, ...string[]];
273
+ baseColumn: never;
274
+ identity: undefined;
275
+ generated: undefined;
276
+ }, {}, {}>;
277
+ contactCountry: import("drizzle-orm/pg-core").PgColumn<{
278
+ name: "contact_country";
279
+ tableName: "orders";
280
+ dataType: "string";
281
+ columnType: "PgText";
282
+ data: string;
283
+ driverParam: string;
284
+ notNull: false;
285
+ hasDefault: false;
286
+ isPrimaryKey: false;
287
+ isAutoincrement: false;
288
+ hasRuntimeDefault: false;
289
+ enumValues: [string, ...string[]];
290
+ baseColumn: never;
291
+ identity: undefined;
292
+ generated: undefined;
293
+ }, {}, {}>;
294
+ contactRegion: import("drizzle-orm/pg-core").PgColumn<{
295
+ name: "contact_region";
296
+ tableName: "orders";
297
+ dataType: "string";
298
+ columnType: "PgText";
299
+ data: string;
300
+ driverParam: string;
301
+ notNull: false;
302
+ hasDefault: false;
303
+ isPrimaryKey: false;
304
+ isAutoincrement: false;
305
+ hasRuntimeDefault: false;
306
+ enumValues: [string, ...string[]];
307
+ baseColumn: never;
308
+ identity: undefined;
309
+ generated: undefined;
310
+ }, {}, {}>;
311
+ contactCity: import("drizzle-orm/pg-core").PgColumn<{
312
+ name: "contact_city";
313
+ tableName: "orders";
314
+ dataType: "string";
315
+ columnType: "PgText";
316
+ data: string;
317
+ driverParam: string;
318
+ notNull: false;
319
+ hasDefault: false;
320
+ isPrimaryKey: false;
321
+ isAutoincrement: false;
322
+ hasRuntimeDefault: false;
323
+ enumValues: [string, ...string[]];
324
+ baseColumn: never;
325
+ identity: undefined;
326
+ generated: undefined;
327
+ }, {}, {}>;
328
+ contactAddressLine1: import("drizzle-orm/pg-core").PgColumn<{
329
+ name: "contact_address_line1";
330
+ tableName: "orders";
331
+ dataType: "string";
332
+ columnType: "PgText";
333
+ data: string;
334
+ driverParam: string;
335
+ notNull: false;
336
+ hasDefault: false;
337
+ isPrimaryKey: false;
338
+ isAutoincrement: false;
339
+ hasRuntimeDefault: false;
340
+ enumValues: [string, ...string[]];
341
+ baseColumn: never;
342
+ identity: undefined;
343
+ generated: undefined;
344
+ }, {}, {}>;
345
+ contactPostalCode: import("drizzle-orm/pg-core").PgColumn<{
346
+ name: "contact_postal_code";
347
+ tableName: "orders";
348
+ dataType: "string";
349
+ columnType: "PgText";
350
+ data: string;
351
+ driverParam: string;
352
+ notNull: false;
353
+ hasDefault: false;
354
+ isPrimaryKey: false;
355
+ isAutoincrement: false;
356
+ hasRuntimeDefault: false;
357
+ enumValues: [string, ...string[]];
358
+ baseColumn: never;
359
+ identity: undefined;
360
+ generated: undefined;
361
+ }, {}, {}>;
192
362
  currency: import("drizzle-orm/pg-core").PgColumn<{
193
363
  name: "currency";
194
364
  tableName: "orders";
@@ -524,14 +694,14 @@ export declare const orderParticipants: import("drizzle-orm/pg-core").PgTableWit
524
694
  tableName: "order_participants";
525
695
  dataType: "string";
526
696
  columnType: "PgEnumColumn";
527
- data: "staff" | "other" | "traveler" | "booker" | "contact" | "occupant";
697
+ data: "staff" | "other" | "traveler" | "occupant";
528
698
  driverParam: string;
529
699
  notNull: true;
530
700
  hasDefault: true;
531
701
  isPrimaryKey: false;
532
702
  isAutoincrement: false;
533
703
  hasRuntimeDefault: false;
534
- enumValues: ["traveler", "booker", "contact", "occupant", "staff", "other"];
704
+ enumValues: ["traveler", "occupant", "staff", "other"];
535
705
  baseColumn: never;
536
706
  identity: undefined;
537
707
  generated: undefined;
@@ -1236,7 +1406,7 @@ export declare const orderItemParticipants: import("drizzle-orm/pg-core").PgTabl
1236
1406
  identity: undefined;
1237
1407
  generated: undefined;
1238
1408
  }, {}, {}>;
1239
- participantId: import("drizzle-orm/pg-core").PgColumn<{
1409
+ travelerId: import("drizzle-orm/pg-core").PgColumn<{
1240
1410
  name: string;
1241
1411
  tableName: "order_item_participants";
1242
1412
  dataType: "string";
@@ -1573,10 +1743,14 @@ export type Order = typeof orders.$inferSelect;
1573
1743
  export type NewOrder = typeof orders.$inferInsert;
1574
1744
  export type OrderParticipant = typeof orderParticipants.$inferSelect;
1575
1745
  export type NewOrderParticipant = typeof orderParticipants.$inferInsert;
1746
+ export type OrderTraveler = OrderParticipant;
1747
+ export type NewOrderTraveler = NewOrderParticipant;
1576
1748
  export type OrderItem = typeof orderItems.$inferSelect;
1577
1749
  export type NewOrderItem = typeof orderItems.$inferInsert;
1578
1750
  export type OrderItemParticipant = typeof orderItemParticipants.$inferSelect;
1579
1751
  export type NewOrderItemParticipant = typeof orderItemParticipants.$inferInsert;
1752
+ export type OrderItemTraveler = OrderItemParticipant;
1753
+ export type NewOrderItemTraveler = NewOrderItemParticipant;
1580
1754
  export type OrderTerm = typeof orderTerms.$inferSelect;
1581
1755
  export type NewOrderTerm = typeof orderTerms.$inferInsert;
1582
1756
  //# sourceMappingURL=schema-orders.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"schema-orders.d.ts","sourceRoot":"","sources":["../src/schema-orders.ts"],"names":[],"mappings":"AA0BA,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AAA;AAC9C,MAAM,MAAM,QAAQ,GAAG,OAAO,MAAM,CAAC,YAAY,CAAA;AACjD,MAAM,MAAM,gBAAgB,GAAG,OAAO,iBAAiB,CAAC,YAAY,CAAA;AACpE,MAAM,MAAM,mBAAmB,GAAG,OAAO,iBAAiB,CAAC,YAAY,CAAA;AACvE,MAAM,MAAM,aAAa,GAAG,gBAAgB,CAAA;AAC5C,MAAM,MAAM,gBAAgB,GAAG,mBAAmB,CAAA;AAClD,MAAM,MAAM,SAAS,GAAG,OAAO,UAAU,CAAC,YAAY,CAAA;AACtD,MAAM,MAAM,YAAY,GAAG,OAAO,UAAU,CAAC,YAAY,CAAA;AACzD,MAAM,MAAM,oBAAoB,GAAG,OAAO,qBAAqB,CAAC,YAAY,CAAA;AAC5E,MAAM,MAAM,uBAAuB,GAAG,OAAO,qBAAqB,CAAC,YAAY,CAAA;AAC/E,MAAM,MAAM,iBAAiB,GAAG,oBAAoB,CAAA;AACpD,MAAM,MAAM,oBAAoB,GAAG,uBAAuB,CAAA;AAC1D,MAAM,MAAM,SAAS,GAAG,OAAO,UAAU,CAAC,YAAY,CAAA;AACtD,MAAM,MAAM,YAAY,GAAG,OAAO,UAAU,CAAC,YAAY,CAAA"}
@@ -14,6 +14,16 @@ export const orders = pgTable("orders", {
14
14
  quoteId: text("quote_id"),
15
15
  marketId: text("market_id"),
16
16
  sourceChannelId: text("source_channel_id"),
17
+ contactFirstName: text("contact_first_name"),
18
+ contactLastName: text("contact_last_name"),
19
+ contactEmail: text("contact_email"),
20
+ contactPhone: text("contact_phone"),
21
+ contactPreferredLanguage: text("contact_preferred_language"),
22
+ contactCountry: text("contact_country"),
23
+ contactRegion: text("contact_region"),
24
+ contactCity: text("contact_city"),
25
+ contactAddressLine1: text("contact_address_line1"),
26
+ contactPostalCode: text("contact_postal_code"),
17
27
  currency: text("currency").notNull(),
18
28
  baseCurrency: text("base_currency"),
19
29
  fxRateSetId: text("fx_rate_set_id"),
@@ -31,13 +41,14 @@ export const orders = pgTable("orders", {
31
41
  createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
32
42
  updatedAt: timestamp("updated_at", { withTimezone: true }).notNull().defaultNow(),
33
43
  }, (table) => [
34
- index("idx_orders_offer").on(table.offerId),
35
- index("idx_orders_status").on(table.status),
36
- index("idx_orders_person").on(table.personId),
37
- index("idx_orders_organization").on(table.organizationId),
38
- index("idx_orders_opportunity").on(table.opportunityId),
39
- index("idx_orders_quote").on(table.quoteId),
40
- index("idx_orders_market").on(table.marketId),
44
+ index("idx_orders_created").on(table.createdAt),
45
+ index("idx_orders_offer_created").on(table.offerId, table.createdAt),
46
+ index("idx_orders_status_created").on(table.status, table.createdAt),
47
+ index("idx_orders_person_created").on(table.personId, table.createdAt),
48
+ index("idx_orders_organization_created").on(table.organizationId, table.createdAt),
49
+ index("idx_orders_opportunity_created").on(table.opportunityId, table.createdAt),
50
+ index("idx_orders_quote_created").on(table.quoteId, table.createdAt),
51
+ index("idx_orders_market_created").on(table.marketId, table.createdAt),
41
52
  index("idx_orders_channel").on(table.sourceChannelId),
42
53
  index("idx_orders_fx_rate_set").on(table.fxRateSetId),
43
54
  ]);
@@ -63,7 +74,7 @@ export const orderParticipants = pgTable("order_participants", {
63
74
  updatedAt: timestamp("updated_at", { withTimezone: true }).notNull().defaultNow(),
64
75
  }, (table) => [
65
76
  index("idx_order_participants_order_created").on(table.orderId, table.createdAt),
66
- index("idx_order_participants_person").on(table.personId),
77
+ index("idx_order_participants_person_created").on(table.personId, table.createdAt),
67
78
  index("idx_order_participants_type").on(table.participantType),
68
79
  ]);
69
80
  export const orderItems = pgTable("order_items", {
@@ -100,19 +111,19 @@ export const orderItems = pgTable("order_items", {
100
111
  updatedAt: timestamp("updated_at", { withTimezone: true }).notNull().defaultNow(),
101
112
  }, (table) => [
102
113
  index("idx_order_items_order_created").on(table.orderId, table.createdAt),
103
- index("idx_order_items_offer_item").on(table.offerItemId),
104
- index("idx_order_items_product").on(table.productId),
105
- index("idx_order_items_option").on(table.optionId),
106
- index("idx_order_items_unit").on(table.unitId),
107
- index("idx_order_items_slot").on(table.slotId),
108
- index("idx_order_items_status").on(table.status),
114
+ index("idx_order_items_offer_item_created").on(table.offerItemId, table.createdAt),
115
+ index("idx_order_items_product_created").on(table.productId, table.createdAt),
116
+ index("idx_order_items_option_created").on(table.optionId, table.createdAt),
117
+ index("idx_order_items_unit_created").on(table.unitId, table.createdAt),
118
+ index("idx_order_items_slot_created").on(table.slotId, table.createdAt),
119
+ index("idx_order_items_status_created").on(table.status, table.createdAt),
109
120
  ]);
110
121
  export const orderItemParticipants = pgTable("order_item_participants", {
111
122
  id: typeId("order_item_participants"),
112
123
  orderItemId: typeIdRef("order_item_id")
113
124
  .notNull()
114
125
  .references(() => orderItems.id, { onDelete: "cascade" }),
115
- participantId: typeIdRef("participant_id")
126
+ travelerId: typeIdRef("traveler_id")
116
127
  .notNull()
117
128
  .references(() => orderParticipants.id, { onDelete: "cascade" }),
118
129
  role: transactionItemParticipantRoleEnum("role").notNull().default("traveler"),
@@ -120,8 +131,8 @@ export const orderItemParticipants = pgTable("order_item_participants", {
120
131
  createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
121
132
  }, (table) => [
122
133
  index("idx_order_item_participants_item_created").on(table.orderItemId, table.createdAt),
123
- index("idx_order_item_participants_participant").on(table.participantId),
124
- uniqueIndex("uidx_order_item_participants").on(table.orderItemId, table.participantId),
134
+ index("idx_order_item_participants_participant_created").on(table.travelerId, table.createdAt),
135
+ uniqueIndex("uidx_order_item_participants").on(table.orderItemId, table.travelerId),
125
136
  ]);
126
137
  export const orderTerms = pgTable("order_terms", {
127
138
  id: typeId("order_terms"),
@@ -142,8 +153,8 @@ export const orderTerms = pgTable("order_terms", {
142
153
  createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
143
154
  updatedAt: timestamp("updated_at", { withTimezone: true }).notNull().defaultNow(),
144
155
  }, (table) => [
145
- index("idx_order_terms_offer").on(table.offerId),
156
+ index("idx_order_terms_offer_sort").on(table.offerId, table.sortOrder, table.createdAt),
146
157
  index("idx_order_terms_order_sort").on(table.orderId, table.sortOrder, table.createdAt),
147
- index("idx_order_terms_type").on(table.termType),
148
- index("idx_order_terms_acceptance").on(table.acceptanceStatus),
158
+ index("idx_order_terms_type_sort").on(table.termType, table.sortOrder, table.createdAt),
159
+ index("idx_order_terms_acceptance_sort").on(table.acceptanceStatus, table.sortOrder, table.createdAt),
149
160
  ]);