@voyantjs/transactions 0.1.0

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.
@@ -0,0 +1,930 @@
1
+ import type { PostgresJsDatabase } from "drizzle-orm/postgres-js";
2
+ import type { z } from "zod";
3
+ import type { insertOfferItemParticipantSchema, insertOfferItemSchema, insertOfferParticipantSchema, insertOfferSchema, insertOrderItemParticipantSchema, insertOrderItemSchema, insertOrderParticipantSchema, insertOrderSchema, insertOrderTermSchema, offerItemListQuerySchema, offerItemParticipantListQuerySchema, offerListQuerySchema, offerParticipantListQuerySchema, orderItemListQuerySchema, orderItemParticipantListQuerySchema, orderListQuerySchema, orderParticipantListQuerySchema, orderTermListQuerySchema, updateOfferItemParticipantSchema, updateOfferItemSchema, updateOfferParticipantSchema, updateOfferSchema, updateOrderItemParticipantSchema, updateOrderItemSchema, updateOrderParticipantSchema, updateOrderSchema, updateOrderTermSchema } from "./validation.js";
4
+ type OfferListQuery = z.infer<typeof offerListQuerySchema>;
5
+ type OfferParticipantListQuery = z.infer<typeof offerParticipantListQuerySchema>;
6
+ type OfferItemListQuery = z.infer<typeof offerItemListQuerySchema>;
7
+ type OfferItemParticipantListQuery = z.infer<typeof offerItemParticipantListQuerySchema>;
8
+ type OrderListQuery = z.infer<typeof orderListQuerySchema>;
9
+ type OrderParticipantListQuery = z.infer<typeof orderParticipantListQuerySchema>;
10
+ type OrderItemListQuery = z.infer<typeof orderItemListQuerySchema>;
11
+ type OrderItemParticipantListQuery = z.infer<typeof orderItemParticipantListQuerySchema>;
12
+ type OrderTermListQuery = z.infer<typeof orderTermListQuerySchema>;
13
+ type CreateOfferInput = z.infer<typeof insertOfferSchema>;
14
+ type UpdateOfferInput = z.infer<typeof updateOfferSchema>;
15
+ type CreateOfferParticipantInput = z.infer<typeof insertOfferParticipantSchema>;
16
+ type UpdateOfferParticipantInput = z.infer<typeof updateOfferParticipantSchema>;
17
+ type CreateOfferItemInput = z.infer<typeof insertOfferItemSchema>;
18
+ type UpdateOfferItemInput = z.infer<typeof updateOfferItemSchema>;
19
+ type CreateOfferItemParticipantInput = z.infer<typeof insertOfferItemParticipantSchema>;
20
+ type UpdateOfferItemParticipantInput = z.infer<typeof updateOfferItemParticipantSchema>;
21
+ type CreateOrderInput = z.infer<typeof insertOrderSchema>;
22
+ type UpdateOrderInput = z.infer<typeof updateOrderSchema>;
23
+ type CreateOrderParticipantInput = z.infer<typeof insertOrderParticipantSchema>;
24
+ type UpdateOrderParticipantInput = z.infer<typeof updateOrderParticipantSchema>;
25
+ type CreateOrderItemInput = z.infer<typeof insertOrderItemSchema>;
26
+ type UpdateOrderItemInput = z.infer<typeof updateOrderItemSchema>;
27
+ type CreateOrderItemParticipantInput = z.infer<typeof insertOrderItemParticipantSchema>;
28
+ type UpdateOrderItemParticipantInput = z.infer<typeof updateOrderItemParticipantSchema>;
29
+ type CreateOrderTermInput = z.infer<typeof insertOrderTermSchema>;
30
+ type UpdateOrderTermInput = z.infer<typeof updateOrderTermSchema>;
31
+ type OfferBundleParticipantInput = Omit<CreateOfferParticipantInput, "offerId">;
32
+ type OfferBundleItemInput = Omit<CreateOfferItemInput, "offerId">;
33
+ type OfferBundleItemParticipantInput = Omit<CreateOfferItemParticipantInput, "offerItemId" | "participantId"> & {
34
+ itemIndex: number;
35
+ participantIndex: number;
36
+ };
37
+ type CreateOfferBundleInput = {
38
+ offer: CreateOfferInput;
39
+ participants?: OfferBundleParticipantInput[];
40
+ items: OfferBundleItemInput[];
41
+ itemParticipants?: OfferBundleItemParticipantInput[];
42
+ };
43
+ export declare const transactionsService: {
44
+ listOffers(db: PostgresJsDatabase, query: OfferListQuery): Promise<{
45
+ data: {
46
+ id: string;
47
+ offerNumber: string;
48
+ title: string;
49
+ status: "draft" | "published" | "sent" | "accepted" | "expired" | "withdrawn" | "converted";
50
+ personId: string | null;
51
+ organizationId: string | null;
52
+ opportunityId: string | null;
53
+ quoteId: string | null;
54
+ marketId: string | null;
55
+ sourceChannelId: string | null;
56
+ currency: string;
57
+ baseCurrency: string | null;
58
+ fxRateSetId: string | null;
59
+ subtotalAmountCents: number;
60
+ taxAmountCents: number;
61
+ feeAmountCents: number;
62
+ totalAmountCents: number;
63
+ costAmountCents: number;
64
+ validFrom: string | null;
65
+ validUntil: string | null;
66
+ sentAt: Date | null;
67
+ acceptedAt: Date | null;
68
+ convertedAt: Date | null;
69
+ notes: string | null;
70
+ metadata: unknown;
71
+ createdAt: Date;
72
+ updatedAt: Date;
73
+ }[];
74
+ total: number;
75
+ limit: number;
76
+ offset: number;
77
+ }>;
78
+ getOfferById(db: PostgresJsDatabase, id: string): Promise<{
79
+ id: string;
80
+ offerNumber: string;
81
+ title: string;
82
+ status: "draft" | "published" | "sent" | "accepted" | "expired" | "withdrawn" | "converted";
83
+ personId: string | null;
84
+ organizationId: string | null;
85
+ opportunityId: string | null;
86
+ quoteId: string | null;
87
+ marketId: string | null;
88
+ sourceChannelId: string | null;
89
+ currency: string;
90
+ baseCurrency: string | null;
91
+ fxRateSetId: string | null;
92
+ subtotalAmountCents: number;
93
+ taxAmountCents: number;
94
+ feeAmountCents: number;
95
+ totalAmountCents: number;
96
+ costAmountCents: number;
97
+ validFrom: string | null;
98
+ validUntil: string | null;
99
+ sentAt: Date | null;
100
+ acceptedAt: Date | null;
101
+ convertedAt: Date | null;
102
+ notes: string | null;
103
+ metadata: unknown;
104
+ createdAt: Date;
105
+ updatedAt: Date;
106
+ } | null>;
107
+ createOffer(db: PostgresJsDatabase, data: CreateOfferInput): Promise<{
108
+ createdAt: Date;
109
+ updatedAt: Date;
110
+ id: string;
111
+ currency: string;
112
+ notes: string | null;
113
+ offerNumber: string;
114
+ title: string;
115
+ status: "draft" | "published" | "sent" | "accepted" | "expired" | "withdrawn" | "converted";
116
+ personId: string | null;
117
+ organizationId: string | null;
118
+ opportunityId: string | null;
119
+ quoteId: string | null;
120
+ marketId: string | null;
121
+ sourceChannelId: string | null;
122
+ baseCurrency: string | null;
123
+ fxRateSetId: string | null;
124
+ subtotalAmountCents: number;
125
+ taxAmountCents: number;
126
+ feeAmountCents: number;
127
+ totalAmountCents: number;
128
+ costAmountCents: number;
129
+ validFrom: string | null;
130
+ validUntil: string | null;
131
+ sentAt: Date | null;
132
+ acceptedAt: Date | null;
133
+ convertedAt: Date | null;
134
+ metadata: unknown;
135
+ } | null>;
136
+ createOfferBundle(db: PostgresJsDatabase, input: CreateOfferBundleInput): Promise<{
137
+ offer: {
138
+ createdAt: Date;
139
+ updatedAt: Date;
140
+ id: string;
141
+ currency: string;
142
+ notes: string | null;
143
+ offerNumber: string;
144
+ title: string;
145
+ status: "draft" | "published" | "sent" | "accepted" | "expired" | "withdrawn" | "converted";
146
+ personId: string | null;
147
+ organizationId: string | null;
148
+ opportunityId: string | null;
149
+ quoteId: string | null;
150
+ marketId: string | null;
151
+ sourceChannelId: string | null;
152
+ baseCurrency: string | null;
153
+ fxRateSetId: string | null;
154
+ subtotalAmountCents: number;
155
+ taxAmountCents: number;
156
+ feeAmountCents: number;
157
+ totalAmountCents: number;
158
+ costAmountCents: number;
159
+ validFrom: string | null;
160
+ validUntil: string | null;
161
+ sentAt: Date | null;
162
+ acceptedAt: Date | null;
163
+ convertedAt: Date | null;
164
+ metadata: unknown;
165
+ };
166
+ participants: {
167
+ id: string;
168
+ offerId: string;
169
+ personId: string | null;
170
+ participantType: "staff" | "other" | "traveler" | "booker" | "contact" | "occupant";
171
+ travelerCategory: "other" | "adult" | "child" | "infant" | "senior" | null;
172
+ firstName: string;
173
+ lastName: string;
174
+ email: string | null;
175
+ phone: string | null;
176
+ preferredLanguage: string | null;
177
+ isPrimary: boolean;
178
+ notes: string | null;
179
+ hasTravelIdentity: boolean;
180
+ createdAt: Date;
181
+ updatedAt: Date;
182
+ }[];
183
+ items: {
184
+ offerId: string;
185
+ createdAt: Date;
186
+ updatedAt: Date;
187
+ description: string | null;
188
+ id: string;
189
+ notes: string | null;
190
+ title: string;
191
+ status: "draft" | "confirmed" | "fulfilled" | "cancelled" | "priced";
192
+ taxAmountCents: number | null;
193
+ feeAmountCents: number | null;
194
+ metadata: unknown;
195
+ productId: string | null;
196
+ optionId: string | null;
197
+ unitId: string | null;
198
+ slotId: string | null;
199
+ itemType: "other" | "unit" | "service" | "extra" | "fee" | "tax" | "discount" | "adjustment" | "accommodation" | "transport";
200
+ serviceDate: string | null;
201
+ startsAt: Date | null;
202
+ endsAt: Date | null;
203
+ quantity: number;
204
+ sellCurrency: string;
205
+ unitSellAmountCents: number | null;
206
+ totalSellAmountCents: number | null;
207
+ costCurrency: string | null;
208
+ unitCostAmountCents: number | null;
209
+ totalCostAmountCents: number | null;
210
+ }[];
211
+ itemParticipants: {
212
+ createdAt: Date;
213
+ id: string;
214
+ isPrimary: boolean;
215
+ offerItemId: string;
216
+ participantId: string;
217
+ role: "other" | "traveler" | "occupant" | "primary_contact" | "beneficiary" | "service_assignee";
218
+ }[];
219
+ } | null>;
220
+ updateOffer(db: PostgresJsDatabase, id: string, data: UpdateOfferInput): Promise<{
221
+ id: string;
222
+ offerNumber: string;
223
+ title: string;
224
+ status: "draft" | "published" | "sent" | "accepted" | "expired" | "withdrawn" | "converted";
225
+ personId: string | null;
226
+ organizationId: string | null;
227
+ opportunityId: string | null;
228
+ quoteId: string | null;
229
+ marketId: string | null;
230
+ sourceChannelId: string | null;
231
+ currency: string;
232
+ baseCurrency: string | null;
233
+ fxRateSetId: string | null;
234
+ subtotalAmountCents: number;
235
+ taxAmountCents: number;
236
+ feeAmountCents: number;
237
+ totalAmountCents: number;
238
+ costAmountCents: number;
239
+ validFrom: string | null;
240
+ validUntil: string | null;
241
+ sentAt: Date | null;
242
+ acceptedAt: Date | null;
243
+ convertedAt: Date | null;
244
+ notes: string | null;
245
+ metadata: unknown;
246
+ createdAt: Date;
247
+ updatedAt: Date;
248
+ } | null>;
249
+ deleteOffer(db: PostgresJsDatabase, id: string): Promise<{
250
+ id: string;
251
+ } | null>;
252
+ listOfferParticipants(db: PostgresJsDatabase, query: OfferParticipantListQuery): Promise<{
253
+ data: {
254
+ id: string;
255
+ offerId: string;
256
+ personId: string | null;
257
+ participantType: "staff" | "other" | "traveler" | "booker" | "contact" | "occupant";
258
+ travelerCategory: "other" | "adult" | "child" | "infant" | "senior" | null;
259
+ firstName: string;
260
+ lastName: string;
261
+ email: string | null;
262
+ phone: string | null;
263
+ preferredLanguage: string | null;
264
+ isPrimary: boolean;
265
+ notes: string | null;
266
+ hasTravelIdentity: boolean;
267
+ createdAt: Date;
268
+ updatedAt: Date;
269
+ }[];
270
+ total: number;
271
+ limit: number;
272
+ offset: number;
273
+ }>;
274
+ getOfferParticipantById(db: PostgresJsDatabase, id: string): Promise<{
275
+ id: string;
276
+ offerId: string;
277
+ personId: string | null;
278
+ participantType: "staff" | "other" | "traveler" | "booker" | "contact" | "occupant";
279
+ travelerCategory: "other" | "adult" | "child" | "infant" | "senior" | null;
280
+ firstName: string;
281
+ lastName: string;
282
+ email: string | null;
283
+ phone: string | null;
284
+ preferredLanguage: string | null;
285
+ isPrimary: boolean;
286
+ notes: string | null;
287
+ hasTravelIdentity: boolean;
288
+ createdAt: Date;
289
+ updatedAt: Date;
290
+ } | null>;
291
+ createOfferParticipant(db: PostgresJsDatabase, data: CreateOfferParticipantInput): Promise<{
292
+ id: string;
293
+ offerId: string;
294
+ personId: string | null;
295
+ participantType: "staff" | "other" | "traveler" | "booker" | "contact" | "occupant";
296
+ travelerCategory: "other" | "adult" | "child" | "infant" | "senior" | null;
297
+ firstName: string;
298
+ lastName: string;
299
+ email: string | null;
300
+ phone: string | null;
301
+ preferredLanguage: string | null;
302
+ isPrimary: boolean;
303
+ notes: string | null;
304
+ hasTravelIdentity: boolean;
305
+ createdAt: Date;
306
+ updatedAt: Date;
307
+ } | null>;
308
+ updateOfferParticipant(db: PostgresJsDatabase, id: string, data: UpdateOfferParticipantInput): Promise<{
309
+ id: string;
310
+ offerId: string;
311
+ personId: string | null;
312
+ participantType: "staff" | "other" | "traveler" | "booker" | "contact" | "occupant";
313
+ travelerCategory: "other" | "adult" | "child" | "infant" | "senior" | null;
314
+ firstName: string;
315
+ lastName: string;
316
+ email: string | null;
317
+ phone: string | null;
318
+ preferredLanguage: string | null;
319
+ isPrimary: boolean;
320
+ notes: string | null;
321
+ hasTravelIdentity: boolean;
322
+ createdAt: Date;
323
+ updatedAt: Date;
324
+ } | null>;
325
+ deleteOfferParticipant(db: PostgresJsDatabase, id: string): Promise<{
326
+ id: string;
327
+ } | null>;
328
+ listOfferItems(db: PostgresJsDatabase, query: OfferItemListQuery): Promise<{
329
+ data: {
330
+ id: string;
331
+ offerId: string;
332
+ productId: string | null;
333
+ optionId: string | null;
334
+ unitId: string | null;
335
+ slotId: string | null;
336
+ title: string;
337
+ description: string | null;
338
+ itemType: "other" | "unit" | "service" | "extra" | "fee" | "tax" | "discount" | "adjustment" | "accommodation" | "transport";
339
+ status: "draft" | "confirmed" | "fulfilled" | "cancelled" | "priced";
340
+ serviceDate: string | null;
341
+ startsAt: Date | null;
342
+ endsAt: Date | null;
343
+ quantity: number;
344
+ sellCurrency: string;
345
+ unitSellAmountCents: number | null;
346
+ totalSellAmountCents: number | null;
347
+ taxAmountCents: number | null;
348
+ feeAmountCents: number | null;
349
+ costCurrency: string | null;
350
+ unitCostAmountCents: number | null;
351
+ totalCostAmountCents: number | null;
352
+ notes: string | null;
353
+ metadata: unknown;
354
+ createdAt: Date;
355
+ updatedAt: Date;
356
+ }[];
357
+ total: number;
358
+ limit: number;
359
+ offset: number;
360
+ }>;
361
+ getOfferItemById(db: PostgresJsDatabase, id: string): Promise<{
362
+ id: string;
363
+ offerId: string;
364
+ productId: string | null;
365
+ optionId: string | null;
366
+ unitId: string | null;
367
+ slotId: string | null;
368
+ title: string;
369
+ description: string | null;
370
+ itemType: "other" | "unit" | "service" | "extra" | "fee" | "tax" | "discount" | "adjustment" | "accommodation" | "transport";
371
+ status: "draft" | "confirmed" | "fulfilled" | "cancelled" | "priced";
372
+ serviceDate: string | null;
373
+ startsAt: Date | null;
374
+ endsAt: Date | null;
375
+ quantity: number;
376
+ sellCurrency: string;
377
+ unitSellAmountCents: number | null;
378
+ totalSellAmountCents: number | null;
379
+ taxAmountCents: number | null;
380
+ feeAmountCents: number | null;
381
+ costCurrency: string | null;
382
+ unitCostAmountCents: number | null;
383
+ totalCostAmountCents: number | null;
384
+ notes: string | null;
385
+ metadata: unknown;
386
+ createdAt: Date;
387
+ updatedAt: Date;
388
+ } | null>;
389
+ createOfferItem(db: PostgresJsDatabase, data: CreateOfferItemInput): Promise<{
390
+ offerId: string;
391
+ createdAt: Date;
392
+ updatedAt: Date;
393
+ description: string | null;
394
+ id: string;
395
+ notes: string | null;
396
+ title: string;
397
+ status: "draft" | "confirmed" | "fulfilled" | "cancelled" | "priced";
398
+ taxAmountCents: number | null;
399
+ feeAmountCents: number | null;
400
+ metadata: unknown;
401
+ productId: string | null;
402
+ optionId: string | null;
403
+ unitId: string | null;
404
+ slotId: string | null;
405
+ itemType: "other" | "unit" | "service" | "extra" | "fee" | "tax" | "discount" | "adjustment" | "accommodation" | "transport";
406
+ serviceDate: string | null;
407
+ startsAt: Date | null;
408
+ endsAt: Date | null;
409
+ quantity: number;
410
+ sellCurrency: string;
411
+ unitSellAmountCents: number | null;
412
+ totalSellAmountCents: number | null;
413
+ costCurrency: string | null;
414
+ unitCostAmountCents: number | null;
415
+ totalCostAmountCents: number | null;
416
+ } | null>;
417
+ updateOfferItem(db: PostgresJsDatabase, id: string, data: UpdateOfferItemInput): Promise<{
418
+ id: string;
419
+ offerId: string;
420
+ productId: string | null;
421
+ optionId: string | null;
422
+ unitId: string | null;
423
+ slotId: string | null;
424
+ title: string;
425
+ description: string | null;
426
+ itemType: "other" | "unit" | "service" | "extra" | "fee" | "tax" | "discount" | "adjustment" | "accommodation" | "transport";
427
+ status: "draft" | "confirmed" | "fulfilled" | "cancelled" | "priced";
428
+ serviceDate: string | null;
429
+ startsAt: Date | null;
430
+ endsAt: Date | null;
431
+ quantity: number;
432
+ sellCurrency: string;
433
+ unitSellAmountCents: number | null;
434
+ totalSellAmountCents: number | null;
435
+ taxAmountCents: number | null;
436
+ feeAmountCents: number | null;
437
+ costCurrency: string | null;
438
+ unitCostAmountCents: number | null;
439
+ totalCostAmountCents: number | null;
440
+ notes: string | null;
441
+ metadata: unknown;
442
+ createdAt: Date;
443
+ updatedAt: Date;
444
+ } | null>;
445
+ deleteOfferItem(db: PostgresJsDatabase, id: string): Promise<{
446
+ id: string;
447
+ } | null>;
448
+ listOfferItemParticipants(db: PostgresJsDatabase, query: OfferItemParticipantListQuery): Promise<{
449
+ data: {
450
+ id: string;
451
+ offerItemId: string;
452
+ participantId: string;
453
+ role: "other" | "traveler" | "occupant" | "primary_contact" | "beneficiary" | "service_assignee";
454
+ isPrimary: boolean;
455
+ createdAt: Date;
456
+ }[];
457
+ total: number;
458
+ limit: number;
459
+ offset: number;
460
+ }>;
461
+ getOfferItemParticipantById(db: PostgresJsDatabase, id: string): Promise<{
462
+ id: string;
463
+ offerItemId: string;
464
+ participantId: string;
465
+ role: "other" | "traveler" | "occupant" | "primary_contact" | "beneficiary" | "service_assignee";
466
+ isPrimary: boolean;
467
+ createdAt: Date;
468
+ } | null>;
469
+ createOfferItemParticipant(db: PostgresJsDatabase, data: CreateOfferItemParticipantInput): Promise<{
470
+ createdAt: Date;
471
+ id: string;
472
+ isPrimary: boolean;
473
+ offerItemId: string;
474
+ participantId: string;
475
+ role: "other" | "traveler" | "occupant" | "primary_contact" | "beneficiary" | "service_assignee";
476
+ } | null>;
477
+ updateOfferItemParticipant(db: PostgresJsDatabase, id: string, data: UpdateOfferItemParticipantInput): Promise<{
478
+ id: string;
479
+ offerItemId: string;
480
+ participantId: string;
481
+ role: "other" | "traveler" | "occupant" | "primary_contact" | "beneficiary" | "service_assignee";
482
+ isPrimary: boolean;
483
+ createdAt: Date;
484
+ } | null>;
485
+ deleteOfferItemParticipant(db: PostgresJsDatabase, id: string): Promise<{
486
+ id: string;
487
+ } | null>;
488
+ listOrders(db: PostgresJsDatabase, query: OrderListQuery): Promise<{
489
+ data: {
490
+ id: string;
491
+ orderNumber: string;
492
+ offerId: string | null;
493
+ title: string;
494
+ status: "draft" | "expired" | "pending" | "confirmed" | "fulfilled" | "cancelled";
495
+ personId: string | null;
496
+ organizationId: string | null;
497
+ opportunityId: string | null;
498
+ quoteId: string | null;
499
+ marketId: string | null;
500
+ sourceChannelId: string | null;
501
+ currency: string;
502
+ baseCurrency: string | null;
503
+ fxRateSetId: string | null;
504
+ subtotalAmountCents: number;
505
+ taxAmountCents: number;
506
+ feeAmountCents: number;
507
+ totalAmountCents: number;
508
+ costAmountCents: number;
509
+ orderedAt: Date | null;
510
+ confirmedAt: Date | null;
511
+ cancelledAt: Date | null;
512
+ expiresAt: Date | null;
513
+ notes: string | null;
514
+ metadata: unknown;
515
+ createdAt: Date;
516
+ updatedAt: Date;
517
+ }[];
518
+ total: number;
519
+ limit: number;
520
+ offset: number;
521
+ }>;
522
+ getOrderById(db: PostgresJsDatabase, id: string): Promise<{
523
+ id: string;
524
+ orderNumber: string;
525
+ offerId: string | null;
526
+ title: string;
527
+ status: "draft" | "expired" | "pending" | "confirmed" | "fulfilled" | "cancelled";
528
+ personId: string | null;
529
+ organizationId: string | null;
530
+ opportunityId: string | null;
531
+ quoteId: string | null;
532
+ marketId: string | null;
533
+ sourceChannelId: string | null;
534
+ currency: string;
535
+ baseCurrency: string | null;
536
+ fxRateSetId: string | null;
537
+ subtotalAmountCents: number;
538
+ taxAmountCents: number;
539
+ feeAmountCents: number;
540
+ totalAmountCents: number;
541
+ costAmountCents: number;
542
+ orderedAt: Date | null;
543
+ confirmedAt: Date | null;
544
+ cancelledAt: Date | null;
545
+ expiresAt: Date | null;
546
+ notes: string | null;
547
+ metadata: unknown;
548
+ createdAt: Date;
549
+ updatedAt: Date;
550
+ } | null>;
551
+ createOrder(db: PostgresJsDatabase, data: CreateOrderInput): Promise<{
552
+ offerId: string | null;
553
+ createdAt: Date;
554
+ updatedAt: Date;
555
+ id: string;
556
+ currency: string;
557
+ notes: string | null;
558
+ title: string;
559
+ status: "draft" | "expired" | "pending" | "confirmed" | "fulfilled" | "cancelled";
560
+ personId: string | null;
561
+ organizationId: string | null;
562
+ opportunityId: string | null;
563
+ quoteId: string | null;
564
+ marketId: string | null;
565
+ sourceChannelId: string | null;
566
+ baseCurrency: string | null;
567
+ fxRateSetId: string | null;
568
+ subtotalAmountCents: number;
569
+ taxAmountCents: number;
570
+ feeAmountCents: number;
571
+ totalAmountCents: number;
572
+ costAmountCents: number;
573
+ metadata: unknown;
574
+ orderNumber: string;
575
+ orderedAt: Date | null;
576
+ confirmedAt: Date | null;
577
+ cancelledAt: Date | null;
578
+ expiresAt: Date | null;
579
+ } | null>;
580
+ updateOrder(db: PostgresJsDatabase, id: string, data: UpdateOrderInput): Promise<{
581
+ id: string;
582
+ orderNumber: string;
583
+ offerId: string | null;
584
+ title: string;
585
+ status: "draft" | "expired" | "pending" | "confirmed" | "fulfilled" | "cancelled";
586
+ personId: string | null;
587
+ organizationId: string | null;
588
+ opportunityId: string | null;
589
+ quoteId: string | null;
590
+ marketId: string | null;
591
+ sourceChannelId: string | null;
592
+ currency: string;
593
+ baseCurrency: string | null;
594
+ fxRateSetId: string | null;
595
+ subtotalAmountCents: number;
596
+ taxAmountCents: number;
597
+ feeAmountCents: number;
598
+ totalAmountCents: number;
599
+ costAmountCents: number;
600
+ orderedAt: Date | null;
601
+ confirmedAt: Date | null;
602
+ cancelledAt: Date | null;
603
+ expiresAt: Date | null;
604
+ notes: string | null;
605
+ metadata: unknown;
606
+ createdAt: Date;
607
+ updatedAt: Date;
608
+ } | null>;
609
+ deleteOrder(db: PostgresJsDatabase, id: string): Promise<{
610
+ id: string;
611
+ } | null>;
612
+ listOrderParticipants(db: PostgresJsDatabase, query: OrderParticipantListQuery): Promise<{
613
+ data: {
614
+ id: string;
615
+ orderId: string;
616
+ personId: string | null;
617
+ participantType: "staff" | "other" | "traveler" | "booker" | "contact" | "occupant";
618
+ travelerCategory: "other" | "adult" | "child" | "infant" | "senior" | null;
619
+ firstName: string;
620
+ lastName: string;
621
+ email: string | null;
622
+ phone: string | null;
623
+ preferredLanguage: string | null;
624
+ isPrimary: boolean;
625
+ notes: string | null;
626
+ hasTravelIdentity: boolean;
627
+ createdAt: Date;
628
+ updatedAt: Date;
629
+ }[];
630
+ total: number;
631
+ limit: number;
632
+ offset: number;
633
+ }>;
634
+ getOrderParticipantById(db: PostgresJsDatabase, id: string): Promise<{
635
+ id: string;
636
+ orderId: string;
637
+ personId: string | null;
638
+ participantType: "staff" | "other" | "traveler" | "booker" | "contact" | "occupant";
639
+ travelerCategory: "other" | "adult" | "child" | "infant" | "senior" | null;
640
+ firstName: string;
641
+ lastName: string;
642
+ email: string | null;
643
+ phone: string | null;
644
+ preferredLanguage: string | null;
645
+ isPrimary: boolean;
646
+ notes: string | null;
647
+ hasTravelIdentity: boolean;
648
+ createdAt: Date;
649
+ updatedAt: Date;
650
+ } | null>;
651
+ createOrderParticipant(db: PostgresJsDatabase, data: CreateOrderParticipantInput): Promise<{
652
+ id: string;
653
+ orderId: string;
654
+ personId: string | null;
655
+ participantType: "staff" | "other" | "traveler" | "booker" | "contact" | "occupant";
656
+ travelerCategory: "other" | "adult" | "child" | "infant" | "senior" | null;
657
+ firstName: string;
658
+ lastName: string;
659
+ email: string | null;
660
+ phone: string | null;
661
+ preferredLanguage: string | null;
662
+ isPrimary: boolean;
663
+ notes: string | null;
664
+ hasTravelIdentity: boolean;
665
+ createdAt: Date;
666
+ updatedAt: Date;
667
+ } | null>;
668
+ updateOrderParticipant(db: PostgresJsDatabase, id: string, data: UpdateOrderParticipantInput): Promise<{
669
+ id: string;
670
+ orderId: string;
671
+ personId: string | null;
672
+ participantType: "staff" | "other" | "traveler" | "booker" | "contact" | "occupant";
673
+ travelerCategory: "other" | "adult" | "child" | "infant" | "senior" | null;
674
+ firstName: string;
675
+ lastName: string;
676
+ email: string | null;
677
+ phone: string | null;
678
+ preferredLanguage: string | null;
679
+ isPrimary: boolean;
680
+ notes: string | null;
681
+ hasTravelIdentity: boolean;
682
+ createdAt: Date;
683
+ updatedAt: Date;
684
+ } | null>;
685
+ deleteOrderParticipant(db: PostgresJsDatabase, id: string): Promise<{
686
+ id: string;
687
+ } | null>;
688
+ listOrderItems(db: PostgresJsDatabase, query: OrderItemListQuery): Promise<{
689
+ data: {
690
+ id: string;
691
+ orderId: string;
692
+ offerItemId: string | null;
693
+ productId: string | null;
694
+ optionId: string | null;
695
+ unitId: string | null;
696
+ slotId: string | null;
697
+ title: string;
698
+ description: string | null;
699
+ itemType: "other" | "unit" | "service" | "extra" | "fee" | "tax" | "discount" | "adjustment" | "accommodation" | "transport";
700
+ status: "draft" | "confirmed" | "fulfilled" | "cancelled" | "priced";
701
+ serviceDate: string | null;
702
+ startsAt: Date | null;
703
+ endsAt: Date | null;
704
+ quantity: number;
705
+ sellCurrency: string;
706
+ unitSellAmountCents: number | null;
707
+ totalSellAmountCents: number | null;
708
+ taxAmountCents: number | null;
709
+ feeAmountCents: number | null;
710
+ costCurrency: string | null;
711
+ unitCostAmountCents: number | null;
712
+ totalCostAmountCents: number | null;
713
+ notes: string | null;
714
+ metadata: unknown;
715
+ createdAt: Date;
716
+ updatedAt: Date;
717
+ }[];
718
+ total: number;
719
+ limit: number;
720
+ offset: number;
721
+ }>;
722
+ getOrderItemById(db: PostgresJsDatabase, id: string): Promise<{
723
+ id: string;
724
+ orderId: string;
725
+ offerItemId: string | null;
726
+ productId: string | null;
727
+ optionId: string | null;
728
+ unitId: string | null;
729
+ slotId: string | null;
730
+ title: string;
731
+ description: string | null;
732
+ itemType: "other" | "unit" | "service" | "extra" | "fee" | "tax" | "discount" | "adjustment" | "accommodation" | "transport";
733
+ status: "draft" | "confirmed" | "fulfilled" | "cancelled" | "priced";
734
+ serviceDate: string | null;
735
+ startsAt: Date | null;
736
+ endsAt: Date | null;
737
+ quantity: number;
738
+ sellCurrency: string;
739
+ unitSellAmountCents: number | null;
740
+ totalSellAmountCents: number | null;
741
+ taxAmountCents: number | null;
742
+ feeAmountCents: number | null;
743
+ costCurrency: string | null;
744
+ unitCostAmountCents: number | null;
745
+ totalCostAmountCents: number | null;
746
+ notes: string | null;
747
+ metadata: unknown;
748
+ createdAt: Date;
749
+ updatedAt: Date;
750
+ } | null>;
751
+ createOrderItem(db: PostgresJsDatabase, data: CreateOrderItemInput): Promise<{
752
+ orderId: string;
753
+ createdAt: Date;
754
+ updatedAt: Date;
755
+ description: string | null;
756
+ id: string;
757
+ notes: string | null;
758
+ title: string;
759
+ status: "draft" | "confirmed" | "fulfilled" | "cancelled" | "priced";
760
+ taxAmountCents: number | null;
761
+ feeAmountCents: number | null;
762
+ metadata: unknown;
763
+ productId: string | null;
764
+ optionId: string | null;
765
+ unitId: string | null;
766
+ slotId: string | null;
767
+ itemType: "other" | "unit" | "service" | "extra" | "fee" | "tax" | "discount" | "adjustment" | "accommodation" | "transport";
768
+ serviceDate: string | null;
769
+ startsAt: Date | null;
770
+ endsAt: Date | null;
771
+ quantity: number;
772
+ sellCurrency: string;
773
+ unitSellAmountCents: number | null;
774
+ totalSellAmountCents: number | null;
775
+ costCurrency: string | null;
776
+ unitCostAmountCents: number | null;
777
+ totalCostAmountCents: number | null;
778
+ offerItemId: string | null;
779
+ } | null>;
780
+ updateOrderItem(db: PostgresJsDatabase, id: string, data: UpdateOrderItemInput): Promise<{
781
+ id: string;
782
+ orderId: string;
783
+ offerItemId: string | null;
784
+ productId: string | null;
785
+ optionId: string | null;
786
+ unitId: string | null;
787
+ slotId: string | null;
788
+ title: string;
789
+ description: string | null;
790
+ itemType: "other" | "unit" | "service" | "extra" | "fee" | "tax" | "discount" | "adjustment" | "accommodation" | "transport";
791
+ status: "draft" | "confirmed" | "fulfilled" | "cancelled" | "priced";
792
+ serviceDate: string | null;
793
+ startsAt: Date | null;
794
+ endsAt: Date | null;
795
+ quantity: number;
796
+ sellCurrency: string;
797
+ unitSellAmountCents: number | null;
798
+ totalSellAmountCents: number | null;
799
+ taxAmountCents: number | null;
800
+ feeAmountCents: number | null;
801
+ costCurrency: string | null;
802
+ unitCostAmountCents: number | null;
803
+ totalCostAmountCents: number | null;
804
+ notes: string | null;
805
+ metadata: unknown;
806
+ createdAt: Date;
807
+ updatedAt: Date;
808
+ } | null>;
809
+ deleteOrderItem(db: PostgresJsDatabase, id: string): Promise<{
810
+ id: string;
811
+ } | null>;
812
+ listOrderItemParticipants(db: PostgresJsDatabase, query: OrderItemParticipantListQuery): Promise<{
813
+ data: {
814
+ id: string;
815
+ orderItemId: string;
816
+ participantId: string;
817
+ role: "other" | "traveler" | "occupant" | "primary_contact" | "beneficiary" | "service_assignee";
818
+ isPrimary: boolean;
819
+ createdAt: Date;
820
+ }[];
821
+ total: number;
822
+ limit: number;
823
+ offset: number;
824
+ }>;
825
+ getOrderItemParticipantById(db: PostgresJsDatabase, id: string): Promise<{
826
+ id: string;
827
+ orderItemId: string;
828
+ participantId: string;
829
+ role: "other" | "traveler" | "occupant" | "primary_contact" | "beneficiary" | "service_assignee";
830
+ isPrimary: boolean;
831
+ createdAt: Date;
832
+ } | null>;
833
+ createOrderItemParticipant(db: PostgresJsDatabase, data: CreateOrderItemParticipantInput): Promise<{
834
+ createdAt: Date;
835
+ id: string;
836
+ isPrimary: boolean;
837
+ participantId: string;
838
+ role: "other" | "traveler" | "occupant" | "primary_contact" | "beneficiary" | "service_assignee";
839
+ orderItemId: string;
840
+ } | null>;
841
+ updateOrderItemParticipant(db: PostgresJsDatabase, id: string, data: UpdateOrderItemParticipantInput): Promise<{
842
+ id: string;
843
+ orderItemId: string;
844
+ participantId: string;
845
+ role: "other" | "traveler" | "occupant" | "primary_contact" | "beneficiary" | "service_assignee";
846
+ isPrimary: boolean;
847
+ createdAt: Date;
848
+ } | null>;
849
+ deleteOrderItemParticipant(db: PostgresJsDatabase, id: string): Promise<{
850
+ id: string;
851
+ } | null>;
852
+ listOrderTerms(db: PostgresJsDatabase, query: OrderTermListQuery): Promise<{
853
+ data: {
854
+ id: string;
855
+ offerId: string | null;
856
+ orderId: string | null;
857
+ termType: "other" | "terms_and_conditions" | "cancellation" | "guarantee" | "payment" | "pricing" | "commission";
858
+ title: string;
859
+ body: string;
860
+ language: string | null;
861
+ required: boolean;
862
+ sortOrder: number;
863
+ acceptanceStatus: "accepted" | "pending" | "not_required" | "declined";
864
+ acceptedAt: Date | null;
865
+ acceptedBy: string | null;
866
+ metadata: unknown;
867
+ createdAt: Date;
868
+ updatedAt: Date;
869
+ }[];
870
+ total: number;
871
+ limit: number;
872
+ offset: number;
873
+ }>;
874
+ getOrderTermById(db: PostgresJsDatabase, id: string): Promise<{
875
+ id: string;
876
+ offerId: string | null;
877
+ orderId: string | null;
878
+ termType: "other" | "terms_and_conditions" | "cancellation" | "guarantee" | "payment" | "pricing" | "commission";
879
+ title: string;
880
+ body: string;
881
+ language: string | null;
882
+ required: boolean;
883
+ sortOrder: number;
884
+ acceptanceStatus: "accepted" | "pending" | "not_required" | "declined";
885
+ acceptedAt: Date | null;
886
+ acceptedBy: string | null;
887
+ metadata: unknown;
888
+ createdAt: Date;
889
+ updatedAt: Date;
890
+ } | null>;
891
+ createOrderTerm(db: PostgresJsDatabase, data: CreateOrderTermInput): Promise<{
892
+ offerId: string | null;
893
+ orderId: string | null;
894
+ createdAt: Date;
895
+ updatedAt: Date;
896
+ body: string;
897
+ id: string;
898
+ title: string;
899
+ acceptedAt: Date | null;
900
+ metadata: unknown;
901
+ termType: "other" | "terms_and_conditions" | "cancellation" | "guarantee" | "payment" | "pricing" | "commission";
902
+ language: string | null;
903
+ required: boolean;
904
+ sortOrder: number;
905
+ acceptanceStatus: "accepted" | "pending" | "not_required" | "declined";
906
+ acceptedBy: string | null;
907
+ } | null>;
908
+ updateOrderTerm(db: PostgresJsDatabase, id: string, data: UpdateOrderTermInput): Promise<{
909
+ id: string;
910
+ offerId: string | null;
911
+ orderId: string | null;
912
+ termType: "other" | "terms_and_conditions" | "cancellation" | "guarantee" | "payment" | "pricing" | "commission";
913
+ title: string;
914
+ body: string;
915
+ language: string | null;
916
+ required: boolean;
917
+ sortOrder: number;
918
+ acceptanceStatus: "accepted" | "pending" | "not_required" | "declined";
919
+ acceptedAt: Date | null;
920
+ acceptedBy: string | null;
921
+ metadata: unknown;
922
+ createdAt: Date;
923
+ updatedAt: Date;
924
+ } | null>;
925
+ deleteOrderTerm(db: PostgresJsDatabase, id: string): Promise<{
926
+ id: string;
927
+ } | null>;
928
+ };
929
+ export {};
930
+ //# sourceMappingURL=service.d.ts.map