@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.
- package/dist/index.d.ts +6 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -3
- package/dist/pii.d.ts +16 -9
- package/dist/pii.d.ts.map +1 -1
- package/dist/pii.js +76 -70
- package/dist/routes-offers.d.ts +462 -28
- package/dist/routes-offers.d.ts.map +1 -1
- package/dist/routes-offers.js +199 -84
- package/dist/routes-orders.d.ts +461 -27
- package/dist/routes-orders.d.ts.map +1 -1
- package/dist/routes-orders.js +199 -84
- package/dist/routes-shared.d.ts +20 -13
- package/dist/routes-shared.d.ts.map +1 -1
- package/dist/routes-shared.js +7 -6
- package/dist/schema/participant-identity.d.ts +43 -6
- package/dist/schema/participant-identity.d.ts.map +1 -1
- package/dist/schema/participant-identity.js +12 -5
- package/dist/schema-audit.d.ts +4 -4
- package/dist/schema-audit.js +3 -3
- package/dist/schema-contacts.d.ts +529 -0
- package/dist/schema-contacts.d.ts.map +1 -0
- package/dist/schema-contacts.js +57 -0
- package/dist/schema-offers.d.ts +177 -3
- package/dist/schema-offers.d.ts.map +1 -1
- package/dist/schema-offers.js +26 -15
- package/dist/schema-orders.d.ts +177 -3
- package/dist/schema-orders.d.ts.map +1 -1
- package/dist/schema-orders.js +31 -20
- package/dist/schema-relations.d.ts +24 -0
- package/dist/schema-relations.d.ts.map +1 -1
- package/dist/schema-relations.js +40 -2
- package/dist/schema-shared.d.ts +3 -1
- package/dist/schema-shared.d.ts.map +1 -1
- package/dist/schema-shared.js +8 -2
- package/dist/schema-staff.d.ts +529 -0
- package/dist/schema-staff.d.ts.map +1 -0
- package/dist/schema-staff.js +57 -0
- package/dist/schema.d.ts +2 -0
- package/dist/schema.d.ts.map +1 -1
- package/dist/schema.js +2 -0
- package/dist/service-offers.d.ts +275 -29
- package/dist/service-offers.d.ts.map +1 -1
- package/dist/service-offers.js +306 -43
- package/dist/service-orders.d.ts +227 -25
- package/dist/service-orders.d.ts.map +1 -1
- package/dist/service-orders.js +127 -22
- package/dist/service-shared.d.ts +144 -22
- package/dist/service-shared.d.ts.map +1 -1
- package/dist/service-shared.js +30 -2
- package/dist/service.d.ts +62 -22
- package/dist/service.d.ts.map +1 -1
- package/dist/service.js +42 -2
- package/dist/storefront-offers.d.ts +39 -5
- package/dist/storefront-offers.d.ts.map +1 -1
- package/dist/storefront-offers.js +3 -3
- package/dist/validation.d.ts +674 -36
- package/dist/validation.d.ts.map +1 -1
- package/dist/validation.js +186 -29
- package/package.json +5 -5
package/dist/schema-offers.d.ts
CHANGED
|
@@ -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" | "
|
|
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", "
|
|
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
|
-
|
|
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.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema-offers.d.ts","sourceRoot":"","sources":["../src/schema-offers.ts"],"names":[],"mappings":"AAuBA,eAAO,MAAM,MAAM
|
|
1
|
+
{"version":3,"file":"schema-offers.d.ts","sourceRoot":"","sources":["../src/schema-offers.ts"],"names":[],"mappings":"AAuBA,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAqDlB,CAAA;AAED,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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E,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"}
|
package/dist/schema-offers.js
CHANGED
|
@@ -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("
|
|
34
|
-
index("
|
|
35
|
-
index("
|
|
36
|
-
index("
|
|
37
|
-
index("
|
|
38
|
-
index("
|
|
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("
|
|
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("
|
|
100
|
-
index("
|
|
101
|
-
index("
|
|
102
|
-
index("
|
|
103
|
-
index("
|
|
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
|
-
|
|
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("
|
|
119
|
-
uniqueIndex("uidx_offer_item_participants").on(table.offerItemId, table.
|
|
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
|
]);
|
package/dist/schema-orders.d.ts
CHANGED
|
@@ -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" | "
|
|
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", "
|
|
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
|
-
|
|
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
|
|
1
|
+
{"version":3,"file":"schema-orders.d.ts","sourceRoot":"","sources":["../src/schema-orders.ts"],"names":[],"mappings":"AA0BA,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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uB,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"}
|
package/dist/schema-orders.js
CHANGED
|
@@ -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("
|
|
35
|
-
index("
|
|
36
|
-
index("
|
|
37
|
-
index("
|
|
38
|
-
index("
|
|
39
|
-
index("
|
|
40
|
-
index("
|
|
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("
|
|
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("
|
|
104
|
-
index("
|
|
105
|
-
index("
|
|
106
|
-
index("
|
|
107
|
-
index("
|
|
108
|
-
index("
|
|
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
|
-
|
|
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("
|
|
124
|
-
uniqueIndex("uidx_order_item_participants").on(table.orderItemId, table.
|
|
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("
|
|
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("
|
|
148
|
-
index("
|
|
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
|
]);
|