@compassdigital/sdk.typescript 4.528.0 → 4.528.1-alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/lib/index.d.ts +361 -7
  2. package/lib/index.d.ts.map +1 -1
  3. package/lib/index.js +434 -3
  4. package/lib/index.js.map +1 -1
  5. package/lib/interface/centricos.d.ts +9 -3
  6. package/lib/interface/centricos.d.ts.map +1 -1
  7. package/lib/interface/consumer.d.ts +36 -1
  8. package/lib/interface/consumer.d.ts.map +1 -1
  9. package/lib/interface/location.d.ts +0 -1
  10. package/lib/interface/location.d.ts.map +1 -1
  11. package/lib/interface/loyalty.d.ts +830 -0
  12. package/lib/interface/loyalty.d.ts.map +1 -0
  13. package/lib/interface/loyalty.js +5 -0
  14. package/lib/interface/loyalty.js.map +1 -0
  15. package/lib/interface/menu.d.ts +8 -0
  16. package/lib/interface/menu.d.ts.map +1 -1
  17. package/lib/interface/user.d.ts +20 -0
  18. package/lib/interface/user.d.ts.map +1 -1
  19. package/lib/messages/events/AuditEvent.d.ts +39 -0
  20. package/lib/messages/events/AuditEvent.d.ts.map +1 -0
  21. package/lib/messages/events/AuditEvent.js +4 -0
  22. package/lib/messages/events/AuditEvent.js.map +1 -0
  23. package/lib/messages/events/DiscountCreatedEvent.d.ts +1 -0
  24. package/lib/messages/events/DiscountCreatedEvent.d.ts.map +1 -1
  25. package/lib/messages/events/DiscountPublishedEvent.d.ts +1 -0
  26. package/lib/messages/events/DiscountPublishedEvent.d.ts.map +1 -1
  27. package/lib/messages/events/DiscountUpdatedEvent.d.ts +1 -0
  28. package/lib/messages/events/DiscountUpdatedEvent.d.ts.map +1 -1
  29. package/lib/messages/events/FrictionlessOrderFailureEvent.d.ts +23 -0
  30. package/lib/messages/events/FrictionlessOrderFailureEvent.d.ts.map +1 -0
  31. package/lib/messages/events/FrictionlessOrderFailureEvent.js +4 -0
  32. package/lib/messages/events/FrictionlessOrderFailureEvent.js.map +1 -0
  33. package/lib/messages/events/index.d.ts +2 -0
  34. package/lib/messages/events/index.d.ts.map +1 -1
  35. package/manifest.json +7 -0
  36. package/package.json +1 -1
  37. package/src/index.ts +1051 -7
  38. package/src/interface/centricos.ts +16 -6
  39. package/src/interface/consumer.ts +59 -1
  40. package/src/interface/location.ts +0 -1
  41. package/src/interface/loyalty.ts +1155 -0
  42. package/src/interface/menu.ts +8 -0
  43. package/src/interface/user.ts +27 -0
  44. package/src/messages/events/AuditEvent.ts +52 -0
  45. package/src/messages/events/DiscountCreatedEvent.ts +1 -0
  46. package/src/messages/events/DiscountPublishedEvent.ts +1 -0
  47. package/src/messages/events/DiscountUpdatedEvent.ts +1 -0
  48. package/src/messages/events/FrictionlessOrderFailureEvent.ts +34 -0
  49. package/src/messages/events/index.ts +4 -0
  50. package/test/client.test.ts +23 -0
