cecon-interfaces 1.4.27 → 1.4.30
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/dist/esm2022/index.mjs +2 -3
- package/dist/esm2022/mobyo/mobyo-api/interfaces/i-order-benefits-v3.mjs +1 -1
- package/dist/esm2022/mobyo/resumes/vouchers/interfaces/i-resume-voucher-item.mjs +1 -1
- package/dist/esm2022/mobyo/resumes/vouchers/interfaces/i-resume-voucher.mjs +1 -1
- package/dist/esm2022/order/entities/benefits.entity.mjs +2 -1
- package/dist/esm2022/order/interfaces/i-benefits.mjs +1 -1
- package/dist/esm2022/voucher/entities/index.mjs +4 -1
- package/dist/esm2022/voucher/entities/voucher-customer.entity.mjs +25 -0
- package/dist/esm2022/voucher/entities/voucher-rule.entity.mjs +17 -0
- package/dist/esm2022/voucher/entities/voucher-sponsorship.entity.mjs +15 -0
- package/dist/esm2022/voucher/entities/voucher.entity.mjs +17 -39
- package/dist/esm2022/voucher/enums/e-voucher-status.enum.mjs +2 -3
- package/dist/esm2022/voucher/enums/index.mjs +3 -1
- package/dist/esm2022/voucher/enums/rule-types.enum.mjs +14 -0
- package/dist/esm2022/voucher/enums/target-types.enum.mjs +8 -0
- package/dist/esm2022/voucher/interfaces/i-voucher-customer.mjs +2 -0
- package/dist/esm2022/voucher/interfaces/i-voucher-rule.mjs +2 -0
- package/dist/esm2022/voucher/interfaces/i-voucher-sponsorship.mjs +2 -0
- package/dist/esm2022/voucher/interfaces/i-voucher.mjs +1 -1
- package/dist/esm2022/voucher/interfaces/index.mjs +1 -1
- package/dist/fesm2022/cecon-interfaces.mjs +93 -132
- package/dist/fesm2022/cecon-interfaces.mjs.map +1 -1
- package/dist/index.d.ts +1 -2
- package/dist/index.js +1 -2
- package/dist/mobyo/mobyo-api/interfaces/i-order-benefits-v3.d.ts +2 -2
- package/dist/mobyo/resumes/vouchers/interfaces/i-resume-voucher.d.ts +2 -2
- package/dist/order/entities/benefits.entity.d.ts +1 -0
- package/dist/order/entities/benefits.entity.js +1 -0
- package/dist/order/interfaces/i-benefits.d.ts +1 -0
- package/dist/package.json +1 -1
- package/dist/voucher/entities/index.d.ts +3 -0
- package/dist/voucher/entities/index.js +7 -1
- package/dist/voucher/entities/voucher-customer.entity.d.ts +17 -0
- package/dist/voucher/entities/voucher-customer.entity.js +29 -0
- package/dist/voucher/entities/voucher-rule.entity.d.ts +8 -0
- package/dist/{campaign/entities/campaign-rule.entity.js → voucher/entities/voucher-rule.entity.js} +1 -1
- package/dist/voucher/entities/voucher-sponsorship.entity.d.ts +6 -0
- package/dist/{campaign/entities/campaign-sponsorship.entity.js → voucher/entities/voucher-sponsorship.entity.js} +5 -5
- package/dist/voucher/entities/voucher.entity.d.ts +15 -18
- package/dist/voucher/entities/voucher.entity.js +14 -35
- package/dist/voucher/enums/e-voucher-status.enum.d.ts +2 -3
- package/dist/voucher/enums/e-voucher-status.enum.js +1 -2
- package/dist/voucher/enums/index.d.ts +2 -0
- package/dist/voucher/enums/index.js +5 -1
- package/dist/{campaign → voucher}/enums/rule-types.enum.d.ts +1 -1
- package/dist/voucher/enums/rule-types.enum.js +16 -0
- package/dist/{campaign → voucher}/enums/target-types.enum.d.ts +1 -1
- package/dist/voucher/enums/target-types.enum.js +10 -0
- package/dist/{campaign/interfaces/i-campaign-customer.d.ts → voucher/interfaces/i-voucher-customer.d.ts} +3 -3
- package/dist/{campaign/interfaces/i-campaign-rule.d.ts → voucher/interfaces/i-voucher-rule.d.ts} +3 -3
- package/dist/{campaign/interfaces/i-campaign-sponsorship.d.ts → voucher/interfaces/i-voucher-sponsorship.d.ts} +1 -1
- package/dist/voucher/interfaces/i-voucher.d.ts +16 -15
- package/dist/voucher/interfaces/index.d.ts +3 -0
- package/package.json +1 -1
- package/dist/campaign/entities/campaign-rule.entity.d.ts +0 -8
- package/dist/campaign/entities/campaign-sponsorship.entity.d.ts +0 -6
- package/dist/campaign/entities/campaign.entity.d.ts +0 -25
- package/dist/campaign/entities/campaign.entity.js +0 -38
- package/dist/campaign/entities/index.d.ts +0 -3
- package/dist/campaign/entities/index.js +0 -9
- package/dist/campaign/enums/e-campaign-status.enum.d.ts +0 -6
- package/dist/campaign/enums/e-campaign-status.enum.js +0 -10
- package/dist/campaign/enums/index.d.ts +0 -3
- package/dist/campaign/enums/index.js +0 -9
- package/dist/campaign/enums/rule-types.enum.js +0 -16
- package/dist/campaign/enums/target-types.enum.js +0 -10
- package/dist/campaign/index.d.ts +0 -3
- package/dist/campaign/index.js +0 -19
- package/dist/campaign/interfaces/i-campaign.d.ts +0 -26
- package/dist/campaign/interfaces/i-campaign.js +0 -2
- package/dist/campaign/interfaces/index.d.ts +0 -4
- package/dist/campaign/interfaces/index.js +0 -2
- package/dist/esm2022/campaign/entities/campaign-rule.entity.mjs +0 -17
- package/dist/esm2022/campaign/entities/campaign-sponsorship.entity.mjs +0 -15
- package/dist/esm2022/campaign/entities/campaign.entity.mjs +0 -34
- package/dist/esm2022/campaign/entities/index.mjs +0 -4
- package/dist/esm2022/campaign/enums/e-campaign-status.enum.mjs +0 -8
- package/dist/esm2022/campaign/enums/index.mjs +0 -4
- package/dist/esm2022/campaign/enums/rule-types.enum.mjs +0 -14
- package/dist/esm2022/campaign/enums/target-types.enum.mjs +0 -8
- package/dist/esm2022/campaign/index.mjs +0 -4
- package/dist/esm2022/campaign/interfaces/i-campaign-customer.mjs +0 -2
- package/dist/esm2022/campaign/interfaces/i-campaign-rule.mjs +0 -2
- package/dist/esm2022/campaign/interfaces/i-campaign-sponsorship.mjs +0 -2
- package/dist/esm2022/campaign/interfaces/i-campaign.mjs +0 -2
- package/dist/esm2022/campaign/interfaces/index.mjs +0 -2
- /package/dist/{campaign/interfaces/i-campaign-customer.js → voucher/interfaces/i-voucher-customer.js} +0 -0
- /package/dist/{campaign/interfaces/i-campaign-rule.js → voucher/interfaces/i-voucher-rule.js} +0 -0
- /package/dist/{campaign/interfaces/i-campaign-sponsorship.js → voucher/interfaces/i-voucher-sponsorship.js} +0 -0
package/dist/index.d.ts
CHANGED
|
@@ -2,7 +2,6 @@ export * from './app';
|
|
|
2
2
|
export * from './billing';
|
|
3
3
|
export * from './billing-order';
|
|
4
4
|
export * from './bluesoft';
|
|
5
|
-
export * from './campaign';
|
|
6
5
|
export * from './clients';
|
|
7
6
|
export * from './company';
|
|
8
7
|
export * from './container';
|
|
@@ -24,6 +23,7 @@ export * from './iugu';
|
|
|
24
23
|
export * from './lead';
|
|
25
24
|
export * from './logss';
|
|
26
25
|
export * from './master';
|
|
26
|
+
export * from './meli';
|
|
27
27
|
export * from './member';
|
|
28
28
|
export * from './mobyo';
|
|
29
29
|
export * from './monitor';
|
|
@@ -53,4 +53,3 @@ export * from './viacep';
|
|
|
53
53
|
export * from './voucher';
|
|
54
54
|
export * from './wa-server';
|
|
55
55
|
export * from './withdraw';
|
|
56
|
-
export * from './meli';
|
package/dist/index.js
CHANGED
|
@@ -18,7 +18,6 @@ __exportStar(require("./app"), exports);
|
|
|
18
18
|
__exportStar(require("./billing"), exports);
|
|
19
19
|
__exportStar(require("./billing-order"), exports);
|
|
20
20
|
__exportStar(require("./bluesoft"), exports);
|
|
21
|
-
__exportStar(require("./campaign"), exports);
|
|
22
21
|
__exportStar(require("./clients"), exports);
|
|
23
22
|
__exportStar(require("./company"), exports);
|
|
24
23
|
__exportStar(require("./container"), exports);
|
|
@@ -40,6 +39,7 @@ __exportStar(require("./iugu"), exports);
|
|
|
40
39
|
__exportStar(require("./lead"), exports);
|
|
41
40
|
__exportStar(require("./logss"), exports);
|
|
42
41
|
__exportStar(require("./master"), exports);
|
|
42
|
+
__exportStar(require("./meli"), exports);
|
|
43
43
|
__exportStar(require("./member"), exports);
|
|
44
44
|
__exportStar(require("./mobyo"), exports);
|
|
45
45
|
__exportStar(require("./monitor"), exports);
|
|
@@ -69,4 +69,3 @@ __exportStar(require("./viacep"), exports);
|
|
|
69
69
|
__exportStar(require("./voucher"), exports);
|
|
70
70
|
__exportStar(require("./wa-server"), exports);
|
|
71
71
|
__exportStar(require("./withdraw"), exports);
|
|
72
|
-
__exportStar(require("./meli"), exports);
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { EVoucherTargetTypes } from '../../../voucher';
|
|
2
2
|
export interface ISponsorshipValues {
|
|
3
3
|
name: string;
|
|
4
4
|
value: number;
|
|
5
5
|
}
|
|
6
6
|
export interface IOrderBenefitsV3 {
|
|
7
7
|
sponsorshipValues?: ISponsorshipValues[];
|
|
8
|
-
target:
|
|
8
|
+
target: EVoucherTargetTypes;
|
|
9
9
|
value: number;
|
|
10
10
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ECampaignTargetTypes } from '../../../../campaign';
|
|
2
1
|
import { IMobyoInfo, INatiInfo } from '../../../../general';
|
|
2
|
+
import { EVoucherTargetTypes } from '../../../../voucher';
|
|
3
3
|
import { IResumeVoucherItem } from './i-resume-voucher-item';
|
|
4
4
|
export interface IResumeVoucher {
|
|
5
5
|
id: string;
|
|
@@ -11,7 +11,7 @@ export interface IResumeVoucher {
|
|
|
11
11
|
item: IResumeVoucherItem;
|
|
12
12
|
}[];
|
|
13
13
|
targetType: {
|
|
14
|
-
id:
|
|
14
|
+
id: EVoucherTargetTypes;
|
|
15
15
|
item: IResumeVoucherItem;
|
|
16
16
|
}[];
|
|
17
17
|
info: IMobyoInfo | INatiInfo;
|
|
@@ -2,6 +2,7 @@ import { SponsorshipValueEntity } from '../../general/entities/sponsorship-value
|
|
|
2
2
|
export declare class OrderBenefitsEntity {
|
|
3
3
|
description: string;
|
|
4
4
|
id: string;
|
|
5
|
+
referenceId: string;
|
|
5
6
|
sponsorshipValues: SponsorshipValueEntity[];
|
|
6
7
|
target: string;
|
|
7
8
|
targetId: string;
|
package/dist/package.json
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.VoucherEntity = void 0;
|
|
3
|
+
exports.VoucherCustomerEntity = exports.VoucherEntity = exports.VoucherSponsorshipEntity = exports.CampaignRuleEntity = void 0;
|
|
4
|
+
var voucher_rule_entity_1 = require("./voucher-rule.entity");
|
|
5
|
+
Object.defineProperty(exports, "CampaignRuleEntity", { enumerable: true, get: function () { return voucher_rule_entity_1.CampaignRuleEntity; } });
|
|
6
|
+
var voucher_sponsorship_entity_1 = require("./voucher-sponsorship.entity");
|
|
7
|
+
Object.defineProperty(exports, "VoucherSponsorshipEntity", { enumerable: true, get: function () { return voucher_sponsorship_entity_1.VoucherSponsorshipEntity; } });
|
|
4
8
|
var voucher_entity_1 = require("./voucher.entity");
|
|
5
9
|
Object.defineProperty(exports, "VoucherEntity", { enumerable: true, get: function () { return voucher_entity_1.VoucherEntity; } });
|
|
10
|
+
var voucher_customer_entity_1 = require("./voucher-customer.entity");
|
|
11
|
+
Object.defineProperty(exports, "VoucherCustomerEntity", { enumerable: true, get: function () { return voucher_customer_entity_1.VoucherCustomerEntity; } });
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { AddressEntity, CoordsEntity } from '../../general';
|
|
2
|
+
import { OrderTotalEntity } from '../../order';
|
|
3
|
+
import { IVoucherCustomer } from '../interfaces';
|
|
4
|
+
export declare class VoucherCustomerEntity implements IVoucherCustomer {
|
|
5
|
+
customerId: string;
|
|
6
|
+
cords: CoordsEntity;
|
|
7
|
+
address: AddressEntity;
|
|
8
|
+
phoneNumber: string;
|
|
9
|
+
meta: string;
|
|
10
|
+
id: string;
|
|
11
|
+
itensCount: number;
|
|
12
|
+
total: OrderTotalEntity;
|
|
13
|
+
averageAmount: number;
|
|
14
|
+
createdAt: Date;
|
|
15
|
+
updatedAt: Date;
|
|
16
|
+
constructor(data?: Partial<VoucherCustomerEntity>);
|
|
17
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.VoucherCustomerEntity = void 0;
|
|
4
|
+
var general_1 = require("../../general");
|
|
5
|
+
var order_1 = require("../../order");
|
|
6
|
+
var VoucherCustomerEntity = /** @class */ (function () {
|
|
7
|
+
function VoucherCustomerEntity(data) {
|
|
8
|
+
this.customerId = '';
|
|
9
|
+
this.cords = new general_1.CoordsEntity();
|
|
10
|
+
this.address = new general_1.AddressEntity();
|
|
11
|
+
this.phoneNumber = '';
|
|
12
|
+
this.meta = ''; // JSON meta
|
|
13
|
+
this.id = '';
|
|
14
|
+
this.itensCount = 0;
|
|
15
|
+
this.total = new order_1.OrderTotalEntity();
|
|
16
|
+
this.averageAmount = 0; // total.subTotal / itensCount
|
|
17
|
+
this.createdAt = new Date();
|
|
18
|
+
this.updatedAt = new Date();
|
|
19
|
+
if (data) {
|
|
20
|
+
for (var key in data) {
|
|
21
|
+
if (data.hasOwnProperty(key) && key in this) {
|
|
22
|
+
this[key] = data[key];
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
return VoucherCustomerEntity;
|
|
28
|
+
}());
|
|
29
|
+
exports.VoucherCustomerEntity = VoucherCustomerEntity;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { EVoucherRuleType } from '../enums';
|
|
2
|
+
import { IVoucherRule } from '../interfaces';
|
|
3
|
+
export declare class CampaignRuleEntity implements IVoucherRule {
|
|
4
|
+
type: EVoucherRuleType;
|
|
5
|
+
value?: string | number | Date | boolean;
|
|
6
|
+
description: string;
|
|
7
|
+
constructor(data?: Partial<CampaignRuleEntity>);
|
|
8
|
+
}
|
package/dist/{campaign/entities/campaign-rule.entity.js → voucher/entities/voucher-rule.entity.js}
RENAMED
|
@@ -5,7 +5,7 @@ var enums_1 = require("../enums");
|
|
|
5
5
|
var CampaignRuleEntity = /** @class */ (function () {
|
|
6
6
|
function CampaignRuleEntity(data) {
|
|
7
7
|
// #region Properties (10)
|
|
8
|
-
this.type = enums_1.
|
|
8
|
+
this.type = enums_1.EVoucherRuleType.MIN_VALUE;
|
|
9
9
|
this.value = 0;
|
|
10
10
|
this.description = '';
|
|
11
11
|
if (data) {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
var
|
|
5
|
-
function
|
|
3
|
+
exports.VoucherSponsorshipEntity = void 0;
|
|
4
|
+
var VoucherSponsorshipEntity = /** @class */ (function () {
|
|
5
|
+
function VoucherSponsorshipEntity(data) {
|
|
6
6
|
// #region Properties (10)
|
|
7
7
|
this.name = 'MERCHANT';
|
|
8
8
|
this.value = 0;
|
|
@@ -14,6 +14,6 @@ var CampaignSponsorshipEntity = /** @class */ (function () {
|
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
|
-
return
|
|
17
|
+
return VoucherSponsorshipEntity;
|
|
18
18
|
}());
|
|
19
|
-
exports.
|
|
19
|
+
exports.VoucherSponsorshipEntity = VoucherSponsorshipEntity;
|
|
@@ -1,28 +1,25 @@
|
|
|
1
|
-
import { EDiscountType,
|
|
2
|
-
import { EVoucherStatus } from '../enums';
|
|
3
|
-
import { IVoucher } from '../interfaces';
|
|
1
|
+
import { EDiscountType, IMobyoInfo, INatiInfo } from '../../general';
|
|
2
|
+
import { EVoucherStatus, EVoucherTargetTypes } from '../enums';
|
|
3
|
+
import { IVoucher, IVoucherRule, IVoucherSponsorship } from '../interfaces';
|
|
4
4
|
export declare class VoucherEntity implements IVoucher {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
appId: string[];
|
|
8
|
-
campaignId?: string | null;
|
|
9
|
-
companyId?: string | null;
|
|
10
|
-
containerId?: string | null;
|
|
5
|
+
info: IMobyoInfo | INatiInfo;
|
|
6
|
+
concludedAt: Date;
|
|
11
7
|
createdAt: Date;
|
|
12
|
-
description?: string | null;
|
|
13
|
-
discountType: EDiscountType;
|
|
14
|
-
expirationDate: Date;
|
|
15
8
|
id: string;
|
|
16
9
|
isPublic: boolean;
|
|
17
10
|
key: string;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
11
|
+
name: string;
|
|
12
|
+
activatedAt: Date;
|
|
13
|
+
rules: IVoucherRule[];
|
|
14
|
+
type: EDiscountType;
|
|
15
|
+
amount: number;
|
|
16
|
+
sponsorship: IVoucherSponsorship[];
|
|
22
17
|
status: EVoucherStatus;
|
|
23
|
-
|
|
18
|
+
targetsId: string[];
|
|
19
|
+
targetType: EVoucherTargetTypes;
|
|
24
20
|
updatedAt: Date;
|
|
21
|
+
limit: number;
|
|
22
|
+
isExclusive: boolean;
|
|
25
23
|
usedCount: number;
|
|
26
24
|
constructor(data?: Partial<VoucherEntity>);
|
|
27
|
-
partnerId: string[];
|
|
28
25
|
}
|
|
@@ -4,47 +4,26 @@ exports.VoucherEntity = void 0;
|
|
|
4
4
|
var general_1 = require("../../general");
|
|
5
5
|
var enums_1 = require("../enums");
|
|
6
6
|
var VoucherEntity = /** @class */ (function () {
|
|
7
|
-
// #endregion Properties (21)
|
|
8
|
-
// #region Constructors (1)
|
|
9
7
|
function VoucherEntity(data) {
|
|
10
|
-
// #region Properties (
|
|
11
|
-
|
|
12
|
-
this.
|
|
13
|
-
// valor do desconto (soma do valor de todos os patrocínios - sponsorship)
|
|
14
|
-
this.amount = 0;
|
|
15
|
-
this.appId = [];
|
|
16
|
-
// ID da campanha associada (opcional para uso futuro)
|
|
17
|
-
this.campaignId = null;
|
|
18
|
-
// ID da empresa associada ao cupom (opcional)
|
|
19
|
-
this.companyId = null;
|
|
20
|
-
// ID do recipiente ou contexto onde o cupom é válido (opcional)
|
|
21
|
-
this.containerId = null;
|
|
22
|
-
// data de criação do cupom
|
|
8
|
+
// #region Properties (10)
|
|
9
|
+
this.info = new general_1.MobyoInfoEntity();
|
|
10
|
+
this.concludedAt = new Date();
|
|
23
11
|
this.createdAt = new Date();
|
|
24
|
-
// descrição opcional do cupom
|
|
25
|
-
this.description = null;
|
|
26
|
-
// tipo de desconto: porcentagem ou valor fixo
|
|
27
|
-
this.discountType = general_1.EDiscountType.FIXED_AMOUNT;
|
|
28
|
-
// data de validade do cupom
|
|
29
|
-
this.expirationDate = new Date(Date.now() + 1000 * 60 * 60 * 24 * 30);
|
|
30
12
|
this.id = '';
|
|
31
|
-
|
|
32
|
-
this.isPublic = true;
|
|
33
|
-
// chave única para o cupom
|
|
13
|
+
this.isPublic = false;
|
|
34
14
|
this.key = '';
|
|
35
|
-
|
|
36
|
-
this.
|
|
37
|
-
|
|
38
|
-
this.
|
|
39
|
-
this.
|
|
40
|
-
// informação de patrocínio (opcional)
|
|
15
|
+
this.name = '';
|
|
16
|
+
this.activatedAt = new Date();
|
|
17
|
+
this.rules = [];
|
|
18
|
+
this.type = general_1.EDiscountType.PERCENT;
|
|
19
|
+
this.amount = 0;
|
|
41
20
|
this.sponsorship = [];
|
|
42
|
-
|
|
43
|
-
this.
|
|
44
|
-
this.
|
|
45
|
-
// data da última atualização do cupom
|
|
21
|
+
this.status = enums_1.EVoucherStatus.ACTIVE;
|
|
22
|
+
this.targetsId = [];
|
|
23
|
+
this.targetType = enums_1.EVoucherTargetTypes.CART;
|
|
46
24
|
this.updatedAt = new Date();
|
|
47
|
-
|
|
25
|
+
this.limit = 0;
|
|
26
|
+
this.isExclusive = false;
|
|
48
27
|
this.usedCount = 0;
|
|
49
28
|
if (data) {
|
|
50
29
|
for (var key in data) {
|
|
@@ -4,8 +4,7 @@ exports.EVoucherStatus = void 0;
|
|
|
4
4
|
var EVoucherStatus;
|
|
5
5
|
(function (EVoucherStatus) {
|
|
6
6
|
EVoucherStatus["ACTIVE"] = "ACTIVE";
|
|
7
|
-
EVoucherStatus["REDEEMED"] = "REDEEMED";
|
|
8
|
-
EVoucherStatus["EXPIRED"] = "EXPIRED";
|
|
9
7
|
EVoucherStatus["PLACED"] = "PLACED";
|
|
10
8
|
EVoucherStatus["PAUSED"] = "PAUSED";
|
|
9
|
+
EVoucherStatus["CONCLUDED"] = "CONCLUDED";
|
|
11
10
|
})(EVoucherStatus || (exports.EVoucherStatus = EVoucherStatus = {}));
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.EVoucherStatus = void 0;
|
|
3
|
+
exports.EVoucherTargetTypes = exports.EVoucherRuleType = exports.EVoucherStatus = void 0;
|
|
4
4
|
var e_voucher_status_enum_1 = require("./e-voucher-status.enum");
|
|
5
5
|
Object.defineProperty(exports, "EVoucherStatus", { enumerable: true, get: function () { return e_voucher_status_enum_1.EVoucherStatus; } });
|
|
6
|
+
var rule_types_enum_1 = require("./rule-types.enum");
|
|
7
|
+
Object.defineProperty(exports, "EVoucherRuleType", { enumerable: true, get: function () { return rule_types_enum_1.EVoucherRuleType; } });
|
|
8
|
+
var target_types_enum_1 = require("./target-types.enum");
|
|
9
|
+
Object.defineProperty(exports, "EVoucherTargetTypes", { enumerable: true, get: function () { return target_types_enum_1.EVoucherTargetTypes; } });
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EVoucherRuleType = void 0;
|
|
4
|
+
var EVoucherRuleType;
|
|
5
|
+
(function (EVoucherRuleType) {
|
|
6
|
+
EVoucherRuleType["FIRST_BUY"] = "FIRST_BUY";
|
|
7
|
+
EVoucherRuleType["BIRTHDAY"] = "BIRTHDAY";
|
|
8
|
+
EVoucherRuleType["ONE_BY_USER"] = "ONE_BY_USER";
|
|
9
|
+
EVoucherRuleType["ONE_BY_DAY"] = "ONE_BY_DAY";
|
|
10
|
+
EVoucherRuleType["IN_PAYMENT_ID"] = "IN_PAYMENT_ID";
|
|
11
|
+
EVoucherRuleType["MIN_VALUE"] = "MIN_VALUE";
|
|
12
|
+
EVoucherRuleType["SHIFT_START_AT"] = "SHIFT_START_AT";
|
|
13
|
+
EVoucherRuleType["SHIFT_END_AT"] = "SHIFT_END_AT";
|
|
14
|
+
EVoucherRuleType["START_AT"] = "START_AT";
|
|
15
|
+
EVoucherRuleType["END_AT"] = "END_AT";
|
|
16
|
+
})(EVoucherRuleType || (exports.EVoucherRuleType = EVoucherRuleType = {}));
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EVoucherTargetTypes = void 0;
|
|
4
|
+
var EVoucherTargetTypes;
|
|
5
|
+
(function (EVoucherTargetTypes) {
|
|
6
|
+
EVoucherTargetTypes["CART"] = "CART";
|
|
7
|
+
EVoucherTargetTypes["DELIVERY_FEE"] = "DELIVERY_FEE";
|
|
8
|
+
EVoucherTargetTypes["ITEMS"] = "ITEMS";
|
|
9
|
+
EVoucherTargetTypes["CATEGORY"] = "CATEGORY";
|
|
10
|
+
})(EVoucherTargetTypes || (exports.EVoucherTargetTypes = EVoucherTargetTypes = {}));
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { IAddress, ICoords } from
|
|
2
|
-
import { IOrderTotal } from
|
|
3
|
-
export interface
|
|
1
|
+
import { IAddress, ICoords } from '../../general';
|
|
2
|
+
import { IOrderTotal } from '../../order';
|
|
3
|
+
export interface IVoucherCustomer {
|
|
4
4
|
customerId: string;
|
|
5
5
|
cords: ICoords;
|
|
6
6
|
address: IAddress;
|
package/dist/{campaign/interfaces/i-campaign-rule.d.ts → voucher/interfaces/i-voucher-rule.d.ts}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { IMenuScheduleV2 } from '../../mobyo/mobyo-api/interfaces/i-menu-schedule-v2';
|
|
2
|
-
import {
|
|
3
|
-
export interface
|
|
4
|
-
type:
|
|
2
|
+
import { EVoucherRuleType } from '../enums/rule-types.enum';
|
|
3
|
+
export interface IVoucherRule {
|
|
4
|
+
type: EVoucherRuleType;
|
|
5
5
|
value?: string | number | Date | boolean | IMenuScheduleV2;
|
|
6
6
|
description: string;
|
|
7
7
|
}
|
|
@@ -1,25 +1,26 @@
|
|
|
1
|
-
import { EDiscountType,
|
|
1
|
+
import { EDiscountType, IMobyoInfo, INatiInfo } from '../../general';
|
|
2
2
|
import { EVoucherStatus } from '../enums';
|
|
3
|
+
import { EVoucherTargetTypes } from '../enums/target-types.enum';
|
|
4
|
+
import { IVoucherRule } from './i-voucher-rule';
|
|
5
|
+
import { IVoucherSponsorship } from './i-voucher-sponsorship';
|
|
3
6
|
export interface IVoucher {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
appId: string[];
|
|
7
|
-
campaignId?: string | null;
|
|
8
|
-
companyId?: string | null;
|
|
9
|
-
containerId?: string | null;
|
|
7
|
+
info: IMobyoInfo | INatiInfo;
|
|
8
|
+
concludedAt: Date;
|
|
10
9
|
createdAt: Date;
|
|
11
|
-
description?: string | null;
|
|
12
|
-
discountType: EDiscountType;
|
|
13
|
-
expirationDate: Date;
|
|
14
10
|
id: string;
|
|
15
11
|
isPublic: boolean;
|
|
16
12
|
key: string;
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
13
|
+
name: string;
|
|
14
|
+
activatedAt: Date;
|
|
15
|
+
rules: IVoucherRule[];
|
|
16
|
+
type: EDiscountType;
|
|
17
|
+
amount: number;
|
|
18
|
+
sponsorship: IVoucherSponsorship[];
|
|
20
19
|
status: EVoucherStatus;
|
|
21
|
-
|
|
20
|
+
targetsId: string[];
|
|
21
|
+
targetType: EVoucherTargetTypes;
|
|
22
22
|
updatedAt: Date;
|
|
23
|
+
limit: number;
|
|
24
|
+
isExclusive: boolean;
|
|
23
25
|
usedCount: number;
|
|
24
|
-
recurrent: boolean;
|
|
25
26
|
}
|
package/package.json
CHANGED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { ECampaignRuleType } from '../enums';
|
|
2
|
-
import { ICampaignRule } from '../interfaces';
|
|
3
|
-
export declare class CampaignRuleEntity implements ICampaignRule {
|
|
4
|
-
type: ECampaignRuleType;
|
|
5
|
-
value?: string | number | Date | boolean;
|
|
6
|
-
description: string;
|
|
7
|
-
constructor(data?: Partial<CampaignRuleEntity>);
|
|
8
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { EDiscountType, IMobyoInfo, INatiInfo } from '../../general';
|
|
2
|
-
import { ECampaignStatus, ECampaignTargetTypes } from '../enums';
|
|
3
|
-
import { ICampaign, ICampaignRule, ICampaignSponsorship } from '../interfaces';
|
|
4
|
-
export declare class CampaignEntity implements ICampaign {
|
|
5
|
-
info: IMobyoInfo | INatiInfo;
|
|
6
|
-
concludedAt: Date;
|
|
7
|
-
createdAt: Date;
|
|
8
|
-
id: string;
|
|
9
|
-
isPublic: boolean;
|
|
10
|
-
key: string;
|
|
11
|
-
name: string;
|
|
12
|
-
activatedAt: Date;
|
|
13
|
-
rules: ICampaignRule[];
|
|
14
|
-
type: EDiscountType;
|
|
15
|
-
amount: number;
|
|
16
|
-
sponsorship: ICampaignSponsorship[];
|
|
17
|
-
status: ECampaignStatus;
|
|
18
|
-
targetsId: string[];
|
|
19
|
-
targetType: ECampaignTargetTypes;
|
|
20
|
-
updatedAt: Date;
|
|
21
|
-
limit: number;
|
|
22
|
-
isExclusive: boolean;
|
|
23
|
-
usedCount: number;
|
|
24
|
-
constructor(data?: Partial<CampaignEntity>);
|
|
25
|
-
}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CampaignEntity = void 0;
|
|
4
|
-
var general_1 = require("../../general");
|
|
5
|
-
var enums_1 = require("../enums");
|
|
6
|
-
var CampaignEntity = /** @class */ (function () {
|
|
7
|
-
function CampaignEntity(data) {
|
|
8
|
-
// #region Properties (10)
|
|
9
|
-
this.info = new general_1.MobyoInfoEntity();
|
|
10
|
-
this.concludedAt = new Date();
|
|
11
|
-
this.createdAt = new Date();
|
|
12
|
-
this.id = '';
|
|
13
|
-
this.isPublic = false;
|
|
14
|
-
this.key = '';
|
|
15
|
-
this.name = '';
|
|
16
|
-
this.activatedAt = new Date();
|
|
17
|
-
this.rules = [];
|
|
18
|
-
this.type = general_1.EDiscountType.PERCENT;
|
|
19
|
-
this.amount = 0;
|
|
20
|
-
this.sponsorship = [];
|
|
21
|
-
this.status = enums_1.ECampaignStatus.ACTIVE;
|
|
22
|
-
this.targetsId = [];
|
|
23
|
-
this.targetType = enums_1.ECampaignTargetTypes.CART;
|
|
24
|
-
this.updatedAt = new Date();
|
|
25
|
-
this.limit = 0;
|
|
26
|
-
this.isExclusive = false;
|
|
27
|
-
this.usedCount = 0;
|
|
28
|
-
if (data) {
|
|
29
|
-
for (var key in data) {
|
|
30
|
-
if (data.hasOwnProperty(key) && key in this) {
|
|
31
|
-
this[key] = data[key];
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
return CampaignEntity;
|
|
37
|
-
}());
|
|
38
|
-
exports.CampaignEntity = CampaignEntity;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CampaignSponsorshipEntity = exports.CampaignRuleEntity = exports.CampaignEntity = void 0;
|
|
4
|
-
var campaign_entity_1 = require("./campaign.entity");
|
|
5
|
-
Object.defineProperty(exports, "CampaignEntity", { enumerable: true, get: function () { return campaign_entity_1.CampaignEntity; } });
|
|
6
|
-
var campaign_rule_entity_1 = require("./campaign-rule.entity");
|
|
7
|
-
Object.defineProperty(exports, "CampaignRuleEntity", { enumerable: true, get: function () { return campaign_rule_entity_1.CampaignRuleEntity; } });
|
|
8
|
-
var campaign_sponsorship_entity_1 = require("./campaign-sponsorship.entity");
|
|
9
|
-
Object.defineProperty(exports, "CampaignSponsorshipEntity", { enumerable: true, get: function () { return campaign_sponsorship_entity_1.CampaignSponsorshipEntity; } });
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ECampaignStatus = void 0;
|
|
4
|
-
var ECampaignStatus;
|
|
5
|
-
(function (ECampaignStatus) {
|
|
6
|
-
ECampaignStatus["ACTIVE"] = "ACTIVE";
|
|
7
|
-
ECampaignStatus["PLACED"] = "PLACED";
|
|
8
|
-
ECampaignStatus["PAUSED"] = "PAUSED";
|
|
9
|
-
ECampaignStatus["CONCLUDED"] = "CONCLUDED";
|
|
10
|
-
})(ECampaignStatus || (exports.ECampaignStatus = ECampaignStatus = {}));
|