@voyantjs/pricing 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,958 @@
1
+ import type { PostgresJsDatabase } from "drizzle-orm/postgres-js";
2
+ import type { z } from "zod";
3
+ import type { cancellationPolicyListQuerySchema, cancellationPolicyRuleListQuerySchema, dropoffPriceRuleListQuerySchema, extraPriceRuleListQuerySchema, insertCancellationPolicyRuleSchema, insertCancellationPolicySchema, insertDropoffPriceRuleSchema, insertExtraPriceRuleSchema, insertOptionPriceRuleSchema, insertOptionStartTimeRuleSchema, insertOptionUnitPriceRuleSchema, insertOptionUnitTierSchema, insertPickupPriceRuleSchema, insertPriceCatalogSchema, insertPriceScheduleSchema, insertPricingCategoryDependencySchema, insertPricingCategorySchema, optionPriceRuleListQuerySchema, optionStartTimeRuleListQuerySchema, optionUnitPriceRuleListQuerySchema, optionUnitTierListQuerySchema, pickupPriceRuleListQuerySchema, priceCatalogListQuerySchema, priceScheduleListQuerySchema, pricingCategoryDependencyListQuerySchema, pricingCategoryListQuerySchema, updateCancellationPolicyRuleSchema, updateCancellationPolicySchema, updateDropoffPriceRuleSchema, updateExtraPriceRuleSchema, updateOptionPriceRuleSchema, updateOptionStartTimeRuleSchema, updateOptionUnitPriceRuleSchema, updateOptionUnitTierSchema, updatePickupPriceRuleSchema, updatePriceCatalogSchema, updatePriceScheduleSchema, updatePricingCategoryDependencySchema, updatePricingCategorySchema } from "./validation.js";
4
+ type PricingCategoryListQuery = z.infer<typeof pricingCategoryListQuerySchema>;
5
+ type PricingCategoryDependencyListQuery = z.infer<typeof pricingCategoryDependencyListQuerySchema>;
6
+ type CancellationPolicyListQuery = z.infer<typeof cancellationPolicyListQuerySchema>;
7
+ type CancellationPolicyRuleListQuery = z.infer<typeof cancellationPolicyRuleListQuerySchema>;
8
+ type PriceCatalogListQuery = z.infer<typeof priceCatalogListQuerySchema>;
9
+ type PriceScheduleListQuery = z.infer<typeof priceScheduleListQuerySchema>;
10
+ type OptionPriceRuleListQuery = z.infer<typeof optionPriceRuleListQuerySchema>;
11
+ type OptionUnitPriceRuleListQuery = z.infer<typeof optionUnitPriceRuleListQuerySchema>;
12
+ type OptionStartTimeRuleListQuery = z.infer<typeof optionStartTimeRuleListQuerySchema>;
13
+ type OptionUnitTierListQuery = z.infer<typeof optionUnitTierListQuerySchema>;
14
+ type PickupPriceRuleListQuery = z.infer<typeof pickupPriceRuleListQuerySchema>;
15
+ type DropoffPriceRuleListQuery = z.infer<typeof dropoffPriceRuleListQuerySchema>;
16
+ type ExtraPriceRuleListQuery = z.infer<typeof extraPriceRuleListQuerySchema>;
17
+ type CreatePricingCategoryInput = z.infer<typeof insertPricingCategorySchema>;
18
+ type UpdatePricingCategoryInput = z.infer<typeof updatePricingCategorySchema>;
19
+ type CreatePricingCategoryDependencyInput = z.infer<typeof insertPricingCategoryDependencySchema>;
20
+ type UpdatePricingCategoryDependencyInput = z.infer<typeof updatePricingCategoryDependencySchema>;
21
+ type CreateCancellationPolicyInput = z.infer<typeof insertCancellationPolicySchema>;
22
+ type UpdateCancellationPolicyInput = z.infer<typeof updateCancellationPolicySchema>;
23
+ type CreateCancellationPolicyRuleInput = z.infer<typeof insertCancellationPolicyRuleSchema>;
24
+ type UpdateCancellationPolicyRuleInput = z.infer<typeof updateCancellationPolicyRuleSchema>;
25
+ type CreatePriceCatalogInput = z.infer<typeof insertPriceCatalogSchema>;
26
+ type UpdatePriceCatalogInput = z.infer<typeof updatePriceCatalogSchema>;
27
+ type CreatePriceScheduleInput = z.infer<typeof insertPriceScheduleSchema>;
28
+ type UpdatePriceScheduleInput = z.infer<typeof updatePriceScheduleSchema>;
29
+ type CreateOptionPriceRuleInput = z.infer<typeof insertOptionPriceRuleSchema>;
30
+ type UpdateOptionPriceRuleInput = z.infer<typeof updateOptionPriceRuleSchema>;
31
+ type CreateOptionUnitPriceRuleInput = z.infer<typeof insertOptionUnitPriceRuleSchema>;
32
+ type UpdateOptionUnitPriceRuleInput = z.infer<typeof updateOptionUnitPriceRuleSchema>;
33
+ type CreateOptionStartTimeRuleInput = z.infer<typeof insertOptionStartTimeRuleSchema>;
34
+ type UpdateOptionStartTimeRuleInput = z.infer<typeof updateOptionStartTimeRuleSchema>;
35
+ type CreateOptionUnitTierInput = z.infer<typeof insertOptionUnitTierSchema>;
36
+ type UpdateOptionUnitTierInput = z.infer<typeof updateOptionUnitTierSchema>;
37
+ type CreatePickupPriceRuleInput = z.infer<typeof insertPickupPriceRuleSchema>;
38
+ type UpdatePickupPriceRuleInput = z.infer<typeof updatePickupPriceRuleSchema>;
39
+ type CreateDropoffPriceRuleInput = z.infer<typeof insertDropoffPriceRuleSchema>;
40
+ type UpdateDropoffPriceRuleInput = z.infer<typeof updateDropoffPriceRuleSchema>;
41
+ type CreateExtraPriceRuleInput = z.infer<typeof insertExtraPriceRuleSchema>;
42
+ type UpdateExtraPriceRuleInput = z.infer<typeof updateExtraPriceRuleSchema>;
43
+ export declare const pricingService: {
44
+ listPricingCategories(db: PostgresJsDatabase, query: PricingCategoryListQuery): Promise<{
45
+ data: {
46
+ id: string;
47
+ productId: string | null;
48
+ optionId: string | null;
49
+ unitId: string | null;
50
+ code: string | null;
51
+ name: string;
52
+ categoryType: "adult" | "child" | "infant" | "senior" | "group" | "room" | "vehicle" | "service" | "other";
53
+ seatOccupancy: number;
54
+ groupSize: number | null;
55
+ isAgeQualified: boolean;
56
+ minAge: number | null;
57
+ maxAge: number | null;
58
+ internalUseOnly: boolean;
59
+ active: boolean;
60
+ sortOrder: number;
61
+ metadata: Record<string, unknown> | null;
62
+ createdAt: Date;
63
+ updatedAt: Date;
64
+ }[];
65
+ total: number;
66
+ limit: number;
67
+ offset: number;
68
+ }>;
69
+ getPricingCategoryById(db: PostgresJsDatabase, id: string): Promise<{
70
+ id: string;
71
+ productId: string | null;
72
+ optionId: string | null;
73
+ unitId: string | null;
74
+ code: string | null;
75
+ name: string;
76
+ categoryType: "adult" | "child" | "infant" | "senior" | "group" | "room" | "vehicle" | "service" | "other";
77
+ seatOccupancy: number;
78
+ groupSize: number | null;
79
+ isAgeQualified: boolean;
80
+ minAge: number | null;
81
+ maxAge: number | null;
82
+ internalUseOnly: boolean;
83
+ active: boolean;
84
+ sortOrder: number;
85
+ metadata: Record<string, unknown> | null;
86
+ createdAt: Date;
87
+ updatedAt: Date;
88
+ } | null>;
89
+ createPricingCategory(db: PostgresJsDatabase, data: CreatePricingCategoryInput): Promise<{
90
+ id: string;
91
+ name: string;
92
+ productId: string | null;
93
+ optionId: string | null;
94
+ unitId: string | null;
95
+ code: string | null;
96
+ categoryType: "adult" | "child" | "infant" | "senior" | "group" | "room" | "vehicle" | "service" | "other";
97
+ seatOccupancy: number;
98
+ groupSize: number | null;
99
+ isAgeQualified: boolean;
100
+ minAge: number | null;
101
+ maxAge: number | null;
102
+ internalUseOnly: boolean;
103
+ active: boolean;
104
+ sortOrder: number;
105
+ metadata: Record<string, unknown> | null;
106
+ createdAt: Date;
107
+ updatedAt: Date;
108
+ } | null>;
109
+ updatePricingCategory(db: PostgresJsDatabase, id: string, data: UpdatePricingCategoryInput): Promise<{
110
+ id: string;
111
+ productId: string | null;
112
+ optionId: string | null;
113
+ unitId: string | null;
114
+ code: string | null;
115
+ name: string;
116
+ categoryType: "adult" | "child" | "infant" | "senior" | "group" | "room" | "vehicle" | "service" | "other";
117
+ seatOccupancy: number;
118
+ groupSize: number | null;
119
+ isAgeQualified: boolean;
120
+ minAge: number | null;
121
+ maxAge: number | null;
122
+ internalUseOnly: boolean;
123
+ active: boolean;
124
+ sortOrder: number;
125
+ metadata: Record<string, unknown> | null;
126
+ createdAt: Date;
127
+ updatedAt: Date;
128
+ } | null>;
129
+ deletePricingCategory(db: PostgresJsDatabase, id: string): Promise<{
130
+ id: string;
131
+ } | null>;
132
+ listPricingCategoryDependencies(db: PostgresJsDatabase, query: PricingCategoryDependencyListQuery): Promise<{
133
+ data: {
134
+ id: string;
135
+ pricingCategoryId: string;
136
+ masterPricingCategoryId: string;
137
+ dependencyType: "requires" | "limits_per_master" | "limits_sum" | "excludes";
138
+ maxPerMaster: number | null;
139
+ maxDependentSum: number | null;
140
+ active: boolean;
141
+ notes: string | null;
142
+ createdAt: Date;
143
+ updatedAt: Date;
144
+ }[];
145
+ total: number;
146
+ limit: number;
147
+ offset: number;
148
+ }>;
149
+ getPricingCategoryDependencyById(db: PostgresJsDatabase, id: string): Promise<{
150
+ id: string;
151
+ pricingCategoryId: string;
152
+ masterPricingCategoryId: string;
153
+ dependencyType: "requires" | "limits_per_master" | "limits_sum" | "excludes";
154
+ maxPerMaster: number | null;
155
+ maxDependentSum: number | null;
156
+ active: boolean;
157
+ notes: string | null;
158
+ createdAt: Date;
159
+ updatedAt: Date;
160
+ } | null>;
161
+ createPricingCategoryDependency(db: PostgresJsDatabase, data: CreatePricingCategoryDependencyInput): Promise<{
162
+ id: string;
163
+ active: boolean;
164
+ createdAt: Date;
165
+ updatedAt: Date;
166
+ pricingCategoryId: string;
167
+ masterPricingCategoryId: string;
168
+ dependencyType: "requires" | "limits_per_master" | "limits_sum" | "excludes";
169
+ maxPerMaster: number | null;
170
+ maxDependentSum: number | null;
171
+ notes: string | null;
172
+ } | null>;
173
+ updatePricingCategoryDependency(db: PostgresJsDatabase, id: string, data: UpdatePricingCategoryDependencyInput): Promise<{
174
+ id: string;
175
+ pricingCategoryId: string;
176
+ masterPricingCategoryId: string;
177
+ dependencyType: "requires" | "limits_per_master" | "limits_sum" | "excludes";
178
+ maxPerMaster: number | null;
179
+ maxDependentSum: number | null;
180
+ active: boolean;
181
+ notes: string | null;
182
+ createdAt: Date;
183
+ updatedAt: Date;
184
+ } | null>;
185
+ deletePricingCategoryDependency(db: PostgresJsDatabase, id: string): Promise<{
186
+ id: string;
187
+ } | null>;
188
+ listCancellationPolicies(db: PostgresJsDatabase, query: CancellationPolicyListQuery): Promise<{
189
+ data: {
190
+ id: string;
191
+ code: string | null;
192
+ name: string;
193
+ policyType: "simple" | "advanced" | "non_refundable" | "custom";
194
+ simpleCutoffHours: number | null;
195
+ isDefault: boolean;
196
+ active: boolean;
197
+ notes: string | null;
198
+ metadata: Record<string, unknown> | null;
199
+ createdAt: Date;
200
+ updatedAt: Date;
201
+ }[];
202
+ total: number;
203
+ limit: number;
204
+ offset: number;
205
+ }>;
206
+ getCancellationPolicyById(db: PostgresJsDatabase, id: string): Promise<{
207
+ id: string;
208
+ code: string | null;
209
+ name: string;
210
+ policyType: "simple" | "advanced" | "non_refundable" | "custom";
211
+ simpleCutoffHours: number | null;
212
+ isDefault: boolean;
213
+ active: boolean;
214
+ notes: string | null;
215
+ metadata: Record<string, unknown> | null;
216
+ createdAt: Date;
217
+ updatedAt: Date;
218
+ } | null>;
219
+ createCancellationPolicy(db: PostgresJsDatabase, data: CreateCancellationPolicyInput): Promise<{
220
+ id: string;
221
+ name: string;
222
+ code: string | null;
223
+ active: boolean;
224
+ metadata: Record<string, unknown> | null;
225
+ createdAt: Date;
226
+ updatedAt: Date;
227
+ notes: string | null;
228
+ policyType: "simple" | "advanced" | "non_refundable" | "custom";
229
+ simpleCutoffHours: number | null;
230
+ isDefault: boolean;
231
+ } | null>;
232
+ updateCancellationPolicy(db: PostgresJsDatabase, id: string, data: UpdateCancellationPolicyInput): Promise<{
233
+ id: string;
234
+ code: string | null;
235
+ name: string;
236
+ policyType: "simple" | "advanced" | "non_refundable" | "custom";
237
+ simpleCutoffHours: number | null;
238
+ isDefault: boolean;
239
+ active: boolean;
240
+ notes: string | null;
241
+ metadata: Record<string, unknown> | null;
242
+ createdAt: Date;
243
+ updatedAt: Date;
244
+ } | null>;
245
+ deleteCancellationPolicy(db: PostgresJsDatabase, id: string): Promise<{
246
+ id: string;
247
+ } | null>;
248
+ listCancellationPolicyRules(db: PostgresJsDatabase, query: CancellationPolicyRuleListQuery): Promise<{
249
+ data: {
250
+ id: string;
251
+ cancellationPolicyId: string;
252
+ sortOrder: number;
253
+ cutoffMinutesBefore: number | null;
254
+ chargeType: "none" | "amount" | "percentage";
255
+ chargeAmountCents: number | null;
256
+ chargePercentBasisPoints: number | null;
257
+ active: boolean;
258
+ notes: string | null;
259
+ createdAt: Date;
260
+ updatedAt: Date;
261
+ }[];
262
+ total: number;
263
+ limit: number;
264
+ offset: number;
265
+ }>;
266
+ getCancellationPolicyRuleById(db: PostgresJsDatabase, id: string): Promise<{
267
+ id: string;
268
+ cancellationPolicyId: string;
269
+ sortOrder: number;
270
+ cutoffMinutesBefore: number | null;
271
+ chargeType: "none" | "amount" | "percentage";
272
+ chargeAmountCents: number | null;
273
+ chargePercentBasisPoints: number | null;
274
+ active: boolean;
275
+ notes: string | null;
276
+ createdAt: Date;
277
+ updatedAt: Date;
278
+ } | null>;
279
+ createCancellationPolicyRule(db: PostgresJsDatabase, data: CreateCancellationPolicyRuleInput): Promise<{
280
+ id: string;
281
+ active: boolean;
282
+ sortOrder: number;
283
+ createdAt: Date;
284
+ updatedAt: Date;
285
+ notes: string | null;
286
+ cancellationPolicyId: string;
287
+ cutoffMinutesBefore: number | null;
288
+ chargeType: "none" | "amount" | "percentage";
289
+ chargeAmountCents: number | null;
290
+ chargePercentBasisPoints: number | null;
291
+ } | null>;
292
+ updateCancellationPolicyRule(db: PostgresJsDatabase, id: string, data: UpdateCancellationPolicyRuleInput): Promise<{
293
+ id: string;
294
+ cancellationPolicyId: string;
295
+ sortOrder: number;
296
+ cutoffMinutesBefore: number | null;
297
+ chargeType: "none" | "amount" | "percentage";
298
+ chargeAmountCents: number | null;
299
+ chargePercentBasisPoints: number | null;
300
+ active: boolean;
301
+ notes: string | null;
302
+ createdAt: Date;
303
+ updatedAt: Date;
304
+ } | null>;
305
+ deleteCancellationPolicyRule(db: PostgresJsDatabase, id: string): Promise<{
306
+ id: string;
307
+ } | null>;
308
+ listPriceCatalogs(db: PostgresJsDatabase, query: PriceCatalogListQuery): Promise<{
309
+ data: {
310
+ id: string;
311
+ code: string;
312
+ name: string;
313
+ currencyCode: string | null;
314
+ catalogType: "internal" | "other" | "public" | "contract" | "net" | "gross" | "promo";
315
+ isDefault: boolean;
316
+ active: boolean;
317
+ notes: string | null;
318
+ metadata: Record<string, unknown> | null;
319
+ createdAt: Date;
320
+ updatedAt: Date;
321
+ }[];
322
+ total: number;
323
+ limit: number;
324
+ offset: number;
325
+ }>;
326
+ getPriceCatalogById(db: PostgresJsDatabase, id: string): Promise<{
327
+ id: string;
328
+ code: string;
329
+ name: string;
330
+ currencyCode: string | null;
331
+ catalogType: "internal" | "other" | "public" | "contract" | "net" | "gross" | "promo";
332
+ isDefault: boolean;
333
+ active: boolean;
334
+ notes: string | null;
335
+ metadata: Record<string, unknown> | null;
336
+ createdAt: Date;
337
+ updatedAt: Date;
338
+ } | null>;
339
+ createPriceCatalog(db: PostgresJsDatabase, data: CreatePriceCatalogInput): Promise<{
340
+ id: string;
341
+ name: string;
342
+ code: string;
343
+ active: boolean;
344
+ metadata: Record<string, unknown> | null;
345
+ createdAt: Date;
346
+ updatedAt: Date;
347
+ notes: string | null;
348
+ isDefault: boolean;
349
+ currencyCode: string | null;
350
+ catalogType: "internal" | "other" | "public" | "contract" | "net" | "gross" | "promo";
351
+ } | null>;
352
+ updatePriceCatalog(db: PostgresJsDatabase, id: string, data: UpdatePriceCatalogInput): Promise<{
353
+ id: string;
354
+ code: string;
355
+ name: string;
356
+ currencyCode: string | null;
357
+ catalogType: "internal" | "other" | "public" | "contract" | "net" | "gross" | "promo";
358
+ isDefault: boolean;
359
+ active: boolean;
360
+ notes: string | null;
361
+ metadata: Record<string, unknown> | null;
362
+ createdAt: Date;
363
+ updatedAt: Date;
364
+ } | null>;
365
+ deletePriceCatalog(db: PostgresJsDatabase, id: string): Promise<{
366
+ id: string;
367
+ } | null>;
368
+ listPriceSchedules(db: PostgresJsDatabase, query: PriceScheduleListQuery): Promise<{
369
+ data: {
370
+ id: string;
371
+ priceCatalogId: string;
372
+ code: string | null;
373
+ name: string;
374
+ recurrenceRule: string;
375
+ timezone: string | null;
376
+ validFrom: string | null;
377
+ validTo: string | null;
378
+ weekdays: string[] | null;
379
+ priority: number;
380
+ active: boolean;
381
+ notes: string | null;
382
+ metadata: Record<string, unknown> | null;
383
+ createdAt: Date;
384
+ updatedAt: Date;
385
+ }[];
386
+ total: number;
387
+ limit: number;
388
+ offset: number;
389
+ }>;
390
+ getPriceScheduleById(db: PostgresJsDatabase, id: string): Promise<{
391
+ id: string;
392
+ priceCatalogId: string;
393
+ code: string | null;
394
+ name: string;
395
+ recurrenceRule: string;
396
+ timezone: string | null;
397
+ validFrom: string | null;
398
+ validTo: string | null;
399
+ weekdays: string[] | null;
400
+ priority: number;
401
+ active: boolean;
402
+ notes: string | null;
403
+ metadata: Record<string, unknown> | null;
404
+ createdAt: Date;
405
+ updatedAt: Date;
406
+ } | null>;
407
+ createPriceSchedule(db: PostgresJsDatabase, data: CreatePriceScheduleInput): Promise<{
408
+ id: string;
409
+ name: string;
410
+ code: string | null;
411
+ active: boolean;
412
+ metadata: Record<string, unknown> | null;
413
+ createdAt: Date;
414
+ updatedAt: Date;
415
+ notes: string | null;
416
+ priceCatalogId: string;
417
+ recurrenceRule: string;
418
+ timezone: string | null;
419
+ validFrom: string | null;
420
+ validTo: string | null;
421
+ weekdays: string[] | null;
422
+ priority: number;
423
+ } | null>;
424
+ updatePriceSchedule(db: PostgresJsDatabase, id: string, data: UpdatePriceScheduleInput): Promise<{
425
+ id: string;
426
+ priceCatalogId: string;
427
+ code: string | null;
428
+ name: string;
429
+ recurrenceRule: string;
430
+ timezone: string | null;
431
+ validFrom: string | null;
432
+ validTo: string | null;
433
+ weekdays: string[] | null;
434
+ priority: number;
435
+ active: boolean;
436
+ notes: string | null;
437
+ metadata: Record<string, unknown> | null;
438
+ createdAt: Date;
439
+ updatedAt: Date;
440
+ } | null>;
441
+ deletePriceSchedule(db: PostgresJsDatabase, id: string): Promise<{
442
+ id: string;
443
+ } | null>;
444
+ listOptionPriceRules(db: PostgresJsDatabase, query: OptionPriceRuleListQuery): Promise<{
445
+ data: {
446
+ id: string;
447
+ productId: string;
448
+ optionId: string;
449
+ priceCatalogId: string;
450
+ priceScheduleId: string | null;
451
+ cancellationPolicyId: string | null;
452
+ code: string | null;
453
+ name: string;
454
+ description: string | null;
455
+ pricingMode: "per_person" | "per_booking" | "starting_from" | "free" | "on_request";
456
+ baseSellAmountCents: number | null;
457
+ baseCostAmountCents: number | null;
458
+ minPerBooking: number | null;
459
+ maxPerBooking: number | null;
460
+ allPricingCategories: boolean;
461
+ isDefault: boolean;
462
+ active: boolean;
463
+ notes: string | null;
464
+ metadata: Record<string, unknown> | null;
465
+ createdAt: Date;
466
+ updatedAt: Date;
467
+ }[];
468
+ total: number;
469
+ limit: number;
470
+ offset: number;
471
+ }>;
472
+ getOptionPriceRuleById(db: PostgresJsDatabase, id: string): Promise<{
473
+ id: string;
474
+ productId: string;
475
+ optionId: string;
476
+ priceCatalogId: string;
477
+ priceScheduleId: string | null;
478
+ cancellationPolicyId: string | null;
479
+ code: string | null;
480
+ name: string;
481
+ description: string | null;
482
+ pricingMode: "per_person" | "per_booking" | "starting_from" | "free" | "on_request";
483
+ baseSellAmountCents: number | null;
484
+ baseCostAmountCents: number | null;
485
+ minPerBooking: number | null;
486
+ maxPerBooking: number | null;
487
+ allPricingCategories: boolean;
488
+ isDefault: boolean;
489
+ active: boolean;
490
+ notes: string | null;
491
+ metadata: Record<string, unknown> | null;
492
+ createdAt: Date;
493
+ updatedAt: Date;
494
+ } | null>;
495
+ createOptionPriceRule(db: PostgresJsDatabase, data: CreateOptionPriceRuleInput): Promise<{
496
+ id: string;
497
+ name: string;
498
+ productId: string;
499
+ optionId: string;
500
+ code: string | null;
501
+ active: boolean;
502
+ metadata: Record<string, unknown> | null;
503
+ createdAt: Date;
504
+ updatedAt: Date;
505
+ notes: string | null;
506
+ isDefault: boolean;
507
+ cancellationPolicyId: string | null;
508
+ priceCatalogId: string;
509
+ priceScheduleId: string | null;
510
+ description: string | null;
511
+ pricingMode: "per_person" | "per_booking" | "starting_from" | "free" | "on_request";
512
+ baseSellAmountCents: number | null;
513
+ baseCostAmountCents: number | null;
514
+ minPerBooking: number | null;
515
+ maxPerBooking: number | null;
516
+ allPricingCategories: boolean;
517
+ } | null>;
518
+ updateOptionPriceRule(db: PostgresJsDatabase, id: string, data: UpdateOptionPriceRuleInput): Promise<{
519
+ id: string;
520
+ productId: string;
521
+ optionId: string;
522
+ priceCatalogId: string;
523
+ priceScheduleId: string | null;
524
+ cancellationPolicyId: string | null;
525
+ code: string | null;
526
+ name: string;
527
+ description: string | null;
528
+ pricingMode: "per_person" | "per_booking" | "starting_from" | "free" | "on_request";
529
+ baseSellAmountCents: number | null;
530
+ baseCostAmountCents: number | null;
531
+ minPerBooking: number | null;
532
+ maxPerBooking: number | null;
533
+ allPricingCategories: boolean;
534
+ isDefault: boolean;
535
+ active: boolean;
536
+ notes: string | null;
537
+ metadata: Record<string, unknown> | null;
538
+ createdAt: Date;
539
+ updatedAt: Date;
540
+ } | null>;
541
+ deleteOptionPriceRule(db: PostgresJsDatabase, id: string): Promise<{
542
+ id: string;
543
+ } | null>;
544
+ listOptionUnitPriceRules(db: PostgresJsDatabase, query: OptionUnitPriceRuleListQuery): Promise<{
545
+ data: {
546
+ id: string;
547
+ optionPriceRuleId: string;
548
+ optionId: string;
549
+ unitId: string;
550
+ pricingCategoryId: string | null;
551
+ pricingMode: "per_person" | "per_booking" | "free" | "on_request" | "per_unit" | "included";
552
+ sellAmountCents: number | null;
553
+ costAmountCents: number | null;
554
+ minQuantity: number | null;
555
+ maxQuantity: number | null;
556
+ active: boolean;
557
+ sortOrder: number;
558
+ notes: string | null;
559
+ metadata: Record<string, unknown> | null;
560
+ createdAt: Date;
561
+ updatedAt: Date;
562
+ }[];
563
+ total: number;
564
+ limit: number;
565
+ offset: number;
566
+ }>;
567
+ getOptionUnitPriceRuleById(db: PostgresJsDatabase, id: string): Promise<{
568
+ id: string;
569
+ optionPriceRuleId: string;
570
+ optionId: string;
571
+ unitId: string;
572
+ pricingCategoryId: string | null;
573
+ pricingMode: "per_person" | "per_booking" | "free" | "on_request" | "per_unit" | "included";
574
+ sellAmountCents: number | null;
575
+ costAmountCents: number | null;
576
+ minQuantity: number | null;
577
+ maxQuantity: number | null;
578
+ active: boolean;
579
+ sortOrder: number;
580
+ notes: string | null;
581
+ metadata: Record<string, unknown> | null;
582
+ createdAt: Date;
583
+ updatedAt: Date;
584
+ } | null>;
585
+ createOptionUnitPriceRule(db: PostgresJsDatabase, data: CreateOptionUnitPriceRuleInput): Promise<{
586
+ id: string;
587
+ optionId: string;
588
+ unitId: string;
589
+ active: boolean;
590
+ sortOrder: number;
591
+ metadata: Record<string, unknown> | null;
592
+ createdAt: Date;
593
+ updatedAt: Date;
594
+ pricingCategoryId: string | null;
595
+ notes: string | null;
596
+ pricingMode: "per_person" | "per_booking" | "free" | "on_request" | "per_unit" | "included";
597
+ optionPriceRuleId: string;
598
+ sellAmountCents: number | null;
599
+ costAmountCents: number | null;
600
+ minQuantity: number | null;
601
+ maxQuantity: number | null;
602
+ } | null>;
603
+ updateOptionUnitPriceRule(db: PostgresJsDatabase, id: string, data: UpdateOptionUnitPriceRuleInput): Promise<{
604
+ id: string;
605
+ optionPriceRuleId: string;
606
+ optionId: string;
607
+ unitId: string;
608
+ pricingCategoryId: string | null;
609
+ pricingMode: "per_person" | "per_booking" | "free" | "on_request" | "per_unit" | "included";
610
+ sellAmountCents: number | null;
611
+ costAmountCents: number | null;
612
+ minQuantity: number | null;
613
+ maxQuantity: number | null;
614
+ active: boolean;
615
+ sortOrder: number;
616
+ notes: string | null;
617
+ metadata: Record<string, unknown> | null;
618
+ createdAt: Date;
619
+ updatedAt: Date;
620
+ } | null>;
621
+ deleteOptionUnitPriceRule(db: PostgresJsDatabase, id: string): Promise<{
622
+ id: string;
623
+ } | null>;
624
+ listOptionStartTimeRules(db: PostgresJsDatabase, query: OptionStartTimeRuleListQuery): Promise<{
625
+ data: {
626
+ id: string;
627
+ optionPriceRuleId: string;
628
+ optionId: string;
629
+ startTimeId: string;
630
+ ruleMode: "included" | "excluded" | "override" | "adjustment";
631
+ adjustmentType: "fixed" | "percentage" | null;
632
+ sellAdjustmentCents: number | null;
633
+ costAdjustmentCents: number | null;
634
+ adjustmentBasisPoints: number | null;
635
+ active: boolean;
636
+ notes: string | null;
637
+ createdAt: Date;
638
+ updatedAt: Date;
639
+ }[];
640
+ total: number;
641
+ limit: number;
642
+ offset: number;
643
+ }>;
644
+ getOptionStartTimeRuleById(db: PostgresJsDatabase, id: string): Promise<{
645
+ id: string;
646
+ optionPriceRuleId: string;
647
+ optionId: string;
648
+ startTimeId: string;
649
+ ruleMode: "included" | "excluded" | "override" | "adjustment";
650
+ adjustmentType: "fixed" | "percentage" | null;
651
+ sellAdjustmentCents: number | null;
652
+ costAdjustmentCents: number | null;
653
+ adjustmentBasisPoints: number | null;
654
+ active: boolean;
655
+ notes: string | null;
656
+ createdAt: Date;
657
+ updatedAt: Date;
658
+ } | null>;
659
+ createOptionStartTimeRule(db: PostgresJsDatabase, data: CreateOptionStartTimeRuleInput): Promise<{
660
+ id: string;
661
+ optionId: string;
662
+ active: boolean;
663
+ createdAt: Date;
664
+ updatedAt: Date;
665
+ notes: string | null;
666
+ optionPriceRuleId: string;
667
+ startTimeId: string;
668
+ ruleMode: "included" | "excluded" | "override" | "adjustment";
669
+ adjustmentType: "fixed" | "percentage" | null;
670
+ sellAdjustmentCents: number | null;
671
+ costAdjustmentCents: number | null;
672
+ adjustmentBasisPoints: number | null;
673
+ } | null>;
674
+ updateOptionStartTimeRule(db: PostgresJsDatabase, id: string, data: UpdateOptionStartTimeRuleInput): Promise<{
675
+ id: string;
676
+ optionPriceRuleId: string;
677
+ optionId: string;
678
+ startTimeId: string;
679
+ ruleMode: "included" | "excluded" | "override" | "adjustment";
680
+ adjustmentType: "fixed" | "percentage" | null;
681
+ sellAdjustmentCents: number | null;
682
+ costAdjustmentCents: number | null;
683
+ adjustmentBasisPoints: number | null;
684
+ active: boolean;
685
+ notes: string | null;
686
+ createdAt: Date;
687
+ updatedAt: Date;
688
+ } | null>;
689
+ deleteOptionStartTimeRule(db: PostgresJsDatabase, id: string): Promise<{
690
+ id: string;
691
+ } | null>;
692
+ listOptionUnitTiers(db: PostgresJsDatabase, query: OptionUnitTierListQuery): Promise<{
693
+ data: {
694
+ id: string;
695
+ optionUnitPriceRuleId: string;
696
+ minQuantity: number;
697
+ maxQuantity: number | null;
698
+ sellAmountCents: number | null;
699
+ costAmountCents: number | null;
700
+ active: boolean;
701
+ sortOrder: number;
702
+ createdAt: Date;
703
+ updatedAt: Date;
704
+ }[];
705
+ total: number;
706
+ limit: number;
707
+ offset: number;
708
+ }>;
709
+ getOptionUnitTierById(db: PostgresJsDatabase, id: string): Promise<{
710
+ id: string;
711
+ optionUnitPriceRuleId: string;
712
+ minQuantity: number;
713
+ maxQuantity: number | null;
714
+ sellAmountCents: number | null;
715
+ costAmountCents: number | null;
716
+ active: boolean;
717
+ sortOrder: number;
718
+ createdAt: Date;
719
+ updatedAt: Date;
720
+ } | null>;
721
+ createOptionUnitTier(db: PostgresJsDatabase, data: CreateOptionUnitTierInput): Promise<{
722
+ id: string;
723
+ active: boolean;
724
+ sortOrder: number;
725
+ createdAt: Date;
726
+ updatedAt: Date;
727
+ sellAmountCents: number | null;
728
+ costAmountCents: number | null;
729
+ minQuantity: number;
730
+ maxQuantity: number | null;
731
+ optionUnitPriceRuleId: string;
732
+ } | null>;
733
+ updateOptionUnitTier(db: PostgresJsDatabase, id: string, data: UpdateOptionUnitTierInput): Promise<{
734
+ id: string;
735
+ optionUnitPriceRuleId: string;
736
+ minQuantity: number;
737
+ maxQuantity: number | null;
738
+ sellAmountCents: number | null;
739
+ costAmountCents: number | null;
740
+ active: boolean;
741
+ sortOrder: number;
742
+ createdAt: Date;
743
+ updatedAt: Date;
744
+ } | null>;
745
+ deleteOptionUnitTier(db: PostgresJsDatabase, id: string): Promise<{
746
+ id: string;
747
+ } | null>;
748
+ listPickupPriceRules(db: PostgresJsDatabase, query: PickupPriceRuleListQuery): Promise<{
749
+ data: {
750
+ id: string;
751
+ optionPriceRuleId: string;
752
+ optionId: string;
753
+ pickupPointId: string;
754
+ pricingMode: "per_person" | "per_booking" | "on_request" | "included" | "unavailable";
755
+ sellAmountCents: number | null;
756
+ costAmountCents: number | null;
757
+ active: boolean;
758
+ sortOrder: number;
759
+ notes: string | null;
760
+ createdAt: Date;
761
+ updatedAt: Date;
762
+ }[];
763
+ total: number;
764
+ limit: number;
765
+ offset: number;
766
+ }>;
767
+ getPickupPriceRuleById(db: PostgresJsDatabase, id: string): Promise<{
768
+ id: string;
769
+ optionPriceRuleId: string;
770
+ optionId: string;
771
+ pickupPointId: string;
772
+ pricingMode: "per_person" | "per_booking" | "on_request" | "included" | "unavailable";
773
+ sellAmountCents: number | null;
774
+ costAmountCents: number | null;
775
+ active: boolean;
776
+ sortOrder: number;
777
+ notes: string | null;
778
+ createdAt: Date;
779
+ updatedAt: Date;
780
+ } | null>;
781
+ createPickupPriceRule(db: PostgresJsDatabase, data: CreatePickupPriceRuleInput): Promise<{
782
+ id: string;
783
+ optionId: string;
784
+ active: boolean;
785
+ sortOrder: number;
786
+ createdAt: Date;
787
+ updatedAt: Date;
788
+ notes: string | null;
789
+ pricingMode: "per_person" | "per_booking" | "on_request" | "included" | "unavailable";
790
+ optionPriceRuleId: string;
791
+ sellAmountCents: number | null;
792
+ costAmountCents: number | null;
793
+ pickupPointId: string;
794
+ } | null>;
795
+ updatePickupPriceRule(db: PostgresJsDatabase, id: string, data: UpdatePickupPriceRuleInput): Promise<{
796
+ id: string;
797
+ optionPriceRuleId: string;
798
+ optionId: string;
799
+ pickupPointId: string;
800
+ pricingMode: "per_person" | "per_booking" | "on_request" | "included" | "unavailable";
801
+ sellAmountCents: number | null;
802
+ costAmountCents: number | null;
803
+ active: boolean;
804
+ sortOrder: number;
805
+ notes: string | null;
806
+ createdAt: Date;
807
+ updatedAt: Date;
808
+ } | null>;
809
+ deletePickupPriceRule(db: PostgresJsDatabase, id: string): Promise<{
810
+ id: string;
811
+ } | null>;
812
+ listDropoffPriceRules(db: PostgresJsDatabase, query: DropoffPriceRuleListQuery): Promise<{
813
+ data: {
814
+ id: string;
815
+ optionPriceRuleId: string;
816
+ optionId: string;
817
+ facilityId: string | null;
818
+ dropoffCode: string | null;
819
+ dropoffName: string;
820
+ pricingMode: "per_person" | "per_booking" | "on_request" | "included" | "unavailable";
821
+ sellAmountCents: number | null;
822
+ costAmountCents: number | null;
823
+ active: boolean;
824
+ sortOrder: number;
825
+ notes: string | null;
826
+ createdAt: Date;
827
+ updatedAt: Date;
828
+ }[];
829
+ total: number;
830
+ limit: number;
831
+ offset: number;
832
+ }>;
833
+ getDropoffPriceRuleById(db: PostgresJsDatabase, id: string): Promise<{
834
+ id: string;
835
+ optionPriceRuleId: string;
836
+ optionId: string;
837
+ facilityId: string | null;
838
+ dropoffCode: string | null;
839
+ dropoffName: string;
840
+ pricingMode: "per_person" | "per_booking" | "on_request" | "included" | "unavailable";
841
+ sellAmountCents: number | null;
842
+ costAmountCents: number | null;
843
+ active: boolean;
844
+ sortOrder: number;
845
+ notes: string | null;
846
+ createdAt: Date;
847
+ updatedAt: Date;
848
+ } | null>;
849
+ createDropoffPriceRule(db: PostgresJsDatabase, data: CreateDropoffPriceRuleInput): Promise<{
850
+ id: string;
851
+ optionId: string;
852
+ active: boolean;
853
+ sortOrder: number;
854
+ createdAt: Date;
855
+ updatedAt: Date;
856
+ notes: string | null;
857
+ pricingMode: "per_person" | "per_booking" | "on_request" | "included" | "unavailable";
858
+ optionPriceRuleId: string;
859
+ sellAmountCents: number | null;
860
+ costAmountCents: number | null;
861
+ facilityId: string | null;
862
+ dropoffCode: string | null;
863
+ dropoffName: string;
864
+ } | null>;
865
+ updateDropoffPriceRule(db: PostgresJsDatabase, id: string, data: UpdateDropoffPriceRuleInput): Promise<{
866
+ id: string;
867
+ optionPriceRuleId: string;
868
+ optionId: string;
869
+ facilityId: string | null;
870
+ dropoffCode: string | null;
871
+ dropoffName: string;
872
+ pricingMode: "per_person" | "per_booking" | "on_request" | "included" | "unavailable";
873
+ sellAmountCents: number | null;
874
+ costAmountCents: number | null;
875
+ active: boolean;
876
+ sortOrder: number;
877
+ notes: string | null;
878
+ createdAt: Date;
879
+ updatedAt: Date;
880
+ } | null>;
881
+ deleteDropoffPriceRule(db: PostgresJsDatabase, id: string): Promise<{
882
+ id: string;
883
+ } | null>;
884
+ listExtraPriceRules(db: PostgresJsDatabase, query: ExtraPriceRuleListQuery): Promise<{
885
+ data: {
886
+ id: string;
887
+ optionPriceRuleId: string;
888
+ optionId: string;
889
+ productExtraId: string | null;
890
+ optionExtraConfigId: string | null;
891
+ pricingMode: "per_person" | "per_booking" | "on_request" | "included" | "unavailable";
892
+ sellAmountCents: number | null;
893
+ costAmountCents: number | null;
894
+ active: boolean;
895
+ sortOrder: number;
896
+ notes: string | null;
897
+ metadata: Record<string, unknown> | null;
898
+ createdAt: Date;
899
+ updatedAt: Date;
900
+ }[];
901
+ total: number;
902
+ limit: number;
903
+ offset: number;
904
+ }>;
905
+ getExtraPriceRuleById(db: PostgresJsDatabase, id: string): Promise<{
906
+ id: string;
907
+ optionPriceRuleId: string;
908
+ optionId: string;
909
+ productExtraId: string | null;
910
+ optionExtraConfigId: string | null;
911
+ pricingMode: "per_person" | "per_booking" | "on_request" | "included" | "unavailable";
912
+ sellAmountCents: number | null;
913
+ costAmountCents: number | null;
914
+ active: boolean;
915
+ sortOrder: number;
916
+ notes: string | null;
917
+ metadata: Record<string, unknown> | null;
918
+ createdAt: Date;
919
+ updatedAt: Date;
920
+ } | null>;
921
+ createExtraPriceRule(db: PostgresJsDatabase, data: CreateExtraPriceRuleInput): Promise<{
922
+ id: string;
923
+ optionId: string;
924
+ active: boolean;
925
+ sortOrder: number;
926
+ metadata: Record<string, unknown> | null;
927
+ createdAt: Date;
928
+ updatedAt: Date;
929
+ notes: string | null;
930
+ pricingMode: "per_person" | "per_booking" | "on_request" | "included" | "unavailable";
931
+ optionPriceRuleId: string;
932
+ sellAmountCents: number | null;
933
+ costAmountCents: number | null;
934
+ productExtraId: string | null;
935
+ optionExtraConfigId: string | null;
936
+ } | null>;
937
+ updateExtraPriceRule(db: PostgresJsDatabase, id: string, data: UpdateExtraPriceRuleInput): Promise<{
938
+ id: string;
939
+ optionPriceRuleId: string;
940
+ optionId: string;
941
+ productExtraId: string | null;
942
+ optionExtraConfigId: string | null;
943
+ pricingMode: "per_person" | "per_booking" | "on_request" | "included" | "unavailable";
944
+ sellAmountCents: number | null;
945
+ costAmountCents: number | null;
946
+ active: boolean;
947
+ sortOrder: number;
948
+ notes: string | null;
949
+ metadata: Record<string, unknown> | null;
950
+ createdAt: Date;
951
+ updatedAt: Date;
952
+ } | null>;
953
+ deleteExtraPriceRule(db: PostgresJsDatabase, id: string): Promise<{
954
+ id: string;
955
+ } | null>;
956
+ };
957
+ export {};
958
+ //# sourceMappingURL=service.d.ts.map