@be-link/ecommerce-promotion-service-node-sdk 0.0.1

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,126 @@
1
+ import { ENUM } from '../../enum';
2
+ export declare namespace Service {
3
+ namespace Entity {
4
+ /** 奖品信息 */
5
+ interface PrizeInfo {
6
+ /** 奖品ID */
7
+ id: string;
8
+ /** 奖品名称 */
9
+ name?: string;
10
+ /** 奖品类型 */
11
+ type?: string;
12
+ /** 奖品数量 */
13
+ quantity?: number;
14
+ /** 其他扩展信息 */
15
+ [key: string]: any;
16
+ }
17
+ /** 奖品发放记录 */
18
+ interface PrizeDistributionRecord {
19
+ /** ID */
20
+ id: string;
21
+ /** 创建时间 */
22
+ createdAt: number;
23
+ /** 更新时间 */
24
+ updatedAt: number;
25
+ /** 删除时间 */
26
+ deletedAt: number;
27
+ /** 直播间ID */
28
+ liveRoomId: string;
29
+ /** 用户ID */
30
+ userId: string;
31
+ /** 发放渠道 */
32
+ getChannel: ENUM.AWARD_ENUM.DistributionChannel;
33
+ /** 业务ID(任务ID、订单ID、活动ID) */
34
+ bizId: string;
35
+ /** 奖品信息 */
36
+ prizeInfo: PrizeInfo;
37
+ /** 奖品ID */
38
+ prizeId: string;
39
+ /** 业务编号 */
40
+ bizNo: string;
41
+ /** 发放状态 */
42
+ status: ENUM.AWARD_ENUM.DistributionStatus;
43
+ /** 失败原因 */
44
+ failedReason?: string;
45
+ }
46
+ }
47
+ namespace Request {
48
+ /** 发放奖励 */
49
+ interface distributePrize {
50
+ /** 业务编号 */
51
+ bizNo: string;
52
+ }
53
+ /** 作废奖励 */
54
+ interface reversePrize {
55
+ /** 业务编号 */
56
+ bizNo: string;
57
+ }
58
+ /** 直播间发券 */
59
+ interface liveRoomIssueCoupon {
60
+ /** 直播间ID */
61
+ liveRoomId: string;
62
+ /** 用户ID */
63
+ userId: string;
64
+ /** 优惠券ID */
65
+ couponId: string;
66
+ /** 活动ID(业务ID) */
67
+ activityId: string;
68
+ /** 券数量 */
69
+ quantity?: number;
70
+ /** 业务编号 */
71
+ bizNo: string;
72
+ }
73
+ /** 会员等级积分发放 */
74
+ interface issueMemberPoints {
75
+ /** 用户ID */
76
+ userId: string;
77
+ /** 会员等级ID */
78
+ levelId: string;
79
+ /** 积分数量 */
80
+ points: number;
81
+ /** 业务编号 */
82
+ bizNo: string;
83
+ }
84
+ /** 统计直播间发放数据 */
85
+ interface getLiveRoomDistributionStats {
86
+ /** 直播间ID */
87
+ liveRoomId: string;
88
+ /** 开始时间(时间戳) */
89
+ startTime: number;
90
+ /** 结束时间(时间戳) */
91
+ endTime: number;
92
+ }
93
+ }
94
+ namespace Response {
95
+ /** 分渠道统计数据 */
96
+ interface ChannelStats {
97
+ /** 渠道 */
98
+ channel: ENUM.AWARD_ENUM.DistributionChannel;
99
+ /** 数量 */
100
+ count: number;
101
+ }
102
+ /** 统计直播间发放数据响应 */
103
+ interface getLiveRoomDistributionStats {
104
+ /** 券发放总数量 */
105
+ totalCouponCount: number;
106
+ /** 积分发放总数量 */
107
+ totalPointsCount: number;
108
+ /** 券按渠道统计 */
109
+ couponByChannel: ChannelStats[];
110
+ /** 积分按渠道统计 */
111
+ pointsByChannel: ChannelStats[];
112
+ }
113
+ }
114
+ interface PrizeDistributionController {
115
+ /** 发放奖励 */
116
+ distributePrize(request: Service.Request.distributePrize, req: any): Promise<void>;
117
+ /** 作废奖励 */
118
+ reversePrize(request: Service.Request.reversePrize, req: any): Promise<void>;
119
+ /** 直播间发券 */
120
+ liveRoomIssueCoupon(request: Service.Request.liveRoomIssueCoupon, req: any): Promise<void>;
121
+ /** 会员等级积分发放 */
122
+ issueMemberPoints(request: Service.Request.issueMemberPoints, req: any): Promise<void>;
123
+ /** 统计直播间发放数据 */
124
+ getLiveRoomDistributionStats(request: Service.Request.getLiveRoomDistributionStats, req: any): Promise<Service.Response.getLiveRoomDistributionStats>;
125
+ }
126
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,8 @@
1
+ import { Service } from './types';
2
+ import BaseService from '../BaseService';
3
+ declare class ConfigService extends BaseService implements Service.DemoController {
4
+ protected prefixUrl: string;
5
+ demoFunc(request: Service.Request.demoFunc): Promise<Service.Response.demoFunc>;
6
+ }
7
+ export declare const configService: ConfigService;
8
+ export default configService;
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
9
+ return function (target, key) { decorator(target, key, paramIndex); }
10
+ };
11
+ var __importDefault = (this && this.__importDefault) || function (mod) {
12
+ return (mod && mod.__esModule) ? mod : { "default": mod };
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.configService = void 0;
16
+ const tsoa_1 = require("tsoa");
17
+ const http_1 = require("../../utils/http");
18
+ const BaseService_1 = __importDefault(require("../BaseService"));
19
+ let ConfigService = class ConfigService extends BaseService_1.default {
20
+ constructor() {
21
+ super(...arguments);
22
+ this.prefixUrl = '/config';
23
+ }
24
+ demoFunc(request) {
25
+ return (0, http_1.callApi)(this.getApiUrl(this.demoFunc), request);
26
+ }
27
+ };
28
+ __decorate([
29
+ (0, tsoa_1.OperationId)('示例接口'),
30
+ (0, tsoa_1.Post)('demo-func'),
31
+ __param(0, (0, tsoa_1.Body)())
32
+ ], ConfigService.prototype, "demoFunc", null);
33
+ ConfigService = __decorate([
34
+ (0, tsoa_1.Route)('config'),
35
+ (0, tsoa_1.Tags)('Config')
36
+ ], ConfigService);
37
+ exports.configService = new ConfigService();
38
+ exports.default = exports.configService;
@@ -0,0 +1,17 @@
1
+ export declare namespace Service {
2
+ namespace Entity { }
3
+ namespace Request {
4
+ interface demoFunc {
5
+ /** 参数 */
6
+ demoParam: string;
7
+ }
8
+ }
9
+ namespace Response {
10
+ interface demoFunc {
11
+ }
12
+ }
13
+ interface DemoController {
14
+ /** 示例接口 */
15
+ demoFunc(request: Service.Request.demoFunc, req: any): Promise<Service.Response.demoFunc>;
16
+ }
17
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,13 @@
1
+ import { Service } from './types';
2
+ import BaseService from '../BaseService';
3
+ declare class CouponService extends BaseService implements Service.CouponTemplateController {
4
+ protected prefixUrl: string;
5
+ createCouponTemplate(request: Service.Request.createCouponTemplate): Promise<void>;
6
+ abandonCouponTemplate(request: Service.Request.abandonCouponTemplate): Promise<void>;
7
+ getCouponTemplateList(request: Service.Request.getCouponTemplateList): Promise<Service.Response.getCouponTemplateList>;
8
+ addCouponStock(request: Service.Request.addCouponStock): Promise<Service.Response.addCouponStock>;
9
+ getCouponTemplateDetail(request: Service.Request.getCouponTemplateDetail): Promise<Service.Response.getCouponTemplateDetail>;
10
+ syncCouponToLive(request: Service.Request.syncCouponToLive): Promise<void>;
11
+ }
12
+ export declare const couponService: CouponService;
13
+ export default couponService;
@@ -0,0 +1,78 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
9
+ return function (target, key) { decorator(target, key, paramIndex); }
10
+ };
11
+ var __importDefault = (this && this.__importDefault) || function (mod) {
12
+ return (mod && mod.__esModule) ? mod : { "default": mod };
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.couponService = void 0;
16
+ const tsoa_1 = require("tsoa");
17
+ const http_1 = require("../../utils/http");
18
+ const BaseService_1 = __importDefault(require("../BaseService"));
19
+ let CouponService = class CouponService extends BaseService_1.default {
20
+ constructor() {
21
+ super(...arguments);
22
+ this.prefixUrl = '/coupon';
23
+ }
24
+ createCouponTemplate(request) {
25
+ return (0, http_1.callApi)(this.getApiUrl(this.createCouponTemplate), request);
26
+ }
27
+ abandonCouponTemplate(request) {
28
+ return (0, http_1.callApi)(this.getApiUrl(this.abandonCouponTemplate), request);
29
+ }
30
+ getCouponTemplateList(request) {
31
+ return (0, http_1.callApi)(this.getApiUrl(this.getCouponTemplateList), request);
32
+ }
33
+ addCouponStock(request) {
34
+ return (0, http_1.callApi)(this.getApiUrl(this.addCouponStock), request);
35
+ }
36
+ getCouponTemplateDetail(request) {
37
+ return (0, http_1.callApi)(this.getApiUrl(this.getCouponTemplateDetail), request);
38
+ }
39
+ syncCouponToLive(request) {
40
+ return (0, http_1.callApi)(this.getApiUrl(this.syncCouponToLive), request);
41
+ }
42
+ };
43
+ __decorate([
44
+ (0, tsoa_1.OperationId)('创建券模版'),
45
+ (0, tsoa_1.Post)('create-coupon-template'),
46
+ __param(0, (0, tsoa_1.Body)())
47
+ ], CouponService.prototype, "createCouponTemplate", null);
48
+ __decorate([
49
+ (0, tsoa_1.OperationId)('作废券模版'),
50
+ (0, tsoa_1.Post)('abandon-coupon-template'),
51
+ __param(0, (0, tsoa_1.Body)())
52
+ ], CouponService.prototype, "abandonCouponTemplate", null);
53
+ __decorate([
54
+ (0, tsoa_1.OperationId)('获取券模版列表'),
55
+ (0, tsoa_1.Post)('get-coupon-template-list'),
56
+ __param(0, (0, tsoa_1.Body)())
57
+ ], CouponService.prototype, "getCouponTemplateList", null);
58
+ __decorate([
59
+ (0, tsoa_1.OperationId)('增加券库存'),
60
+ (0, tsoa_1.Post)('add-coupon-stock'),
61
+ __param(0, (0, tsoa_1.Body)())
62
+ ], CouponService.prototype, "addCouponStock", null);
63
+ __decorate([
64
+ (0, tsoa_1.OperationId)('获取券模版详情'),
65
+ (0, tsoa_1.Post)('get-coupon-template-detail'),
66
+ __param(0, (0, tsoa_1.Body)())
67
+ ], CouponService.prototype, "getCouponTemplateDetail", null);
68
+ __decorate([
69
+ (0, tsoa_1.OperationId)('同步券至火山直播'),
70
+ (0, tsoa_1.Post)('sync-coupon-to-live'),
71
+ __param(0, (0, tsoa_1.Body)())
72
+ ], CouponService.prototype, "syncCouponToLive", null);
73
+ CouponService = __decorate([
74
+ (0, tsoa_1.Route)('coupon'),
75
+ (0, tsoa_1.Tags)('Coupon')
76
+ ], CouponService);
77
+ exports.couponService = new CouponService();
78
+ exports.default = exports.couponService;
@@ -0,0 +1,371 @@
1
+ import { ENUM } from '../../enum';
2
+ export declare namespace Service {
3
+ namespace Entity {
4
+ /** 券生命周期 */
5
+ interface CouponLifeCycle {
6
+ /** 固定生效时间(时间戳) */
7
+ effectAt?: number;
8
+ /** 固定过期时间(时间戳) */
9
+ expireAt?: number;
10
+ /** 相对生效天数(自领券后开始计算,与生效&过期时间互斥) */
11
+ effectiveDays?: number;
12
+ }
13
+ /** 券使用限制 */
14
+ interface CouponUsageLimit {
15
+ /** 类型:FEE-金额 */
16
+ type: ENUM.COUPON_ENUM.UsageLimitType;
17
+ /** 限制值 */
18
+ value: number;
19
+ /** 生效类型:ITEM-单份商品 */
20
+ effectType: string;
21
+ }
22
+ /** 优惠规则额外信息 */
23
+ interface DiscountRuleExtra {
24
+ /** 阶梯序号 */
25
+ tier?: number;
26
+ /** 门槛金额(分) */
27
+ floor?: number;
28
+ /** 上限金额(分,-1表示无上限) */
29
+ ceiling?: number;
30
+ /** 是否可叠加 */
31
+ stackable?: boolean;
32
+ /** 最大叠加次数 */
33
+ maxStack?: number;
34
+ }
35
+ /** 券领取限制 */
36
+ interface CouponReceiveLimit {
37
+ /** 自增主键 */
38
+ id?: number;
39
+ /** 券ID */
40
+ couponId: string;
41
+ /** 限制维度 */
42
+ type: ENUM.COUPON_ENUM.ReceiveLimitType;
43
+ /** 限制值 */
44
+ limitValue: number;
45
+ /** 创建时间 */
46
+ createdAt?: number;
47
+ /** 更新时间 */
48
+ updatedAt?: number;
49
+ /** 删除时间 */
50
+ deletedAt?: number;
51
+ }
52
+ /** 券优惠规则 */
53
+ interface CouponDiscountRule {
54
+ /** 自增主键 */
55
+ id?: number;
56
+ /** 券ID */
57
+ couponId: string;
58
+ /** 优惠类型 */
59
+ type: ENUM.COUPON_ENUM.DiscountRuleType;
60
+ /** 优惠值(金额:分,折扣:0-100) */
61
+ discountValue: number;
62
+ /** 优惠级别 */
63
+ level: ENUM.COUPON_ENUM.DiscountLevel;
64
+ /** 同级多规则时的排序 */
65
+ priority: number;
66
+ /** 规则信息 */
67
+ extra?: Entity.DiscountRuleExtra;
68
+ /** 创建时间 */
69
+ createdAt?: number;
70
+ /** 更新时间 */
71
+ updatedAt?: number;
72
+ /** 删除时间 */
73
+ deletedAt?: number;
74
+ }
75
+ /** 券适用范围 */
76
+ interface CouponScope {
77
+ /** ID */
78
+ id?: string;
79
+ /** 创建时间 */
80
+ createdAt?: number;
81
+ /** 更新时间 */
82
+ updatedAt?: number;
83
+ /** 删除时间 */
84
+ deletedAt?: number;
85
+ /** 券ID */
86
+ couponId: string;
87
+ /** 是否可用 */
88
+ available: boolean;
89
+ /** 标签ID */
90
+ tagId: string;
91
+ }
92
+ /** 券操作记录 */
93
+ interface CouponOperateLog {
94
+ /** ID */
95
+ id?: string;
96
+ /** 创建时间 */
97
+ createdAt?: number;
98
+ /** 更新时间 */
99
+ updatedAt?: number;
100
+ /** 删除时间 */
101
+ deletedAt?: number;
102
+ /** 操作类型 */
103
+ operateType: ENUM.COUPON_ENUM.OperateType;
104
+ /** 操作详情 */
105
+ operateDetail?: any;
106
+ /** 操作人 */
107
+ operator: string;
108
+ /** 券ID */
109
+ couponId: string;
110
+ }
111
+ /** 券库存流水 */
112
+ interface CouponStockFlow {
113
+ /** 主键ID */
114
+ id?: string;
115
+ /** 创建时间 */
116
+ createdAt?: number;
117
+ /** 更新时间 */
118
+ updatedAt?: number;
119
+ /** 删除时间 */
120
+ deletedAt?: number;
121
+ /** 券ID */
122
+ couponId: string;
123
+ /** 渠道 */
124
+ channel: ENUM.COUPON_ENUM.StockChannel;
125
+ /** 库存变更量(正数) */
126
+ changeStock: number;
127
+ /** 变动类型 */
128
+ changeType: ENUM.COUPON_ENUM.StockChangeType;
129
+ /** 业务ID */
130
+ bizId: string;
131
+ /** 操作人 */
132
+ operator: string;
133
+ }
134
+ /** 券模版 */
135
+ interface CouponTemplate {
136
+ /** ID */
137
+ id?: string;
138
+ /** 创建时间 */
139
+ createdAt?: number;
140
+ /** 更新时间 */
141
+ updatedAt?: number;
142
+ /** 删除时间 */
143
+ deletedAt?: number;
144
+ /** 创建人ID */
145
+ creatorId: string;
146
+ /** 券名称 */
147
+ name: string;
148
+ /** 券类型 */
149
+ couponType: ENUM.COUPON_ENUM.CouponType;
150
+ /** 券状态 */
151
+ status?: ENUM.COUPON_ENUM.CouponStatus;
152
+ /** 初始数量(-1为无限) */
153
+ originalQty: number;
154
+ /** 剩余数量(-1为无限) */
155
+ lastQty?: number;
156
+ /** 使用说明 */
157
+ instructions: string;
158
+ /** 券生命周期 */
159
+ lifeCycle: CouponLifeCycle;
160
+ /** 使用限制 */
161
+ usageLimit: CouponUsageLimit;
162
+ /** 领取限制列表 */
163
+ receiveLimits?: CouponReceiveLimit[];
164
+ /** 优惠规则列表 */
165
+ discountRules?: CouponDiscountRule[];
166
+ /** 适用范围列表 */
167
+ scopes?: CouponScope[];
168
+ }
169
+ }
170
+ namespace Request {
171
+ /** 创建券模版 */
172
+ interface createCouponTemplate {
173
+ /** 券名称 */
174
+ name: string;
175
+ /** 券类型 */
176
+ couponType: ENUM.COUPON_ENUM.CouponType;
177
+ /** 初始数量(-1为无限) */
178
+ originalQty: number;
179
+ /** 使用说明 */
180
+ instructions: string;
181
+ /** 券生命周期 */
182
+ lifeCycle: Entity.CouponLifeCycle;
183
+ /** 使用限制 */
184
+ usageLimit: Entity.CouponUsageLimit;
185
+ /** 领取限制列表 */
186
+ receiveLimits?: Array<{
187
+ /** 限制维度 */
188
+ type: ENUM.COUPON_ENUM.ReceiveLimitType;
189
+ /** 限制值 */
190
+ limitValue: number;
191
+ }>;
192
+ /** 优惠规则列表 */
193
+ discountRules?: Array<{
194
+ /** 优惠类型 */
195
+ type: ENUM.COUPON_ENUM.DiscountRuleType;
196
+ /** 优惠值(金额:分,折扣:0-100) */
197
+ discountValue: number;
198
+ /** 优惠级别 */
199
+ level: ENUM.COUPON_ENUM.DiscountLevel;
200
+ /** 同级多规则时的排序 */
201
+ priority: number;
202
+ /** 规则信息 */
203
+ extra?: Entity.DiscountRuleExtra;
204
+ }>;
205
+ /** 适用范围列表 */
206
+ scopes?: Array<{
207
+ /** 是否可用 */
208
+ available: boolean;
209
+ /** 范围值 */
210
+ scopeValue: string;
211
+ /** 范围类型 */
212
+ scopeType: ENUM.COUPON_ENUM.ScopeType;
213
+ }>;
214
+ }
215
+ /** 作废券模版 */
216
+ interface abandonCouponTemplate {
217
+ /** 券ID */
218
+ couponId: string;
219
+ }
220
+ /** 券模版列表查询 */
221
+ interface getCouponTemplateList {
222
+ /** 页码 */
223
+ pageIndex?: number;
224
+ /** 每页数量 */
225
+ pageSize?: number;
226
+ /** 券名称(模糊查询) */
227
+ name?: string;
228
+ /** 券类型 */
229
+ couponType?: ENUM.COUPON_ENUM.CouponType;
230
+ /** 券状态 */
231
+ status?: ENUM.COUPON_ENUM.CouponStatus;
232
+ }
233
+ /** 增加券库存 */
234
+ interface addCouponStock {
235
+ /** 券ID */
236
+ couponId: string;
237
+ /** 增加数量 */
238
+ addQty: number;
239
+ /** 渠道 */
240
+ channel?: ENUM.COUPON_ENUM.StockChannel;
241
+ /** 备注 */
242
+ remark?: string;
243
+ }
244
+ /** 获取券模版详情 */
245
+ interface getCouponTemplateDetail {
246
+ /** 券ID */
247
+ couponId: string;
248
+ }
249
+ /** 同步券至火山 */
250
+ interface syncCouponToLive {
251
+ /** 券ID */
252
+ couponId: string;
253
+ }
254
+ }
255
+ namespace Response {
256
+ /** 券模版列表项 */
257
+ interface CouponTemplateListItem {
258
+ /** 优惠券ID */
259
+ id: string;
260
+ /** 名称 */
261
+ name: string;
262
+ /** 类型 */
263
+ couponType: ENUM.COUPON_ENUM.CouponType;
264
+ /** 优惠内容(格式化后的文本,如"满100减20") */
265
+ discountContent: string;
266
+ /** 适用商品(格式化后的文本,如"全部商品") */
267
+ applicableScope: string;
268
+ /** 已领取数量 */
269
+ receivedCount: number;
270
+ /** 未领取数量 */
271
+ unreceivedCount: number;
272
+ /** 状态 */
273
+ status: ENUM.COUPON_ENUM.CouponStatus;
274
+ /** 创建时间 */
275
+ createdAt: number;
276
+ /** 更新时间 */
277
+ updatedAt: number;
278
+ }
279
+ /** 券模版列表响应 */
280
+ interface getCouponTemplateList {
281
+ /** 总数 */
282
+ total: number;
283
+ /** 券模版列表 */
284
+ list: CouponTemplateListItem[];
285
+ /** 当前页码 */
286
+ pageIndex: number;
287
+ /** 每页数量 */
288
+ pageSize: number;
289
+ }
290
+ /** 增加券库存响应 */
291
+ interface addCouponStock {
292
+ /** 是否成功 */
293
+ success: boolean;
294
+ /** 券ID */
295
+ couponId: string;
296
+ /** 增加前的库存 */
297
+ beforeStock: number;
298
+ /** 增加后的库存 */
299
+ afterStock: number;
300
+ /** 库存流水ID */
301
+ stockFlowId?: string;
302
+ }
303
+ /** 获取券模版详情响应 */
304
+ interface getCouponTemplateDetail {
305
+ /** 券ID */
306
+ id: string;
307
+ /** 券名称 */
308
+ name: string;
309
+ /** 券类型 */
310
+ couponType: ENUM.COUPON_ENUM.CouponType;
311
+ /** 初始数量(-1为无限) */
312
+ originalQty: number;
313
+ /** 使用说明 */
314
+ instructions: string;
315
+ /** 券生命周期 */
316
+ lifeCycle: Entity.CouponLifeCycle;
317
+ /** 使用限制 */
318
+ usageLimit: Entity.CouponUsageLimit;
319
+ /** 领取限制列表 */
320
+ receiveLimits?: Array<{
321
+ /** 限制维度 */
322
+ type: ENUM.COUPON_ENUM.ReceiveLimitType;
323
+ /** 限制值 */
324
+ limitValue: number;
325
+ }>;
326
+ /** 优惠规则列表 */
327
+ discountRules?: Array<{
328
+ /** 优惠类型 */
329
+ type: ENUM.COUPON_ENUM.DiscountRuleType;
330
+ /** 优惠值(金额:分,折扣:0-100) */
331
+ discountValue: number;
332
+ /** 优惠级别 */
333
+ level: ENUM.COUPON_ENUM.DiscountLevel;
334
+ /** 同级多规则时的排序 */
335
+ priority: number;
336
+ /** 规则信息 */
337
+ extra?: Entity.DiscountRuleExtra;
338
+ }>;
339
+ /** 适用范围列表 */
340
+ scopes?: Array<{
341
+ /** 是否可用 */
342
+ available: boolean;
343
+ /** 范围值 */
344
+ scopeValue: string;
345
+ /** 范围类型 */
346
+ scopeType: ENUM.COUPON_ENUM.ScopeType;
347
+ }>;
348
+ }
349
+ /** 扣减券库存响应 */
350
+ interface deductCouponStock {
351
+ /** 是否成功 */
352
+ success: boolean;
353
+ /** 失败消息 */
354
+ message?: string;
355
+ }
356
+ }
357
+ interface CouponTemplateController {
358
+ /** 创建券模版 */
359
+ createCouponTemplate(request: Service.Request.createCouponTemplate, req: any): Promise<void>;
360
+ /** 作废券模版 */
361
+ abandonCouponTemplate(request: Service.Request.abandonCouponTemplate, req: any): Promise<void>;
362
+ /** 获取券模版列表 */
363
+ getCouponTemplateList(request: Service.Request.getCouponTemplateList, req: any): Promise<Service.Response.getCouponTemplateList>;
364
+ /** 增加券库存 */
365
+ addCouponStock(request: Service.Request.addCouponStock, req: any): Promise<Service.Response.addCouponStock>;
366
+ /** 获取券模版详情 */
367
+ getCouponTemplateDetail(request: Service.Request.getCouponTemplateDetail, req: any): Promise<Service.Response.getCouponTemplateDetail>;
368
+ /** 同步券至火山直播 */
369
+ syncCouponToLive(request: Service.Request.syncCouponToLive, req: any): Promise<void>;
370
+ }
371
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,12 @@
1
+ import { Service } from './types';
2
+ import BaseService from '../BaseService';
3
+ declare class PointsMallService extends BaseService implements Service.PointsMallController {
4
+ protected prefixUrl: string;
5
+ createProduct(request: Service.Request.createProduct): Promise<Service.Response.createProduct>;
6
+ updateProduct(request: Service.Request.updateProduct): Promise<void>;
7
+ batchToggleProductEnabled(request: Service.Request.batchToggleProductEnabled): Promise<void>;
8
+ batchToggleProductOnline(request: Service.Request.batchToggleProductOnline): Promise<void>;
9
+ queryProducts(request: Service.Request.queryProducts): Promise<Service.Response.queryProducts>;
10
+ }
11
+ export declare const pointsMallService: PointsMallService;
12
+ export default pointsMallService;