@compassdigital/sdk.typescript 4.963.0 → 4.965.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.
- package/lib/index.d.ts +58 -58
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +69 -69
- package/lib/index.js.map +1 -1
- package/lib/interface/loyalty.d.ts +120 -120
- package/lib/interface/loyalty.d.ts.map +1 -1
- package/lib/messages/events/CampaignPublishedEvent.d.ts +77 -0
- package/lib/messages/events/CampaignPublishedEvent.d.ts.map +1 -0
- package/lib/messages/events/CampaignPublishedEvent.js +4 -0
- package/lib/messages/events/CampaignPublishedEvent.js.map +1 -0
- package/lib/messages/events/RewardCampaignPublishedEvent.d.ts +103 -1
- package/lib/messages/events/RewardCampaignPublishedEvent.d.ts.map +1 -1
- package/lib/messages/events/RewardCreatedEvent.d.ts +20 -1
- package/lib/messages/events/RewardCreatedEvent.d.ts.map +1 -1
- package/lib/messages/events/RewardPublishedEvent.d.ts +49 -0
- package/lib/messages/events/RewardPublishedEvent.d.ts.map +1 -0
- package/lib/messages/events/RewardPublishedEvent.js +4 -0
- package/lib/messages/events/RewardPublishedEvent.js.map +1 -0
- package/lib/messages/events/RewardRedeemedEvent.d.ts +16 -1
- package/lib/messages/events/RewardRedeemedEvent.d.ts.map +1 -1
- package/lib/messages/events/VoucherCreatedEvent.d.ts +30 -0
- package/lib/messages/events/VoucherCreatedEvent.d.ts.map +1 -0
- package/lib/messages/events/VoucherCreatedEvent.js +4 -0
- package/lib/messages/events/VoucherCreatedEvent.js.map +1 -0
- package/lib/messages/events/index.d.ts +3 -0
- package/lib/messages/events/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/index.ts +168 -168
- package/src/interface/loyalty.ts +188 -188
- package/src/messages/events/CampaignPublishedEvent.ts +95 -0
- package/src/messages/events/RewardCampaignPublishedEvent.ts +136 -1
- package/src/messages/events/RewardCreatedEvent.ts +31 -1
- package/src/messages/events/RewardPublishedEvent.ts +70 -0
- package/src/messages/events/RewardRedeemedEvent.ts +30 -1
- package/src/messages/events/VoucherCreatedEvent.ts +43 -0
- package/src/messages/events/index.ts +6 -0
package/src/interface/loyalty.ts
CHANGED
|
@@ -648,102 +648,6 @@ export interface VoucherOperationResponseDto {
|
|
|
648
648
|
voucher?: VoucherRedemptionVoucherDto;
|
|
649
649
|
}
|
|
650
650
|
|
|
651
|
-
export interface SegmentRuleDto {
|
|
652
|
-
// Attribute key to evaluate (e.g. points_balance, enrollment_date)
|
|
653
|
-
attribute: string;
|
|
654
|
-
// Operator key (eq, neq, gt, gte, lt, lte)
|
|
655
|
-
operator: string;
|
|
656
|
-
// Value to compare against
|
|
657
|
-
value: string;
|
|
658
|
-
}
|
|
659
|
-
|
|
660
|
-
export interface SegmentResponseDto {
|
|
661
|
-
id: string;
|
|
662
|
-
createdAt: string;
|
|
663
|
-
updatedAt: string;
|
|
664
|
-
deletedAt?: string | null;
|
|
665
|
-
createdBy: string;
|
|
666
|
-
// Sector the segment is scoped to (location-service sector name, e.g. Eurest)
|
|
667
|
-
sector: string;
|
|
668
|
-
country: 'CA' | 'US';
|
|
669
|
-
name: string;
|
|
670
|
-
description?: string | null;
|
|
671
|
-
type: 'static_list' | 'attribute_rule';
|
|
672
|
-
ownership: 'system' | 'custom';
|
|
673
|
-
editable: boolean;
|
|
674
|
-
deletable: boolean;
|
|
675
|
-
ruleJson?: SegmentRuleDto;
|
|
676
|
-
memberCount?: number;
|
|
677
|
-
}
|
|
678
|
-
|
|
679
|
-
export interface SegmentPaginationDto {
|
|
680
|
-
cursor?: string | null;
|
|
681
|
-
hasMore: boolean;
|
|
682
|
-
limit: number;
|
|
683
|
-
}
|
|
684
|
-
|
|
685
|
-
export interface SegmentListResponseDto {
|
|
686
|
-
data: SegmentResponseDto[];
|
|
687
|
-
pagination: SegmentPaginationDto;
|
|
688
|
-
}
|
|
689
|
-
|
|
690
|
-
export interface SegmentAttributeResponseDto {
|
|
691
|
-
key: string;
|
|
692
|
-
label: string;
|
|
693
|
-
}
|
|
694
|
-
|
|
695
|
-
export interface SegmentPreviewCountResponseDto {
|
|
696
|
-
count: number;
|
|
697
|
-
}
|
|
698
|
-
|
|
699
|
-
export interface CreateSegmentDto {
|
|
700
|
-
// Sector the segment is scoped to (location-service sector name, e.g. Eurest)
|
|
701
|
-
sector: string;
|
|
702
|
-
country: 'CA' | 'US';
|
|
703
|
-
name: string;
|
|
704
|
-
description?: string;
|
|
705
|
-
type: 'static_list' | 'attribute_rule';
|
|
706
|
-
// Required when type = attribute_rule
|
|
707
|
-
ruleJson?: SegmentRuleDto;
|
|
708
|
-
// Initial members for static_list segments
|
|
709
|
-
customerIds?: string[];
|
|
710
|
-
}
|
|
711
|
-
|
|
712
|
-
export interface UpdateSegmentDto {
|
|
713
|
-
name?: string;
|
|
714
|
-
description?: string;
|
|
715
|
-
ruleJson?: SegmentRuleDto;
|
|
716
|
-
}
|
|
717
|
-
|
|
718
|
-
export interface SegmentMemberResponseDto {
|
|
719
|
-
customerId: string;
|
|
720
|
-
addedAt: string;
|
|
721
|
-
addedBy: string;
|
|
722
|
-
}
|
|
723
|
-
|
|
724
|
-
export interface SegmentMembersListResponseDto {
|
|
725
|
-
data: SegmentMemberResponseDto[];
|
|
726
|
-
pagination: SegmentPaginationDto;
|
|
727
|
-
}
|
|
728
|
-
|
|
729
|
-
export interface SegmentMembersDto {
|
|
730
|
-
// List of customer IDs
|
|
731
|
-
customerIds: string[];
|
|
732
|
-
}
|
|
733
|
-
|
|
734
|
-
export interface AddSegmentMembersResponseDto {
|
|
735
|
-
added: number;
|
|
736
|
-
}
|
|
737
|
-
|
|
738
|
-
export interface RemoveSegmentMembersResponseDto {
|
|
739
|
-
removed: number;
|
|
740
|
-
}
|
|
741
|
-
|
|
742
|
-
export interface RollbackRedemptionDto {
|
|
743
|
-
// Reason for rolling back the redemption
|
|
744
|
-
reason: string;
|
|
745
|
-
}
|
|
746
|
-
|
|
747
651
|
export interface RewardResponseDto {
|
|
748
652
|
id: string;
|
|
749
653
|
createdAt: string;
|
|
@@ -939,6 +843,102 @@ export interface EarnPointsFromOrderResponseDto {
|
|
|
939
843
|
issuedVoucherCodes: string[];
|
|
940
844
|
}
|
|
941
845
|
|
|
846
|
+
export interface SegmentRuleDto {
|
|
847
|
+
// Attribute key to evaluate (e.g. points_balance, enrollment_date)
|
|
848
|
+
attribute: string;
|
|
849
|
+
// Operator key (eq, neq, gt, gte, lt, lte)
|
|
850
|
+
operator: string;
|
|
851
|
+
// Value to compare against
|
|
852
|
+
value: string;
|
|
853
|
+
}
|
|
854
|
+
|
|
855
|
+
export interface SegmentResponseDto {
|
|
856
|
+
id: string;
|
|
857
|
+
createdAt: string;
|
|
858
|
+
updatedAt: string;
|
|
859
|
+
deletedAt?: string | null;
|
|
860
|
+
createdBy: string;
|
|
861
|
+
// Sector the segment is scoped to (location-service sector name, e.g. Eurest)
|
|
862
|
+
sector: string;
|
|
863
|
+
country: 'CA' | 'US';
|
|
864
|
+
name: string;
|
|
865
|
+
description?: string | null;
|
|
866
|
+
type: 'static_list' | 'attribute_rule';
|
|
867
|
+
ownership: 'system' | 'custom';
|
|
868
|
+
editable: boolean;
|
|
869
|
+
deletable: boolean;
|
|
870
|
+
ruleJson?: SegmentRuleDto;
|
|
871
|
+
memberCount?: number;
|
|
872
|
+
}
|
|
873
|
+
|
|
874
|
+
export interface SegmentPaginationDto {
|
|
875
|
+
cursor?: string | null;
|
|
876
|
+
hasMore: boolean;
|
|
877
|
+
limit: number;
|
|
878
|
+
}
|
|
879
|
+
|
|
880
|
+
export interface SegmentListResponseDto {
|
|
881
|
+
data: SegmentResponseDto[];
|
|
882
|
+
pagination: SegmentPaginationDto;
|
|
883
|
+
}
|
|
884
|
+
|
|
885
|
+
export interface SegmentAttributeResponseDto {
|
|
886
|
+
key: string;
|
|
887
|
+
label: string;
|
|
888
|
+
}
|
|
889
|
+
|
|
890
|
+
export interface SegmentPreviewCountResponseDto {
|
|
891
|
+
count: number;
|
|
892
|
+
}
|
|
893
|
+
|
|
894
|
+
export interface CreateSegmentDto {
|
|
895
|
+
// Sector the segment is scoped to (location-service sector name, e.g. Eurest)
|
|
896
|
+
sector: string;
|
|
897
|
+
country: 'CA' | 'US';
|
|
898
|
+
name: string;
|
|
899
|
+
description?: string;
|
|
900
|
+
type: 'static_list' | 'attribute_rule';
|
|
901
|
+
// Required when type = attribute_rule
|
|
902
|
+
ruleJson?: SegmentRuleDto;
|
|
903
|
+
// Initial members for static_list segments
|
|
904
|
+
customerIds?: string[];
|
|
905
|
+
}
|
|
906
|
+
|
|
907
|
+
export interface UpdateSegmentDto {
|
|
908
|
+
name?: string;
|
|
909
|
+
description?: string;
|
|
910
|
+
ruleJson?: SegmentRuleDto;
|
|
911
|
+
}
|
|
912
|
+
|
|
913
|
+
export interface SegmentMemberResponseDto {
|
|
914
|
+
customerId: string;
|
|
915
|
+
addedAt: string;
|
|
916
|
+
addedBy: string;
|
|
917
|
+
}
|
|
918
|
+
|
|
919
|
+
export interface SegmentMembersListResponseDto {
|
|
920
|
+
data: SegmentMemberResponseDto[];
|
|
921
|
+
pagination: SegmentPaginationDto;
|
|
922
|
+
}
|
|
923
|
+
|
|
924
|
+
export interface SegmentMembersDto {
|
|
925
|
+
// List of customer IDs
|
|
926
|
+
customerIds: string[];
|
|
927
|
+
}
|
|
928
|
+
|
|
929
|
+
export interface AddSegmentMembersResponseDto {
|
|
930
|
+
added: number;
|
|
931
|
+
}
|
|
932
|
+
|
|
933
|
+
export interface RemoveSegmentMembersResponseDto {
|
|
934
|
+
removed: number;
|
|
935
|
+
}
|
|
936
|
+
|
|
937
|
+
export interface RollbackRedemptionDto {
|
|
938
|
+
// Reason for rolling back the redemption
|
|
939
|
+
reason: string;
|
|
940
|
+
}
|
|
941
|
+
|
|
942
942
|
// GET /loyalty/bundles - List bundles with optional filters
|
|
943
943
|
|
|
944
944
|
export interface GetLoyaltyBundlesQuery {
|
|
@@ -1195,202 +1195,202 @@ export type PostLoyaltyVouchersRedeemBody = VoucherOperationDto;
|
|
|
1195
1195
|
|
|
1196
1196
|
export type PostLoyaltyVouchersRedeemResponse = VoucherOperationResponseDto;
|
|
1197
1197
|
|
|
1198
|
-
// GET /loyalty/
|
|
1198
|
+
// GET /loyalty/rewards - List rewards with filters and pagination
|
|
1199
1199
|
|
|
1200
|
-
export interface
|
|
1200
|
+
export interface GetLoyaltyRewardsQuery {
|
|
1201
1201
|
// Max items to return
|
|
1202
1202
|
limit?: number;
|
|
1203
1203
|
// Opaque cursor from previous response
|
|
1204
1204
|
cursor?: string;
|
|
1205
|
+
// Case-insensitive partial match across reward text fields
|
|
1206
|
+
query?: string;
|
|
1205
1207
|
// Filter by sector (location-service sector name, e.g. Eurest)
|
|
1206
1208
|
sector?: string;
|
|
1207
1209
|
country?: 'CA' | 'US';
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
//
|
|
1211
|
-
|
|
1210
|
+
// Only rewards that earn at this site: rewards with no associations plus rewards associated with the site
|
|
1211
|
+
siteId?: string;
|
|
1212
|
+
// Exact milestone-linked campaign match
|
|
1213
|
+
campaignId?: string;
|
|
1214
|
+
status?: 'active' | 'paused' | 'archived';
|
|
1212
1215
|
}
|
|
1213
1216
|
|
|
1214
|
-
export type
|
|
1215
|
-
|
|
1216
|
-
// POST /loyalty/segments - Create a new segment
|
|
1217
|
-
|
|
1218
|
-
export type PostLoyaltySegmentBody = CreateSegmentDto;
|
|
1219
|
-
|
|
1220
|
-
export type PostLoyaltySegmentResponse = SegmentResponseDto;
|
|
1221
|
-
|
|
1222
|
-
// GET /loyalty/segments/attributes - List available attributes for rule-based segments
|
|
1223
|
-
|
|
1224
|
-
export type GetLoyaltySegmentAttributesResponse = SegmentAttributeResponseDto[];
|
|
1217
|
+
export type GetLoyaltyRewardsResponse = RewardListResponseDto;
|
|
1225
1218
|
|
|
1226
|
-
// POST /loyalty/
|
|
1219
|
+
// POST /loyalty/rewards - Create a reward with earning rules and milestones
|
|
1227
1220
|
|
|
1228
|
-
export type
|
|
1221
|
+
export type PostLoyaltyRewardBody = CreateRewardDto;
|
|
1229
1222
|
|
|
1230
|
-
export type
|
|
1223
|
+
export type PostLoyaltyRewardResponse = RewardDetailResponseDto;
|
|
1231
1224
|
|
|
1232
|
-
// GET /loyalty/
|
|
1225
|
+
// GET /loyalty/rewards/{id} - Get reward detail with earning rules and milestones
|
|
1233
1226
|
|
|
1234
|
-
export interface
|
|
1227
|
+
export interface GetLoyaltyRewardPath {
|
|
1235
1228
|
id: string;
|
|
1236
1229
|
}
|
|
1237
1230
|
|
|
1238
|
-
export type
|
|
1231
|
+
export type GetLoyaltyRewardResponse = RewardDetailResponseDto;
|
|
1239
1232
|
|
|
1240
|
-
//
|
|
1233
|
+
// PUT /loyalty/rewards/{id} - Update a reward and replace its earning rules and milestones
|
|
1241
1234
|
|
|
1242
|
-
export interface
|
|
1235
|
+
export interface PutLoyaltyRewardPath {
|
|
1243
1236
|
id: string;
|
|
1244
1237
|
}
|
|
1245
1238
|
|
|
1246
|
-
export type
|
|
1239
|
+
export type PutLoyaltyRewardBody = UpdateRewardDto;
|
|
1247
1240
|
|
|
1248
|
-
export type
|
|
1241
|
+
export type PutLoyaltyRewardResponse = RewardDetailResponseDto;
|
|
1249
1242
|
|
|
1250
|
-
//
|
|
1243
|
+
// PATCH /loyalty/rewards/{id}/status - Transition reward status
|
|
1251
1244
|
|
|
1252
|
-
export interface
|
|
1245
|
+
export interface PatchLoyaltyRewardStatusPath {
|
|
1253
1246
|
id: string;
|
|
1254
1247
|
}
|
|
1255
1248
|
|
|
1256
|
-
export type
|
|
1249
|
+
export type PatchLoyaltyRewardStatusBody = UpdateRewardStatusDto;
|
|
1257
1250
|
|
|
1258
|
-
|
|
1251
|
+
export type PatchLoyaltyRewardStatusResponse = RewardDetailResponseDto;
|
|
1259
1252
|
|
|
1260
|
-
|
|
1253
|
+
// GET /loyalty/rewards/{id}/cards - List enrolled customer cards for a reward
|
|
1254
|
+
|
|
1255
|
+
export interface GetLoyaltyRewardCardsPath {
|
|
1261
1256
|
id: string;
|
|
1262
1257
|
}
|
|
1263
1258
|
|
|
1264
|
-
export interface
|
|
1259
|
+
export interface GetLoyaltyRewardCardsQuery {
|
|
1265
1260
|
// Max items to return
|
|
1266
1261
|
limit?: number;
|
|
1267
1262
|
// Opaque cursor from previous response
|
|
1268
1263
|
cursor?: string;
|
|
1269
1264
|
}
|
|
1270
1265
|
|
|
1271
|
-
export type
|
|
1266
|
+
export type GetLoyaltyRewardCardsResponse = RewardCardListResponseDto;
|
|
1272
1267
|
|
|
1273
|
-
//
|
|
1268
|
+
// GET /loyalty/rewards/{id}/cards/{customerId} - Get card detail with transaction event history
|
|
1274
1269
|
|
|
1275
|
-
export interface
|
|
1270
|
+
export interface GetLoyaltyRewardCardPath {
|
|
1276
1271
|
id: string;
|
|
1272
|
+
customerId: string;
|
|
1277
1273
|
}
|
|
1278
1274
|
|
|
1279
|
-
export type
|
|
1280
|
-
|
|
1281
|
-
export type PostLoyaltySegmentMembersResponse = AddSegmentMembersResponseDto;
|
|
1275
|
+
export type GetLoyaltyRewardCardResponse = RewardCardDetailResponseDto;
|
|
1282
1276
|
|
|
1283
|
-
//
|
|
1277
|
+
// POST /loyalty/rewards/cards/{cardId}/adjust - Manual point adjustment on a reward card
|
|
1284
1278
|
|
|
1285
|
-
export interface
|
|
1286
|
-
|
|
1279
|
+
export interface PostLoyaltyRewardCardAdjustPath {
|
|
1280
|
+
cardId: string;
|
|
1287
1281
|
}
|
|
1288
1282
|
|
|
1289
|
-
export type
|
|
1290
|
-
|
|
1291
|
-
export type DeleteLoyaltySegmentMembersResponse = RemoveSegmentMembersResponseDto;
|
|
1283
|
+
export type PostLoyaltyRewardCardAdjustBody = AdjustPointsDto;
|
|
1292
1284
|
|
|
1293
|
-
|
|
1285
|
+
export type PostLoyaltyRewardCardAdjustResponse = RewardCardDetailResponseDto;
|
|
1294
1286
|
|
|
1295
|
-
|
|
1296
|
-
id: string;
|
|
1297
|
-
}
|
|
1287
|
+
// POST /loyalty/rewards/orders/earn - Evaluate an order against active reward rules and award points idempotently
|
|
1298
1288
|
|
|
1299
|
-
export type
|
|
1289
|
+
export type PostLoyaltyRewardOrderEarnBody = EarnPointsFromOrderDto;
|
|
1300
1290
|
|
|
1301
|
-
export type
|
|
1291
|
+
export type PostLoyaltyRewardOrderEarnResponse = EarnPointsFromOrderResponseDto;
|
|
1302
1292
|
|
|
1303
|
-
// GET /loyalty/
|
|
1293
|
+
// GET /loyalty/segments - List segments with optional filters
|
|
1304
1294
|
|
|
1305
|
-
export interface
|
|
1295
|
+
export interface GetLoyaltySegmentsQuery {
|
|
1306
1296
|
// Max items to return
|
|
1307
1297
|
limit?: number;
|
|
1308
1298
|
// Opaque cursor from previous response
|
|
1309
1299
|
cursor?: string;
|
|
1310
|
-
// Case-insensitive partial match across reward text fields
|
|
1311
|
-
query?: string;
|
|
1312
1300
|
// Filter by sector (location-service sector name, e.g. Eurest)
|
|
1313
1301
|
sector?: string;
|
|
1314
1302
|
country?: 'CA' | 'US';
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
//
|
|
1318
|
-
|
|
1319
|
-
status?: 'active' | 'paused' | 'archived';
|
|
1303
|
+
type?: 'static_list' | 'attribute_rule';
|
|
1304
|
+
ownership?: 'system' | 'custom';
|
|
1305
|
+
// Case-insensitive partial name match
|
|
1306
|
+
name?: string;
|
|
1320
1307
|
}
|
|
1321
1308
|
|
|
1322
|
-
export type
|
|
1309
|
+
export type GetLoyaltySegmentsResponse = SegmentListResponseDto;
|
|
1323
1310
|
|
|
1324
|
-
// POST /loyalty/
|
|
1311
|
+
// POST /loyalty/segments - Create a new segment
|
|
1325
1312
|
|
|
1326
|
-
export type
|
|
1313
|
+
export type PostLoyaltySegmentBody = CreateSegmentDto;
|
|
1327
1314
|
|
|
1328
|
-
export type
|
|
1315
|
+
export type PostLoyaltySegmentResponse = SegmentResponseDto;
|
|
1329
1316
|
|
|
1330
|
-
// GET /loyalty/
|
|
1317
|
+
// GET /loyalty/segments/attributes - List available attributes for rule-based segments
|
|
1331
1318
|
|
|
1332
|
-
export
|
|
1319
|
+
export type GetLoyaltySegmentAttributesResponse = SegmentAttributeResponseDto[];
|
|
1320
|
+
|
|
1321
|
+
// POST /loyalty/segments/preview-count - Preview how many customers match a segment rule
|
|
1322
|
+
|
|
1323
|
+
export type PostLoyaltySegmentPreviewCountBody = SegmentRuleDto;
|
|
1324
|
+
|
|
1325
|
+
export type PostLoyaltySegmentPreviewCountResponse = SegmentPreviewCountResponseDto;
|
|
1326
|
+
|
|
1327
|
+
// GET /loyalty/segments/{id} - Get segment by ID
|
|
1328
|
+
|
|
1329
|
+
export interface GetLoyaltySegmentPath {
|
|
1333
1330
|
id: string;
|
|
1334
1331
|
}
|
|
1335
1332
|
|
|
1336
|
-
export type
|
|
1333
|
+
export type GetLoyaltySegmentResponse = SegmentResponseDto;
|
|
1337
1334
|
|
|
1338
|
-
//
|
|
1335
|
+
// PATCH /loyalty/segments/{id} - Update a segment
|
|
1339
1336
|
|
|
1340
|
-
export interface
|
|
1337
|
+
export interface PatchLoyaltySegmentPath {
|
|
1341
1338
|
id: string;
|
|
1342
1339
|
}
|
|
1343
1340
|
|
|
1344
|
-
export type
|
|
1341
|
+
export type PatchLoyaltySegmentBody = UpdateSegmentDto;
|
|
1345
1342
|
|
|
1346
|
-
export type
|
|
1343
|
+
export type PatchLoyaltySegmentResponse = SegmentResponseDto;
|
|
1347
1344
|
|
|
1348
|
-
//
|
|
1345
|
+
// DELETE /loyalty/segments/{id} - Soft-delete a segment
|
|
1349
1346
|
|
|
1350
|
-
export interface
|
|
1347
|
+
export interface DeleteLoyaltySegmentPath {
|
|
1351
1348
|
id: string;
|
|
1352
1349
|
}
|
|
1353
1350
|
|
|
1354
|
-
export type
|
|
1355
|
-
|
|
1356
|
-
export type PatchLoyaltyRewardStatusResponse = RewardDetailResponseDto;
|
|
1351
|
+
export type DeleteLoyaltySegmentResponse = {};
|
|
1357
1352
|
|
|
1358
|
-
// GET /loyalty/
|
|
1353
|
+
// GET /loyalty/segments/{id}/members - List members of a static_list segment
|
|
1359
1354
|
|
|
1360
|
-
export interface
|
|
1355
|
+
export interface GetLoyaltySegmentMembersPath {
|
|
1361
1356
|
id: string;
|
|
1362
1357
|
}
|
|
1363
1358
|
|
|
1364
|
-
export interface
|
|
1359
|
+
export interface GetLoyaltySegmentMembersQuery {
|
|
1365
1360
|
// Max items to return
|
|
1366
1361
|
limit?: number;
|
|
1367
1362
|
// Opaque cursor from previous response
|
|
1368
1363
|
cursor?: string;
|
|
1369
1364
|
}
|
|
1370
1365
|
|
|
1371
|
-
export type
|
|
1366
|
+
export type GetLoyaltySegmentMembersResponse = SegmentMembersListResponseDto;
|
|
1372
1367
|
|
|
1373
|
-
//
|
|
1368
|
+
// POST /loyalty/segments/{id}/members - Add members to a segment
|
|
1374
1369
|
|
|
1375
|
-
export interface
|
|
1370
|
+
export interface PostLoyaltySegmentMembersPath {
|
|
1376
1371
|
id: string;
|
|
1377
|
-
customerId: string;
|
|
1378
1372
|
}
|
|
1379
1373
|
|
|
1380
|
-
export type
|
|
1374
|
+
export type PostLoyaltySegmentMembersBody = SegmentMembersDto;
|
|
1381
1375
|
|
|
1382
|
-
|
|
1376
|
+
export type PostLoyaltySegmentMembersResponse = AddSegmentMembersResponseDto;
|
|
1383
1377
|
|
|
1384
|
-
|
|
1385
|
-
|
|
1378
|
+
// DELETE /loyalty/segments/{id}/members - Remove members from a segment
|
|
1379
|
+
|
|
1380
|
+
export interface DeleteLoyaltySegmentMembersPath {
|
|
1381
|
+
id: string;
|
|
1386
1382
|
}
|
|
1387
1383
|
|
|
1388
|
-
export type
|
|
1384
|
+
export type DeleteLoyaltySegmentMembersBody = SegmentMembersDto;
|
|
1389
1385
|
|
|
1390
|
-
export type
|
|
1386
|
+
export type DeleteLoyaltySegmentMembersResponse = RemoveSegmentMembersResponseDto;
|
|
1391
1387
|
|
|
1392
|
-
// POST /loyalty/
|
|
1388
|
+
// POST /loyalty/redemptions/{id}/rollback - Roll back a redemption and restore the voucher
|
|
1393
1389
|
|
|
1394
|
-
export
|
|
1390
|
+
export interface PostLoyaltyRedemptionRollbackPath {
|
|
1391
|
+
id: string;
|
|
1392
|
+
}
|
|
1395
1393
|
|
|
1396
|
-
export type
|
|
1394
|
+
export type PostLoyaltyRedemptionRollbackBody = RollbackRedemptionDto;
|
|
1395
|
+
|
|
1396
|
+
export type PostLoyaltyRedemptionRollbackResponse = RedemptionResponseDto;
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
// THIS FILE IS AUTOMATICALLY GENERATED, DO NOT MODIFY
|
|
2
|
+
|
|
3
|
+
export interface CampaignPublishedEvent {
|
|
4
|
+
id: string;
|
|
5
|
+
type: 'CampaignPublishedEvent';
|
|
6
|
+
version: '0.0.1';
|
|
7
|
+
timestamp: string;
|
|
8
|
+
traceContext: {
|
|
9
|
+
// W3C traceparent, injected by MessageBus from the active trace context
|
|
10
|
+
traceparent?: string;
|
|
11
|
+
};
|
|
12
|
+
source: string;
|
|
13
|
+
// Owning domain, optionally dotted for subdomains. Names the Kafka topic; absent keeps the superseded naming.
|
|
14
|
+
domain?: string;
|
|
15
|
+
// Whether other domains may integrate against this message. Absent means private.
|
|
16
|
+
visibility?: 'public' | 'private';
|
|
17
|
+
// The whole loyalty campaign as stored, at the time it was published.
|
|
18
|
+
payload: {
|
|
19
|
+
// Loyalty campaign id.
|
|
20
|
+
campaignId: string;
|
|
21
|
+
name: string;
|
|
22
|
+
description?: string;
|
|
23
|
+
type: 'promo_code' | 'auto_apply';
|
|
24
|
+
status: 'draft' | 'active' | 'paused' | 'expired' | 'archived';
|
|
25
|
+
discountType: 'AMOUNT_OFF' | 'PERCENT_OFF' | 'FREE_ITEM';
|
|
26
|
+
discountScope: 'order' | 'items';
|
|
27
|
+
// AMOUNT_OFF only, minor units.
|
|
28
|
+
discountValueCents?: number;
|
|
29
|
+
// PERCENT_OFF only.
|
|
30
|
+
discountPercent?: number;
|
|
31
|
+
appliesToCheapest?: boolean;
|
|
32
|
+
maxDiscountCents?: number;
|
|
33
|
+
codeType: 'open' | 'personal' | 'auto_applied';
|
|
34
|
+
// ISO 8601 with Z or an offset. Omitted when unknown, never null.
|
|
35
|
+
startDate?: string;
|
|
36
|
+
// ISO 8601 with Z or an offset. Omitted when unknown, never null.
|
|
37
|
+
endDate?: string;
|
|
38
|
+
maxRedemptions?: number;
|
|
39
|
+
maxRedemptionsPerCustomer?: number;
|
|
40
|
+
maxRedemptionsDaily?: number;
|
|
41
|
+
maxRedemptionsPerCustomerDaily?: number;
|
|
42
|
+
minOrderValueCents?: number;
|
|
43
|
+
maxOrderValueCents?: number;
|
|
44
|
+
bundleId?: string;
|
|
45
|
+
// Location-service sector name, e.g. Eurest.
|
|
46
|
+
sector: string;
|
|
47
|
+
country: 'US' | 'CA';
|
|
48
|
+
// Origin systems the campaign applies to, e.g. thrive.
|
|
49
|
+
originSystems?: ('boost' | 'thrive' | 'volante' | 'genius' | 'agilysys')[];
|
|
50
|
+
dailySchedule?: {
|
|
51
|
+
dayOfWeek: 'mon' | 'tue' | 'wed' | 'thu' | 'fri' | 'sat' | 'sun';
|
|
52
|
+
active: boolean;
|
|
53
|
+
// HH:MM
|
|
54
|
+
startTime: string;
|
|
55
|
+
// HH:MM
|
|
56
|
+
endTime: string;
|
|
57
|
+
}[];
|
|
58
|
+
eligibility?: {
|
|
59
|
+
eligibilityType: 'everyone' | 'meal_plan' | 'badge_pay' | 'segment';
|
|
60
|
+
segmentId?: string;
|
|
61
|
+
maxRedemptionsPerCustomer?: number;
|
|
62
|
+
maxRedemptionsPerCustomerDaily?: number;
|
|
63
|
+
}[];
|
|
64
|
+
// Sites where the campaign redeems.
|
|
65
|
+
siteScopes?: {
|
|
66
|
+
siteId: string;
|
|
67
|
+
}[];
|
|
68
|
+
// Stations where the campaign redeems.
|
|
69
|
+
stationScopes?: {
|
|
70
|
+
siteId: string;
|
|
71
|
+
stationId: string;
|
|
72
|
+
}[];
|
|
73
|
+
itemTargets?: {
|
|
74
|
+
siteId?: string;
|
|
75
|
+
stationId?: string;
|
|
76
|
+
menuId?: string;
|
|
77
|
+
categoryId?: string;
|
|
78
|
+
itemId?: string;
|
|
79
|
+
maxDiscountCents?: number;
|
|
80
|
+
siteName?: string;
|
|
81
|
+
stationName?: string;
|
|
82
|
+
menuName?: string;
|
|
83
|
+
categoryName?: string;
|
|
84
|
+
itemName?: string;
|
|
85
|
+
}[];
|
|
86
|
+
salesChannels?: string[];
|
|
87
|
+
paymentRestrictions?: string[];
|
|
88
|
+
// ISO 8601 with Z or an offset. Omitted when unknown, never null.
|
|
89
|
+
createdAt?: string;
|
|
90
|
+
// ISO 8601 with Z or an offset. Omitted when unknown, never null.
|
|
91
|
+
updatedAt?: string;
|
|
92
|
+
createdBy?: string;
|
|
93
|
+
updatedBy?: string;
|
|
94
|
+
};
|
|
95
|
+
}
|