@@ -0,0 +1,1155 @@
1
+ /* eslint-disable */
2
+ // THIS FILE IS AUTOMATICALLY GENERATED, DO NOT MODIFY
3
+
4
+ import { RequestQuery, BaseRequest } from './util';
5
+
6
+ export interface BundleResponseDto {
7
+ id: string;
8
+ createdAt: string;
9
+ updatedAt: string;
10
+ deletedAt?: string | null;
11
+ createdBy: string;
12
+ realm: 'boost' | 'thrive';
13
+ siteId?: string | null;
14
+ name: string;
15
+ description?: string | null;
16
+ }
17
+
18
+ export interface BundlePaginationDto {
19
+ cursor?: string | null;
20
+ hasMore: boolean;
21
+ limit: number;
22
+ }
23
+
24
+ export interface BundleListResponseDto {
25
+ data: BundleResponseDto[];
26
+ pagination: BundlePaginationDto;
27
+ }
28
+
29
+ export interface ErrorDisplayMessage {
30
+ // user message title
31
+ title: string;
32
+ // user message description
33
+ description: string;
34
+ }
35
+
36
+ export interface ErrorData {
37
+ // http status code
38
+ statusCode: number;
39
+ // http status text
40
+ statusText: string;
41
+ timestamp: string;
42
+ // user friendly error message
43
+ displayMessage: ErrorDisplayMessage;
44
+ }
45
+
46
+ export interface Error {
47
+ // business error code
48
+ code: number;
49
+ // business error description
50
+ message: string;
51
+ // additional error data
52
+ data: ErrorData;
53
+ }
54
+
55
+ export interface BundleGroupDto {
56
+ groupName: string;
57
+ minimumQuantity: number;
58
+ itemIds: string[];
59
+ }
60
+
61
+ export interface BundleDetailResponseDto {
62
+ id: string;
63
+ createdAt: string;
64
+ updatedAt: string;
65
+ deletedAt?: string | null;
66
+ createdBy: string;
67
+ realm: 'boost' | 'thrive';
68
+ siteId?: string | null;
69
+ name: string;
70
+ description?: string | null;
71
+ groups: BundleGroupDto[];
72
+ }
73
+
74
+ export interface CreateBundleDto {
75
+ realm: 'boost' | 'thrive';
76
+ siteId?: string;
77
+ name: string;
78
+ description?: string;
79
+ groups: BundleGroupDto[];
80
+ }
81
+
82
+ export interface UpdateBundleDto {
83
+ realm?: 'boost' | 'thrive';
84
+ siteId?: string;
85
+ name?: string;
86
+ description?: string;
87
+ groups?: BundleGroupDto[];
88
+ }
89
+
90
+ export interface CampaignResponseDto {
91
+ id: string;
92
+ createdAt: string;
93
+ updatedAt: string;
94
+ deletedAt?: string | null;
95
+ createdBy: string;
96
+ updatedBy: string;
97
+ realm: 'boost' | 'thrive';
98
+ name: string;
99
+ description?: string | null;
100
+ type: 'promo_code' | 'auto_apply' | 'loyalty_reward';
101
+ status: 'draft' | 'active' | 'paused' | 'expired' | 'archived';
102
+ discountType: 'AMOUNT_OFF' | 'PERCENT_OFF' | 'FREE_ITEM';
103
+ discountScope: 'order' | 'items';
104
+ discountValueCents?: number | null;
105
+ discountPercent?: number | null;
106
+ appliesToCheapest: boolean;
107
+ maxDiscountCents?: number | null;
108
+ codeType: 'open' | 'personal' | 'auto_applied';
109
+ // YYYY-MM-DD
110
+ startDate?: string | null;
111
+ // YYYY-MM-DD
112
+ endDate?: string | null;
113
+ maxRedemptions?: number | null;
114
+ maxRedemptionsPerCustomer?: number | null;
115
+ maxRedemptionsDaily?: number | null;
116
+ maxRedemptionsPerCustomerDaily?: number | null;
117
+ minOrderValueCents?: number | null;
118
+ maxOrderValueCents?: number | null;
119
+ bundleId?: string | null;
120
+ }
121
+
122
+ export interface CampaignPaginationDto {
123
+ cursor?: string | null;
124
+ hasMore: boolean;
125
+ limit: number;
126
+ }
127
+
128
+ export interface CampaignListResponseDto {
129
+ data: CampaignResponseDto[];
130
+ pagination: CampaignPaginationDto;
131
+ }
132
+
133
+ export interface CampaignDailyScheduleResponseDto {
134
+ id: string;
135
+ campaignId: string;
136
+ dayOfWeek: 'mon' | 'tue' | 'wed' | 'thu' | 'fri' | 'sat' | 'sun';
137
+ active: boolean;
138
+ // HH:MM:SS format
139
+ startTime: string;
140
+ // HH:MM:SS format
141
+ endTime: string;
142
+ }
143
+
144
+ export interface CampaignEligibilityResponseDto {
145
+ id: string;
146
+ campaignId: string;
147
+ eligibilityType: 'everyone' | 'meal_plan' | 'badge_pay' | 'sso_group' | 'segment';
148
+ ssoGroupId?: string | null;
149
+ segmentId?: string | null;
150
+ maxRedemptionsPerCustomer?: number | null;
151
+ maxRedemptionsPerCustomerDaily?: number | null;
152
+ }
153
+
154
+ export interface CampaignSiteScopeResponseDto {
155
+ campaignId: string;
156
+ siteId: string;
157
+ excluded: boolean;
158
+ }
159
+
160
+ export interface CampaignStationScopeResponseDto {
161
+ campaignId: string;
162
+ siteId: string;
163
+ stationId: string;
164
+ excluded: boolean;
165
+ }
166
+
167
+ export interface CampaignItemTargetResponseDto {
168
+ id: string;
169
+ campaignId: string;
170
+ siteId?: string | null;
171
+ stationId?: string | null;
172
+ menuId?: string | null;
173
+ categoryId?: string | null;
174
+ itemId?: string | null;
175
+ maxDiscountCents?: number | null;
176
+ }
177
+
178
+ export interface CampaignDetailResponseDto {
179
+ id: string;
180
+ createdAt: string;
181
+ updatedAt: string;
182
+ deletedAt?: string | null;
183
+ createdBy: string;
184
+ updatedBy: string;
185
+ realm: 'boost' | 'thrive';
186
+ name: string;
187
+ description?: string | null;
188
+ type: 'promo_code' | 'auto_apply' | 'loyalty_reward';
189
+ status: 'draft' | 'active' | 'paused' | 'expired' | 'archived';
190
+ discountType: 'AMOUNT_OFF' | 'PERCENT_OFF' | 'FREE_ITEM';
191
+ discountScope: 'order' | 'items';
192
+ discountValueCents?: number | null;
193
+ discountPercent?: number | null;
194
+ appliesToCheapest: boolean;
195
+ maxDiscountCents?: number | null;
196
+ codeType: 'open' | 'personal' | 'auto_applied';
197
+ // YYYY-MM-DD
198
+ startDate?: string | null;
199
+ // YYYY-MM-DD
200
+ endDate?: string | null;
201
+ maxRedemptions?: number | null;
202
+ maxRedemptionsPerCustomer?: number | null;
203
+ maxRedemptionsDaily?: number | null;
204
+ maxRedemptionsPerCustomerDaily?: number | null;
205
+ minOrderValueCents?: number | null;
206
+ maxOrderValueCents?: number | null;
207
+ bundleId?: string | null;
208
+ dailySchedule: CampaignDailyScheduleResponseDto[];
209
+ eligibility: CampaignEligibilityResponseDto[];
210
+ siteScopes: CampaignSiteScopeResponseDto[];
211
+ stationScopes: CampaignStationScopeResponseDto[];
212
+ itemTargets: CampaignItemTargetResponseDto[];
213
+ }
214
+
215
+ export interface DailyScheduleDto {
216
+ dayOfWeek: 'mon' | 'tue' | 'wed' | 'thu' | 'fri' | 'sat' | 'sun';
217
+ active: boolean;
218
+ // HH:MM:SS format
219
+ startTime: string;
220
+ // HH:MM:SS format
221
+ endTime: string;
222
+ }
223
+
224
+ export interface EligibilityDto {
225
+ eligibilityType: 'everyone' | 'meal_plan' | 'badge_pay' | 'sso_group' | 'segment';
226
+ ssoGroupId?: string;
227
+ segmentId?: string;
228
+ maxRedemptionsPerCustomer?: number;
229
+ maxRedemptionsPerCustomerDaily?: number;
230
+ }
231
+
232
+ export interface SiteScopeDto {
233
+ siteId: string;
234
+ excluded?: boolean;
235
+ }
236
+
237
+ export interface StationScopeDto {
238
+ siteId: string;
239
+ stationId: string;
240
+ excluded?: boolean;
241
+ }
242
+
243
+ export interface ItemTargetDto {
244
+ siteId?: string;
245
+ stationId?: string;
246
+ menuId?: string;
247
+ categoryId?: string;
248
+ itemId?: string;
249
+ maxDiscountCents?: number;
250
+ }
251
+
252
+ export interface CreateCampaignDto {
253
+ realm: 'boost' | 'thrive';
254
+ name: string;
255
+ description?: string;
256
+ type: 'promo_code' | 'auto_apply' | 'loyalty_reward';
257
+ discountType: 'AMOUNT_OFF' | 'PERCENT_OFF' | 'FREE_ITEM';
258
+ discountScope: 'order' | 'items';
259
+ discountValueCents?: number;
260
+ discountPercent?: number;
261
+ appliesToCheapest?: boolean;
262
+ maxDiscountCents?: number;
263
+ codeType: 'open' | 'personal' | 'auto_applied';
264
+ // YYYY-MM-DD
265
+ startDate?: string;
266
+ // YYYY-MM-DD
267
+ endDate?: string;
268
+ maxRedemptions?: number;
269
+ maxRedemptionsPerCustomer?: number;
270
+ maxRedemptionsDaily?: number;
271
+ maxRedemptionsPerCustomerDaily?: number;
272
+ minOrderValueCents?: number;
273
+ maxOrderValueCents?: number;
274
+ dailySchedule?: DailyScheduleDto[];
275
+ eligibility?: EligibilityDto[];
276
+ siteScopes?: SiteScopeDto[];
277
+ stationScopes?: StationScopeDto[];
278
+ itemTargets?: ItemTargetDto[];
279
+ // Reference to a reusable bundle for cart-content conditions
280
+ bundleId?: string;
281
+ }
282
+
283
+ export interface UpdateCampaignDto {
284
+ realm?: 'boost' | 'thrive';
285
+ name?: string;
286
+ description?: string;
287
+ type?: 'promo_code' | 'auto_apply' | 'loyalty_reward';
288
+ discountType?: 'AMOUNT_OFF' | 'PERCENT_OFF' | 'FREE_ITEM';
289
+ discountScope?: 'order' | 'items';
290
+ discountValueCents?: number;
291
+ discountPercent?: number;
292
+ appliesToCheapest?: boolean;
293
+ maxDiscountCents?: number;
294
+ codeType?: 'open' | 'personal' | 'auto_applied';
295
+ // YYYY-MM-DD
296
+ startDate?: string;
297
+ // YYYY-MM-DD
298
+ endDate?: string;
299
+ maxRedemptions?: number;
300
+ maxRedemptionsPerCustomer?: number;
301
+ maxRedemptionsDaily?: number;
302
+ maxRedemptionsPerCustomerDaily?: number;
303
+ minOrderValueCents?: number;
304
+ maxOrderValueCents?: number;
305
+ dailySchedule?: DailyScheduleDto[];
306
+ eligibility?: EligibilityDto[];
307
+ siteScopes?: SiteScopeDto[];
308
+ stationScopes?: StationScopeDto[];
309
+ itemTargets?: ItemTargetDto[];
310
+ // Reference to a reusable bundle for cart-content conditions
311
+ bundleId?: string;
312
+ }
313
+
314
+ export interface UpdateCampaignStatusDto {
315
+ status: 'draft' | 'active' | 'paused' | 'expired' | 'archived';
316
+ reason?: string;
317
+ }
318
+
319
+ export interface VoucherResponseDto {
320
+ id: string;
321
+ createdAt: string;
322
+ updatedAt: string;
323
+ deletedAt?: string | null;
324
+ campaignId: string;
325
+ realm: 'boost' | 'thrive';
326
+ code: string;
327
+ codeType: 'open' | 'personal' | 'auto_applied';
328
+ customerId?: string | null;
329
+ status: string;
330
+ expiresAt?: string | null;
331
+ issuedBy?: string | null;
332
+ issueReason?: string | null;
333
+ revokedAt?: string | null;
334
+ revokedBy?: string | null;
335
+ revokeReason?: string | null;
336
+ source?: string;
337
+ campaignName?: string;
338
+ campaignType?: string;
339
+ redemptionCount?: number;
340
+ }
341
+
342
+ export interface VoucherPaginationDto {
343
+ cursor?: string | null;
344
+ hasMore: boolean;
345
+ limit: number;
346
+ }
347
+
348
+ export interface VoucherListResponseDto {
349
+ data: VoucherResponseDto[];
350
+ pagination: VoucherPaginationDto;
351
+ }
352
+
353
+ export interface CreateVoucherDto {
354
+ campaignId: string;
355
+ code: string;
356
+ // Supports legacy alias "binding"
357
+ codeType: 'open' | 'personal' | 'auto_applied';
358
+ // Required when codeType = personal
359
+ customerId?: string;
360
+ expiresAt?: string;
361
+ issueReason?: string;
362
+ }
363
+
364
+ export interface UpdateVoucherDto {
365
+ expiresAt?: string;
366
+ customerId?: string;
367
+ }
368
+
369
+ export interface RevokeVoucherDto {
370
+ // Reason for revoking the voucher
371
+ reason: string;
372
+ }
373
+
374
+ export interface BatchVoucherDto {
375
+ campaignId: string;
376
+ count: number;
377
+ // Supports legacy alias "binding"
378
+ codeType: 'open' | 'personal';
379
+ // Prefix prepended to generated codes
380
+ prefix?: string;
381
+ expiresAt?: string;
382
+ // Required when codeType = personal; length must match count
383
+ customerIds?: string[];
384
+ }
385
+
386
+ export interface BatchVoucherResponseDto {
387
+ codePoolId: string;
388
+ count: number;
389
+ }
390
+
391
+ export interface RedemptionItemResponseDto {
392
+ id: string;
393
+ itemId: string;
394
+ itemName?: string | null;
395
+ originalPriceCents: number;
396
+ discountAmountCents: number;
397
+ }
398
+
399
+ export interface VoucherDiscountResponseDto {
400
+ type: string;
401
+ amount_off: number;
402
+ percent_off: number;
403
+ }
404
+
405
+ export interface VoucherRedemptionVoucherDto {
406
+ id: string;
407
+ code: string;
408
+ discount: VoucherDiscountResponseDto;
409
+ }
410
+
411
+ export interface RedemptionResponseDto {
412
+ id: string;
413
+ createdAt: string;
414
+ voucherId?: string | null;
415
+ customerId?: string | null;
416
+ orderId?: string | null;
417
+ siteId?: string | null;
418
+ stationId?: string | null;
419
+ realm?: string;
420
+ discountAmountCents?: number;
421
+ orderTotalCents?: number;
422
+ status?: string;
423
+ rolledBackAt?: string | null;
424
+ rollbackReason?: string | null;
425
+ externalRedemptionId?: string | null;
426
+ items?: RedemptionItemResponseDto[];
427
+ date?: string;
428
+ result?: string;
429
+ object?: string;
430
+ app?: string;
431
+ voucher?: VoucherRedemptionVoucherDto;
432
+ }
433
+
434
+ export interface RedemptionListResponseDto {
435
+ data: RedemptionResponseDto[];
436
+ pagination: VoucherPaginationDto;
437
+ }
438
+
439
+ export interface VoucherCustomerDto {
440
+ source_id?: string;
441
+ email?: string;
442
+ }
443
+
444
+ export interface VoucherOrderItemProductMetadataDto {
445
+ item_name?: string;
446
+ }
447
+
448
+ export interface VoucherOrderItemProductDto {
449
+ metadata?: VoucherOrderItemProductMetadataDto;
450
+ }
451
+
452
+ export interface VoucherOrderItemDto {
453
+ source_id?: string;
454
+ product_id?: string;
455
+ quantity?: number;
456
+ price?: number;
457
+ product?: VoucherOrderItemProductDto;
458
+ }
459
+
460
+ export interface VoucherOrderMetadataDto {
461
+ order_id?: string;
462
+ brand_id?: string;
463
+ site_id?: string;
464
+ location_group_id?: string;
465
+ }
466
+
467
+ export interface VoucherOrderDto {
468
+ source_id?: string;
469
+ items?: VoucherOrderItemDto[];
470
+ metadata?: VoucherOrderMetadataDto;
471
+ }
472
+
473
+ export interface VoucherOperationDto {
474
+ codes: string[];
475
+ customer?: VoucherCustomerDto;
476
+ order?: VoucherOrderDto;
477
+ }
478
+
479
+ export interface VoucherErrorResponseDto {
480
+ message: string;
481
+ }
482
+
483
+ export interface VoucherOperationOrderResponseDto {
484
+ total_discount_amount: number;
485
+ total_applied_discount_amount: number;
486
+ }
487
+
488
+ export interface VoucherOperationResultResponseDto {
489
+ discount?: VoucherDiscountResponseDto;
490
+ error?: VoucherErrorResponseDto;
491
+ }
492
+
493
+ export interface VoucherRedeemableResponseDto {
494
+ status: string;
495
+ id: string;
496
+ object: string;
497
+ order: VoucherOperationOrderResponseDto;
498
+ result: VoucherOperationResultResponseDto;
499
+ }
500
+
501
+ export interface VoucherOperationResponseDto {
502
+ code?: string;
503
+ valid?: boolean;
504
+ success?: boolean;
505
+ app?: string;
506
+ discount?: VoucherDiscountResponseDto;
507
+ provider_data?: Record<string, any>;
508
+ error?: VoucherErrorResponseDto;
509
+ redeemables?: VoucherRedeemableResponseDto[];
510
+ redemptions?: RedemptionResponseDto[];
511
+ id?: string;
512
+ date?: string;
513
+ result?: string;
514
+ object?: string;
515
+ voucher?: VoucherRedemptionVoucherDto;
516
+ }
517
+
518
+ export interface SegmentResponseDto {
519
+ id: string;
520
+ createdAt: string;
521
+ updatedAt: string;
522
+ deletedAt?: string | null;
523
+ createdBy: string;
524
+ realm: 'boost' | 'thrive';
525
+ siteId: string;
526
+ name: string;
527
+ description?: string | null;
528
+ type: 'static_list' | 'sso_group' | 'attribute_rule';
529
+ ssoGroupId?: string | null;
530
+ ruleJson?: Record<string, any> | null;
531
+ memberCount?: number;
532
+ }
533
+
534
+ export interface SegmentPaginationDto {
535
+ cursor?: string | null;
536
+ hasMore: boolean;
537
+ limit: number;
538
+ }
539
+
540
+ export interface SegmentListResponseDto {
541
+ data: SegmentResponseDto[];
542
+ pagination: SegmentPaginationDto;
543
+ }
544
+
545
+ export interface SegmentAttributeResponseDto {
546
+ key: string;
547
+ label: string;
548
+ }
549
+
550
+ export interface SegmentPreviewCountResponseDto {
551
+ count: number;
552
+ }
553
+
554
+ export interface CreateSegmentDto {
555
+ realm: 'boost' | 'thrive';
556
+ siteId: string;
557
+ name: string;
558
+ description?: string;
559
+ type: 'static_list' | 'sso_group' | 'attribute_rule';
560
+ // Required when type = sso_group
561
+ ssoGroupId?: string;
562
+ // Required when type = attribute_rule
563
+ ruleJson?: Record<string, any>;
564
+ // Initial members for static_list segments
565
+ customerIds?: string[];
566
+ }
567
+
568
+ export interface UpdateSegmentDto {
569
+ name?: string;
570
+ description?: string;
571
+ ssoGroupId?: string;
572
+ ruleJson?: Record<string, any>;
573
+ }
574
+
575
+ export interface SegmentMemberResponseDto {
576
+ customerId: string;
577
+ addedAt: string;
578
+ addedBy: string;
579
+ }
580
+
581
+ export interface SegmentMembersListResponseDto {
582
+ data: SegmentMemberResponseDto[];
583
+ pagination: SegmentPaginationDto;
584
+ }
585
+
586
+ export interface SegmentMembersDto {
587
+ // List of customer IDs
588
+ customerIds: string[];
589
+ }
590
+
591
+ export interface AddSegmentMembersResponseDto {
592
+ added: number;
593
+ }
594
+
595
+ export interface RemoveSegmentMembersResponseDto {
596
+ removed: number;
597
+ }
598
+
599
+ export interface RollbackRedemptionDto {
600
+ // Reason for rolling back the redemption
601
+ reason: string;
602
+ }
603
+
604
+ export interface RewardResponseDto {
605
+ id: string;
606
+ createdAt: string;
607
+ updatedAt: string;
608
+ deletedAt?: string | null;
609
+ createdBy: string;
610
+ realm: 'boost' | 'thrive';
611
+ name: string;
612
+ description?: string | null;
613
+ status: 'active' | 'paused' | 'archived';
614
+ }
615
+
616
+ export interface RewardPaginationDto {
617
+ cursor?: string | null;
618
+ hasMore: boolean;
619
+ limit: number;
620
+ }
621
+
622
+ export interface RewardListResponseDto {
623
+ data: RewardResponseDto[];
624
+ pagination: RewardPaginationDto;
625
+ }
626
+
627
+ export interface BrandExclusionDto {
628
+ siteId: string;
629
+ stationId: string;
630
+ }
631
+
632
+ export interface EarningRuleDto {
633
+ eventType: 'order_placed' | 'item_purchased' | 'amount_spent';
634
+ points: number;
635
+ spendThresholdCents?: number;
636
+ siteId?: string;
637
+ itemId?: string;
638
+ // Stations excluded from earning on this rule
639
+ brandExclusions?: BrandExclusionDto[];
640
+ }
641
+
642
+ export interface MilestoneDto {
643
+ pointsRequired: number;
644
+ campaignId: string;
645
+ resetsAfterMilestone: boolean;
646
+ maxRewardCount?: number;
647
+ }
648
+
649
+ export interface RewardDetailResponseDto {
650
+ id: string;
651
+ createdAt: string;
652
+ updatedAt: string;
653
+ deletedAt?: string | null;
654
+ createdBy: string;
655
+ realm: 'boost' | 'thrive';
656
+ name: string;
657
+ description?: string | null;
658
+ status: 'active' | 'paused' | 'archived';
659
+ earningRules: EarningRuleDto[];
660
+ milestones: MilestoneDto[];
661
+ }
662
+
663
+ export interface CreateRewardDto {
664
+ realm: 'boost' | 'thrive';
665
+ name: string;
666
+ description?: string;
667
+ earningRules?: EarningRuleDto[];
668
+ milestones?: MilestoneDto[];
669
+ }
670
+
671
+ export interface UpdateRewardDto {
672
+ realm?: 'boost' | 'thrive';
673
+ name?: string;
674
+ description?: string;
675
+ earningRules?: EarningRuleDto[];
676
+ milestones?: MilestoneDto[];
677
+ }
678
+
679
+ export interface UpdateRewardStatusDto {
680
+ status: 'active' | 'paused' | 'archived';
681
+ }
682
+
683
+ export interface RewardCardResponseDto {
684
+ id: string;
685
+ createdAt: string;
686
+ updatedAt: string;
687
+ rewardId: string;
688
+ customerId: string;
689
+ pointsBalance: number;
690
+ lifetimePoints: number;
691
+ status: string;
692
+ }
693
+
694
+ export interface RewardCardListResponseDto {
695
+ data: RewardCardResponseDto[];
696
+ pagination: RewardPaginationDto;
697
+ }
698
+
699
+ export interface RewardEventResponseDto {
700
+ id: string;
701
+ createdAt: string;
702
+ cardId: string;
703
+ eventType: 'order_placed' | 'item_purchased' | 'amount_spent';
704
+ pointsDelta: number;
705
+ orderId?: string | null;
706
+ description?: string | null;
707
+ adjustedBy?: string | null;
708
+ }
709
+
710
+ export interface RewardCardDetailResponseDto {
711
+ id: string;
712
+ createdAt: string;
713
+ updatedAt: string;
714
+ rewardId: string;
715
+ customerId: string;
716
+ pointsBalance: number;
717
+ lifetimePoints: number;
718
+ status: string;
719
+ events: RewardEventResponseDto[];
720
+ }
721
+
722
+ export interface AdjustPointsDto {
723
+ // Positive to add, negative to deduct
724
+ pointsDelta: number;
725
+ description: string;
726
+ }
727
+
728
+ export interface EarnOrderItemDto {
729
+ id: string;
730
+ quantity: number;
731
+ priceCents?: number;
732
+ }
733
+
734
+ export interface EarnOrderDto {
735
+ orderId: string;
736
+ customerId: string;
737
+ realm: 'boost' | 'thrive';
738
+ siteId: string;
739
+ brandId: string;
740
+ amountCents: number;
741
+ items: EarnOrderItemDto[];
742
+ email?: string;
743
+ metadata?: Record<string, any>;
744
+ }
745
+
746
+ export interface EarnOrderResponseDto {
747
+ rewardId?: string | null;
748
+ alreadyProcessed: boolean;
749
+ pointsAwarded: number;
750
+ issuedVoucherCodes: string[];
751
+ }
752
+
753
+ // GET /loyalty/bundles - List bundles with optional filters
754
+
755
+ export interface GetLoyaltyBundlesQuery {
756
+ // Max items to return
757
+ limit?: number;
758
+ // Opaque cursor from previous response
759
+ cursor?: string;
760
+ realm?: 'boost' | 'thrive';
761
+ siteId?: string;
762
+ siteIds?: string[];
763
+ name?: string;
764
+ }
765
+
766
+ export type GetLoyaltyBundlesResponse = BundleListResponseDto;
767
+
768
+ // POST /loyalty/bundles - Create a new bundle
769
+
770
+ export type PostLoyaltyBundleBody = CreateBundleDto;
771
+
772
+ export type PostLoyaltyBundleResponse = BundleDetailResponseDto;
773
+
774
+ // GET /loyalty/bundles/{id} - Get bundle by ID with groups
775
+
776
+ export interface GetLoyaltyBundlePath {
777
+ id: string;
778
+ }
779
+
780
+ export type GetLoyaltyBundleResponse = BundleDetailResponseDto;
781
+
782
+ // PATCH /loyalty/bundles/{id} - Update a bundle
783
+
784
+ export interface PatchLoyaltyBundlePath {
785
+ id: string;
786
+ }
787
+
788
+ export type PatchLoyaltyBundleBody = UpdateBundleDto;
789
+
790
+ export type PatchLoyaltyBundleResponse = BundleDetailResponseDto;
791
+
792
+ // DELETE /loyalty/bundles/{id} - Soft-delete a bundle
793
+
794
+ export interface DeleteLoyaltyBundlePath {
795
+ id: string;
796
+ }
797
+
798
+ export type DeleteLoyaltyBundleResponse = {};
799
+
800
+ // GET /loyalty/campaigns - List campaigns with filters and pagination
801
+
802
+ export interface GetLoyaltyCampaignsQuery {
803
+ // Max items to return
804
+ limit?: number;
805
+ // Opaque cursor from previous response
806
+ cursor?: string;
807
+ realm?: 'boost' | 'thrive';
808
+ status?: 'draft' | 'active' | 'paused' | 'expired' | 'archived';
809
+ type?: 'promo_code' | 'auto_apply' | 'loyalty_reward';
810
+ // Case-insensitive partial name match
811
+ name?: string;
812
+ // YYYY-MM-DD
813
+ startDateFrom?: string;
814
+ // YYYY-MM-DD
815
+ startDateTo?: string;
816
+ // YYYY-MM-DD
817
+ endDateFrom?: string;
818
+ // YYYY-MM-DD
819
+ endDateTo?: string;
820
+ sortBy?: 'name' | 'createdAt' | 'startDate' | 'status';
821
+ sortOrder?: 'ASC' | 'DESC';
822
+ }
823
+
824
+ export type GetLoyaltyCampaignsResponse = CampaignListResponseDto;
825
+
826
+ // POST /loyalty/campaigns - Create a campaign with nested child entities
827
+
828
+ export type PostLoyaltyCampaignBody = CreateCampaignDto;
829
+
830
+ export type PostLoyaltyCampaignResponse = CampaignDetailResponseDto;
831
+
832
+ // GET /loyalty/campaigns/{id} - Get campaign detail with all child entities
833
+
834
+ export interface GetLoyaltyCampaignPath {
835
+ id: string;
836
+ }
837
+
838
+ export type GetLoyaltyCampaignResponse = CampaignDetailResponseDto;
839
+
840
+ // PUT /loyalty/campaigns/{id} - Update a campaign and its child entities
841
+
842
+ export interface PutLoyaltyCampaignPath {
843
+ id: string;
844
+ }
845
+
846
+ export type PutLoyaltyCampaignBody = UpdateCampaignDto;
847
+
848
+ export type PutLoyaltyCampaignResponse = CampaignDetailResponseDto;
849
+
850
+ // DELETE /loyalty/campaigns/{id} - Soft-delete a campaign
851
+
852
+ export interface DeleteLoyaltyCampaignPath {
853
+ id: string;
854
+ }
855
+
856
+ export type DeleteLoyaltyCampaignResponse = {};
857
+
858
+ // PATCH /loyalty/campaigns/{id}/status - Transition campaign status
859
+
860
+ export interface PatchLoyaltyCampaignStatusPath {
861
+ id: string;
862
+ }
863
+
864
+ export type PatchLoyaltyCampaignStatusBody = UpdateCampaignStatusDto;
865
+
866
+ export type PatchLoyaltyCampaignStatusResponse = CampaignDetailResponseDto;
867
+
868
+ // POST /loyalty/campaigns/{id}/clone - Deep clone a campaign and all child entities
869
+
870
+ export interface PostLoyaltyCampaignClonePath {
871
+ id: string;
872
+ }
873
+
874
+ export type PostLoyaltyCampaignCloneResponse = CampaignDetailResponseDto;
875
+
876
+ // GET /loyalty/vouchers - List vouchers with optional filters
877
+
878
+ export interface GetLoyaltyVouchersQuery {
879
+ // Max items to return
880
+ limit?: number;
881
+ // Opaque cursor from previous response
882
+ cursor?: string;
883
+ campaignId?: string;
884
+ realm?: 'boost' | 'thrive';
885
+ status?: 'active' | 'redeemed' | 'expired' | 'revoked';
886
+ // Exact code match
887
+ code?: string;
888
+ codeType?: 'open' | 'personal' | 'auto_applied';
889
+ customerId?: string;
890
+ }
891
+
892
+ export type GetLoyaltyVouchersResponse = VoucherListResponseDto;
893
+
894
+ // POST /loyalty/vouchers - Create a single voucher
895
+
896
+ export type PostLoyaltyVoucherBody = CreateVoucherDto;
897
+
898
+ export type PostLoyaltyVoucherResponse = VoucherResponseDto;
899
+
900
+ // GET /loyalty/vouchers/{id} - Get voucher by ID with campaign info and redemption count
901
+
902
+ export interface GetLoyaltyVoucherPath {
903
+ id: string;
904
+ }
905
+
906
+ export type GetLoyaltyVoucherResponse = VoucherResponseDto;
907
+
908
+ // PUT /loyalty/vouchers/{id} - Update a voucher
909
+
910
+ export interface PutLoyaltyVoucherPath {
911
+ id: string;
912
+ }
913
+
914
+ export type PutLoyaltyVoucherBody = UpdateVoucherDto;
915
+
916
+ export type PutLoyaltyVoucherResponse = VoucherResponseDto;
917
+
918
+ // DELETE /loyalty/vouchers/{id} - Soft-delete a voucher
919
+
920
+ export interface DeleteLoyaltyVoucherPath {
921
+ id: string;
922
+ }
923
+
924
+ export type DeleteLoyaltyVoucherResponse = {};
925
+
926
+ // POST /loyalty/vouchers/{id}/revoke - Revoke a voucher with a required reason
927
+
928
+ export interface PostLoyaltyVoucherRevokePath {
929
+ id: string;
930
+ }
931
+
932
+ export type PostLoyaltyVoucherRevokeBody = RevokeVoucherDto;
933
+
934
+ export type PostLoyaltyVoucherRevokeResponse = VoucherResponseDto;
935
+
936
+ // POST /loyalty/vouchers/batch - Batch generate voucher codes for a campaign
937
+
938
+ export type PostLoyaltyVouchersBatchBody = BatchVoucherDto;
939
+
940
+ export type PostLoyaltyVouchersBatchResponse = BatchVoucherResponseDto;
941
+
942
+ // GET /loyalty/vouchers/{id}/redemptions - Get redemption history for a voucher
943
+
944
+ export interface GetLoyaltyVoucherRedemptionsPath {
945
+ id: string;
946
+ }
947
+
948
+ export interface GetLoyaltyVoucherRedemptionsQuery {
949
+ // Max items to return
950
+ limit?: number;
951
+ // Opaque cursor from previous response
952
+ cursor?: string;
953
+ }
954
+
955
+ export type GetLoyaltyVoucherRedemptionsResponse = RedemptionListResponseDto;
956
+
957
+ // POST /loyalty/vouchers/validate - Validate one or more voucher codes
958
+
959
+ export type PostLoyaltyVouchersValidateBody = VoucherOperationDto;
960
+
961
+ export type PostLoyaltyVouchersValidateResponse = VoucherOperationResponseDto;
962
+
963
+ // POST /loyalty/vouchers/redeem - Redeem one or more voucher codes
964
+
965
+ export type PostLoyaltyVouchersRedeemBody = VoucherOperationDto;
966
+
967
+ export type PostLoyaltyVouchersRedeemResponse = VoucherOperationResponseDto;
968
+
969
+ // GET /loyalty/segments - List segments with optional filters
970
+
971
+ export interface GetLoyaltySegmentsQuery {
972
+ // Max items to return
973
+ limit?: number;
974
+ // Opaque cursor from previous response
975
+ cursor?: string;
976
+ realm?: 'boost' | 'thrive';
977
+ type?: 'static_list' | 'sso_group' | 'attribute_rule';
978
+ siteId?: string;
979
+ // Case-insensitive partial name match
980
+ name?: string;
981
+ }
982
+
983
+ export type GetLoyaltySegmentsResponse = SegmentListResponseDto;
984
+
985
+ // POST /loyalty/segments - Create a new segment
986
+
987
+ export type PostLoyaltySegmentBody = CreateSegmentDto;
988
+
989
+ export type PostLoyaltySegmentResponse = SegmentResponseDto;
990
+
991
+ // GET /loyalty/segments/attributes - List available attributes for rule-based segments
992
+
993
+ export type GetLoyaltySegmentAttributesResponse = SegmentAttributeResponseDto[];
994
+
995
+ // POST /loyalty/segments/preview-count - Preview how many customers match a segment rule
996
+
997
+ export type PostLoyaltySegmentPreviewCountResponse = SegmentPreviewCountResponseDto;
998
+
999
+ // GET /loyalty/segments/{id} - Get segment by ID
1000
+
1001
+ export interface GetLoyaltySegmentPath {
1002
+ id: string;
1003
+ }
1004
+
1005
+ export type GetLoyaltySegmentResponse = SegmentResponseDto;
1006
+
1007
+ // PATCH /loyalty/segments/{id} - Update a segment
1008
+
1009
+ export interface PatchLoyaltySegmentPath {
1010
+ id: string;
1011
+ }
1012
+
1013
+ export type PatchLoyaltySegmentBody = UpdateSegmentDto;
1014
+
1015
+ export type PatchLoyaltySegmentResponse = SegmentResponseDto;
1016
+
1017
+ // DELETE /loyalty/segments/{id} - Soft-delete a segment
1018
+
1019
+ export interface DeleteLoyaltySegmentPath {
1020
+ id: string;
1021
+ }
1022
+
1023
+ export type DeleteLoyaltySegmentResponse = {};
1024
+
1025
+ // GET /loyalty/segments/{id}/members - List members of a static_list segment
1026
+
1027
+ export interface GetLoyaltySegmentMembersPath {
1028
+ id: string;
1029
+ }
1030
+
1031
+ export interface GetLoyaltySegmentMembersQuery {
1032
+ // Max items to return
1033
+ limit?: number;
1034
+ // Opaque cursor from previous response
1035
+ cursor?: string;
1036
+ }
1037
+
1038
+ export type GetLoyaltySegmentMembersResponse = SegmentMembersListResponseDto;
1039
+
1040
+ // POST /loyalty/segments/{id}/members - Add members to a segment
1041
+
1042
+ export interface PostLoyaltySegmentMembersPath {
1043
+ id: string;
1044
+ }
1045
+
1046
+ export type PostLoyaltySegmentMembersBody = SegmentMembersDto;
1047
+
1048
+ export type PostLoyaltySegmentMembersResponse = AddSegmentMembersResponseDto;
1049
+
1050
+ // DELETE /loyalty/segments/{id}/members - Remove members from a segment
1051
+
1052
+ export interface DeleteLoyaltySegmentMembersPath {
1053
+ id: string;
1054
+ }
1055
+
1056
+ export type DeleteLoyaltySegmentMembersBody = SegmentMembersDto;
1057
+
1058
+ export type DeleteLoyaltySegmentMembersResponse = RemoveSegmentMembersResponseDto;
1059
+
1060
+ // POST /loyalty/redemptions/{id}/rollback - Roll back a redemption and restore the voucher
1061
+
1062
+ export interface PostLoyaltyRedemptionRollbackPath {
1063
+ id: string;
1064
+ }
1065
+
1066
+ export type PostLoyaltyRedemptionRollbackBody = RollbackRedemptionDto;
1067
+
1068
+ export type PostLoyaltyRedemptionRollbackResponse = RedemptionResponseDto;
1069
+
1070
+ // GET /loyalty/rewards - List rewards with filters and pagination
1071
+
1072
+ export interface GetLoyaltyRewardsQuery {
1073
+ // Max items to return
1074
+ limit?: number;
1075
+ // Opaque cursor from previous response
1076
+ cursor?: string;
1077
+ realm?: 'boost' | 'thrive';
1078
+ status?: 'active' | 'paused' | 'archived';
1079
+ }
1080
+
1081
+ export type GetLoyaltyRewardsResponse = RewardListResponseDto;
1082
+
1083
+ // POST /loyalty/rewards - Create a reward with earning rules and milestones
1084
+
1085
+ export type PostLoyaltyRewardBody = CreateRewardDto;
1086
+
1087
+ export type PostLoyaltyRewardResponse = RewardDetailResponseDto;
1088
+
1089
+ // GET /loyalty/rewards/{id} - Get reward detail with earning rules and milestones
1090
+
1091
+ export interface GetLoyaltyRewardPath {
1092
+ id: string;
1093
+ }
1094
+
1095
+ export type GetLoyaltyRewardResponse = RewardDetailResponseDto;
1096
+
1097
+ // PUT /loyalty/rewards/{id} - Update a reward and replace its earning rules and milestones
1098
+
1099
+ export interface PutLoyaltyRewardPath {
1100
+ id: string;
1101
+ }
1102
+
1103
+ export type PutLoyaltyRewardBody = UpdateRewardDto;
1104
+
1105
+ export type PutLoyaltyRewardResponse = RewardDetailResponseDto;
1106
+
1107
+ // PATCH /loyalty/rewards/{id}/status - Transition reward status
1108
+
1109
+ export interface PatchLoyaltyRewardStatusPath {
1110
+ id: string;
1111
+ }
1112
+
1113
+ export type PatchLoyaltyRewardStatusBody = UpdateRewardStatusDto;
1114
+
1115
+ export type PatchLoyaltyRewardStatusResponse = RewardDetailResponseDto;
1116
+
1117
+ // GET /loyalty/rewards/{id}/cards - List enrolled customer cards for a reward
1118
+
1119
+ export interface GetLoyaltyRewardCardsPath {
1120
+ id: string;
1121
+ }
1122
+
1123
+ export interface GetLoyaltyRewardCardsQuery {
1124
+ // Max items to return
1125
+ limit?: number;
1126
+ // Opaque cursor from previous response
1127
+ cursor?: string;
1128
+ }
1129
+
1130
+ export type GetLoyaltyRewardCardsResponse = RewardCardListResponseDto;
1131
+
1132
+ // GET /loyalty/rewards/{id}/cards/{customerId} - Get card detail with transaction event history
1133
+
1134
+ export interface GetLoyaltyRewardCardPath {
1135
+ id: string;
1136
+ customerId: string;
1137
+ }
1138
+
1139
+ export type GetLoyaltyRewardCardResponse = RewardCardDetailResponseDto;
1140
+
1141
+ // POST /loyalty/rewards/cards/{cardId}/adjust - Manual point adjustment on a reward card
1142
+
1143
+ export interface PostLoyaltyRewardCardAdjustPath {
1144
+ cardId: string;
1145
+ }
1146
+
1147
+ export type PostLoyaltyRewardCardAdjustBody = AdjustPointsDto;
1148
+
1149
+ export type PostLoyaltyRewardCardAdjustResponse = RewardCardDetailResponseDto;
1150
+
1151
+ // POST /loyalty/rewards/orders/earn - Evaluate an order against active reward rules and award points idempotently
1152
+
1153
+ export type PostLoyaltyRewardOrderEarnBody = EarnOrderDto;
1154
+
1155
+ export type PostLoyaltyRewardOrderEarnResponse = EarnOrderResponseDto;