cecon-interfaces 1.4.26 → 1.4.29

Sign up to get free protection for your applications and to get access to all the features.
Files changed (99) hide show
  1. package/dist/esm2022/index.mjs +2 -3
  2. package/dist/esm2022/mobyo/index.mjs +2 -1
  3. package/dist/esm2022/mobyo/mobyo-api/interfaces/i-order-benefits-v3.mjs +1 -1
  4. package/dist/esm2022/mobyo/mobyo-api/interfaces/i-order-customer-v3.mjs +1 -1
  5. package/dist/esm2022/mobyo/mobyo-customer-mobyo/entities/customer-mobyo.entity.mjs +1 -2
  6. package/dist/esm2022/mobyo/mobyo-customer-mobyo/interfaces/i-customer-mobyo.mjs +1 -1
  7. package/dist/esm2022/mobyo/resumes/index.mjs +2 -0
  8. package/dist/esm2022/mobyo/resumes/vouchers/index.mjs +2 -0
  9. package/dist/esm2022/mobyo/resumes/vouchers/interfaces/i-resume-voucher-item.mjs +2 -0
  10. package/dist/esm2022/mobyo/resumes/vouchers/interfaces/i-resume-voucher.mjs +2 -0
  11. package/dist/esm2022/mobyo/resumes/vouchers/interfaces/index.mjs +2 -0
  12. package/dist/esm2022/voucher/entities/index.mjs +3 -1
  13. package/dist/esm2022/voucher/entities/voucher-rule.entity.mjs +17 -0
  14. package/dist/esm2022/voucher/entities/voucher-sponsorship.entity.mjs +15 -0
  15. package/dist/esm2022/voucher/entities/voucher.entity.mjs +17 -39
  16. package/dist/esm2022/voucher/enums/e-voucher-status.enum.mjs +2 -3
  17. package/dist/esm2022/voucher/enums/index.mjs +3 -1
  18. package/dist/esm2022/voucher/enums/rule-types.enum.mjs +14 -0
  19. package/dist/esm2022/voucher/enums/target-types.enum.mjs +8 -0
  20. package/dist/esm2022/voucher/interfaces/i-voucher-customer.mjs +2 -0
  21. package/dist/esm2022/voucher/interfaces/i-voucher-rule.mjs +2 -0
  22. package/dist/esm2022/voucher/interfaces/i-voucher-sponsorship.mjs +2 -0
  23. package/dist/esm2022/voucher/interfaces/i-voucher.mjs +1 -1
  24. package/dist/esm2022/voucher/interfaces/index.mjs +1 -1
  25. package/dist/fesm2022/cecon-interfaces.mjs +69 -132
  26. package/dist/fesm2022/cecon-interfaces.mjs.map +1 -1
  27. package/dist/index.d.ts +1 -2
  28. package/dist/index.js +1 -2
  29. package/dist/mobyo/index.d.ts +1 -0
  30. package/dist/mobyo/index.js +1 -0
  31. package/dist/mobyo/mobyo-api/interfaces/i-order-benefits-v3.d.ts +2 -2
  32. package/dist/mobyo/mobyo-api/interfaces/i-order-customer-v3.d.ts +0 -2
  33. package/dist/mobyo/mobyo-customer-mobyo/entities/customer-mobyo.entity.d.ts +0 -2
  34. package/dist/mobyo/mobyo-customer-mobyo/entities/customer-mobyo.entity.js +0 -1
  35. package/dist/mobyo/mobyo-customer-mobyo/interfaces/i-customer-mobyo.d.ts +0 -2
  36. package/dist/mobyo/resumes/index.d.ts +1 -0
  37. package/dist/mobyo/resumes/index.js +17 -0
  38. package/dist/mobyo/resumes/vouchers/index.d.ts +1 -0
  39. package/dist/{campaign → mobyo/resumes/vouchers}/index.js +0 -2
  40. package/dist/mobyo/resumes/vouchers/interfaces/i-resume-voucher-item.d.ts +12 -0
  41. package/dist/mobyo/resumes/vouchers/interfaces/i-resume-voucher.d.ts +18 -0
  42. package/dist/mobyo/resumes/vouchers/interfaces/index.d.ts +2 -0
  43. package/dist/package.json +1 -1
  44. package/dist/voucher/entities/index.d.ts +2 -0
  45. package/dist/voucher/entities/index.js +5 -1
  46. package/dist/voucher/entities/voucher-rule.entity.d.ts +8 -0
  47. package/dist/{campaign/entities/campaign-rule.entity.js → voucher/entities/voucher-rule.entity.js} +1 -1
  48. package/dist/voucher/entities/voucher-sponsorship.entity.d.ts +6 -0
  49. package/dist/{campaign/entities/campaign-sponsorship.entity.js → voucher/entities/voucher-sponsorship.entity.js} +5 -5
  50. package/dist/voucher/entities/voucher.entity.d.ts +15 -18
  51. package/dist/voucher/entities/voucher.entity.js +14 -35
  52. package/dist/voucher/enums/e-voucher-status.enum.d.ts +2 -3
  53. package/dist/voucher/enums/e-voucher-status.enum.js +1 -2
  54. package/dist/voucher/enums/index.d.ts +2 -0
  55. package/dist/voucher/enums/index.js +5 -1
  56. package/dist/{campaign → voucher}/enums/rule-types.enum.d.ts +1 -1
  57. package/dist/voucher/enums/rule-types.enum.js +16 -0
  58. package/dist/{campaign → voucher}/enums/target-types.enum.d.ts +1 -1
  59. package/dist/voucher/enums/target-types.enum.js +10 -0
  60. package/dist/voucher/interfaces/i-voucher-customer.d.ts +15 -0
  61. package/dist/{campaign/interfaces/i-campaign-rule.d.ts → voucher/interfaces/i-voucher-rule.d.ts} +3 -3
  62. package/dist/voucher/interfaces/i-voucher-rule.js +2 -0
  63. package/dist/{campaign/interfaces/i-campaign-sponsorship.d.ts → voucher/interfaces/i-voucher-sponsorship.d.ts} +1 -1
  64. package/dist/voucher/interfaces/i-voucher-sponsorship.js +2 -0
  65. package/dist/voucher/interfaces/i-voucher.d.ts +16 -15
  66. package/dist/voucher/interfaces/index.d.ts +3 -0
  67. package/package.json +1 -1
  68. package/dist/campaign/entities/campaign-rule.entity.d.ts +0 -8
  69. package/dist/campaign/entities/campaign-sponsorship.entity.d.ts +0 -6
  70. package/dist/campaign/entities/campaign.entity.d.ts +0 -24
  71. package/dist/campaign/entities/campaign.entity.js +0 -37
  72. package/dist/campaign/entities/index.d.ts +0 -3
  73. package/dist/campaign/entities/index.js +0 -9
  74. package/dist/campaign/enums/e-campaign-status.enum.d.ts +0 -6
  75. package/dist/campaign/enums/e-campaign-status.enum.js +0 -10
  76. package/dist/campaign/enums/index.d.ts +0 -3
  77. package/dist/campaign/enums/index.js +0 -9
  78. package/dist/campaign/enums/rule-types.enum.js +0 -16
  79. package/dist/campaign/enums/target-types.enum.js +0 -10
  80. package/dist/campaign/index.d.ts +0 -3
  81. package/dist/campaign/interfaces/i-campaign.d.ts +0 -25
  82. package/dist/campaign/interfaces/index.d.ts +0 -3
  83. package/dist/esm2022/campaign/entities/campaign-rule.entity.mjs +0 -17
  84. package/dist/esm2022/campaign/entities/campaign-sponsorship.entity.mjs +0 -15
  85. package/dist/esm2022/campaign/entities/campaign.entity.mjs +0 -33
  86. package/dist/esm2022/campaign/entities/index.mjs +0 -4
  87. package/dist/esm2022/campaign/enums/e-campaign-status.enum.mjs +0 -8
  88. package/dist/esm2022/campaign/enums/index.mjs +0 -4
  89. package/dist/esm2022/campaign/enums/rule-types.enum.mjs +0 -14
  90. package/dist/esm2022/campaign/enums/target-types.enum.mjs +0 -8
  91. package/dist/esm2022/campaign/index.mjs +0 -4
  92. package/dist/esm2022/campaign/interfaces/i-campaign-rule.mjs +0 -2
  93. package/dist/esm2022/campaign/interfaces/i-campaign-sponsorship.mjs +0 -2
  94. package/dist/esm2022/campaign/interfaces/i-campaign.mjs +0 -2
  95. package/dist/esm2022/campaign/interfaces/index.mjs +0 -2
  96. /package/dist/{campaign/interfaces/i-campaign-rule.js → mobyo/resumes/vouchers/interfaces/i-resume-voucher-item.js} +0 -0
  97. /package/dist/{campaign/interfaces/i-campaign-sponsorship.js → mobyo/resumes/vouchers/interfaces/i-resume-voucher.js} +0 -0
  98. /package/dist/{campaign → mobyo/resumes/vouchers}/interfaces/index.js +0 -0
  99. /package/dist/{campaign/interfaces/i-campaign.js → voucher/interfaces/i-voucher-customer.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);
@@ -2,3 +2,4 @@ export * from './company-settings';
2
2
  export * from './mobyo-api';
3
3
  export * from './mobyo-customer-mobyo';
4
4
  export * from './mobyo-deliverer';
5
+ export * from './resumes';
@@ -18,3 +18,4 @@ __exportStar(require("./company-settings"), exports);
18
18
  __exportStar(require("./mobyo-api"), exports);
19
19
  __exportStar(require("./mobyo-customer-mobyo"), exports);
20
20
  __exportStar(require("./mobyo-deliverer"), exports);
21
+ __exportStar(require("./resumes"), exports);
@@ -1,10 +1,10 @@
1
- import { ECampaignTargetTypes } from "../../../campaign";
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: ECampaignTargetTypes;
8
+ target: EVoucherTargetTypes;
9
9
  value: number;
10
10
  }
@@ -1,4 +1,3 @@
1
- import { IUsedVoucher } from "../../mobyo-customer-mobyo";
2
1
  export interface IOrdersCustomerPhone {
3
2
  description: String;
4
3
  localizer: String;
@@ -13,6 +12,5 @@ export interface IOrderCustomerV3 {
13
12
  ordersCountOnMerchant: number;
14
13
  phone: IOrdersCustomerPhone;
15
14
  picture: string;
16
- usedVouchers: IUsedVoucher[];
17
15
  birthday: Date | null;
18
16
  }
@@ -1,6 +1,5 @@
1
1
  import { CustomerEntity } from '../../../customer';
2
2
  import { IAddress } from '../../../general';
3
- import { IUsedVoucher } from '../interfaces';
4
3
  import { ICustomerMobyo } from '../interfaces/i-customer-mobyo';
5
4
  export declare class CustomerMobyoEntity extends CustomerEntity implements ICustomerMobyo {
6
5
  active: boolean;
@@ -12,7 +11,6 @@ export declare class CustomerMobyoEntity extends CustomerEntity implements ICust
12
11
  ordersCountOnRestaurant: number;
13
12
  uid: string;
14
13
  version: string;
15
- usedVouchers: IUsedVoucher[];
16
14
  birthday: Date | null;
17
15
  constructor(data?: Partial<CustomerMobyoEntity>);
18
16
  }
@@ -33,7 +33,6 @@ var CustomerMobyoEntity = /** @class */ (function (_super) {
33
33
  _this.ordersCountOnRestaurant = 0;
34
34
  _this.uid = '';
35
35
  _this.version = '1.0.2';
36
- _this.usedVouchers = [];
37
36
  _this.birthday = null;
38
37
  if (data) {
39
38
  for (var key in data) {
@@ -1,6 +1,5 @@
1
1
  import { ICustomer } from '../../../customer';
2
2
  import { IAddress } from '../../../general';
3
- import { IUsedVoucher } from './i-used-voucher';
4
3
  export interface ICustomerMobyo extends ICustomer {
5
4
  active: boolean;
6
5
  addresses: IAddress[];
@@ -11,6 +10,5 @@ export interface ICustomerMobyo extends ICustomer {
11
10
  ordersCountOnRestaurant: number;
12
11
  uid: string;
13
12
  version: string;
14
- usedVouchers: IUsedVoucher[];
15
13
  birthday: Date | null;
16
14
  }
@@ -0,0 +1 @@
1
+ export * from './vouchers';
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./vouchers"), exports);
@@ -0,0 +1 @@
1
+ export * from './interfaces';
@@ -14,6 +14,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./entities"), exports);
18
- __exportStar(require("./enums"), exports);
19
17
  __exportStar(require("./interfaces"), exports);
@@ -0,0 +1,12 @@
1
+ import { ICoords } from '../../../../general';
2
+ export interface IResumeVoucherItem {
3
+ confirmed: IResumeVoucherItemDetail;
4
+ cancelled: IResumeVoucherItemDetail;
5
+ }
6
+ export interface IResumeVoucherItemDetail {
7
+ cords: ICoords[];
8
+ count: number;
9
+ orderItemsCount: number;
10
+ totalAmount: number;
11
+ totalDiscount: number;
12
+ }
@@ -0,0 +1,18 @@
1
+ import { IMobyoInfo, INatiInfo } from '../../../../general';
2
+ import { EVoucherTargetTypes } from '../../../../voucher';
3
+ import { IResumeVoucherItem } from './i-resume-voucher-item';
4
+ export interface IResumeVoucher {
5
+ id: string;
6
+ createdAt: Date;
7
+ updatedAt: Date;
8
+ item: IResumeVoucherItem;
9
+ items: {
10
+ id: string;
11
+ item: IResumeVoucherItem;
12
+ }[];
13
+ targetType: {
14
+ id: EVoucherTargetTypes;
15
+ item: IResumeVoucherItem;
16
+ }[];
17
+ info: IMobyoInfo | INatiInfo;
18
+ }
@@ -0,0 +1,2 @@
1
+ export { IResumeVoucher } from './i-resume-voucher';
2
+ export { IResumeVoucherItem, IResumeVoucherItemDetail } from './i-resume-voucher-item';
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cecon-interfaces",
3
- "version": "1.4.26",
3
+ "version": "1.4.29",
4
4
  "description": "Interfaces de Projetos Cecon",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -1 +1,3 @@
1
+ export { CampaignRuleEntity } from './voucher-rule.entity';
2
+ export { VoucherSponsorshipEntity } from './voucher-sponsorship.entity';
1
3
  export { VoucherEntity } from './voucher.entity';
@@ -1,5 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.VoucherEntity = void 0;
3
+ 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; } });
@@ -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
+ }
@@ -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.ECampaignRuleType.MIN_VALUE;
8
+ this.type = enums_1.EVoucherRuleType.MIN_VALUE;
9
9
  this.value = 0;
10
10
  this.description = '';
11
11
  if (data) {
@@ -0,0 +1,6 @@
1
+ import { IVoucherSponsorship } from '../interfaces';
2
+ export declare class VoucherSponsorshipEntity implements IVoucherSponsorship {
3
+ name: string;
4
+ value: number;
5
+ constructor(data?: Partial<VoucherSponsorshipEntity>);
6
+ }
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CampaignSponsorshipEntity = void 0;
4
- var CampaignSponsorshipEntity = /** @class */ (function () {
5
- function CampaignSponsorshipEntity(data) {
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 CampaignSponsorshipEntity;
17
+ return VoucherSponsorshipEntity;
18
18
  }());
19
- exports.CampaignSponsorshipEntity = CampaignSponsorshipEntity;
19
+ exports.VoucherSponsorshipEntity = VoucherSponsorshipEntity;
@@ -1,28 +1,25 @@
1
- import { EDiscountType, SponsorshipValueEntity } from '../../general';
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
- allowsKeyChange: boolean;
6
- amount: number;
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
- maxUses: number;
19
- partnersId: string[];
20
- recurrent: boolean;
21
- sponsorship: SponsorshipValueEntity[];
11
+ name: string;
12
+ activatedAt: Date;
13
+ rules: IVoucherRule[];
14
+ type: EDiscountType;
15
+ amount: number;
16
+ sponsorship: IVoucherSponsorship[];
22
17
  status: EVoucherStatus;
23
- tags: string[];
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 (21)
11
- // se permite ou não a alteração do nome do cupom pelo parceiro
12
- this.allowsKeyChange = false;
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
- // se a chave do cupom é pública ou privada
32
- this.isPublic = true;
33
- // chave única para o cupom
13
+ this.isPublic = false;
34
14
  this.key = '';
35
- // máximo de utilizações permitidas (-1 para ilimitado)
36
- this.maxUses = -1;
37
- // ID do parceiro associado ao cupom (opcional)
38
- this.partnersId = [];
39
- this.recurrent = false;
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
- // status do cupom
43
- this.status = enums_1.EVoucherStatus.PLACED;
44
- this.tags = [];
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
- // contador de quantas vezes o cupom foi usado
25
+ this.limit = 0;
26
+ this.isExclusive = false;
48
27
  this.usedCount = 0;
49
28
  if (data) {
50
29
  for (var key in data) {
@@ -1,7 +1,6 @@
1
1
  export declare enum EVoucherStatus {
2
2
  ACTIVE = "ACTIVE",
3
- REDEEMED = "REDEEMED",
4
- EXPIRED = "EXPIRED",
5
3
  PLACED = "PLACED",
6
- PAUSED = "PAUSED"
4
+ PAUSED = "PAUSED",
5
+ CONCLUDED = "CONCLUDED"
7
6
  }
@@ -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 +1,3 @@
1
1
  export { EVoucherStatus } from './e-voucher-status.enum';
2
+ export { EVoucherRuleType } from './rule-types.enum';
3
+ export { EVoucherTargetTypes } from './target-types.enum';
@@ -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; } });
@@ -1,4 +1,4 @@
1
- export declare enum ECampaignRuleType {
1
+ export declare enum EVoucherRuleType {
2
2
  FIRST_BUY = "FIRST_BUY",
3
3
  BIRTHDAY = "BIRTHDAY",
4
4
  ONE_BY_USER = "ONE_BY_USER",
@@ -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 = {}));
@@ -1,4 +1,4 @@
1
- export declare enum ECampaignTargetTypes {
1
+ export declare enum EVoucherTargetTypes {
2
2
  CART = "CART",
3
3
  DELIVERY_FEE = "DELIVERY_FEE",
4
4
  ITEMS = "ITEMS",
@@ -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 = {}));
@@ -0,0 +1,15 @@
1
+ import { IAddress, ICoords } from '../../general';
2
+ import { IOrderTotal } from '../../order';
3
+ export interface IVoucherCustomer {
4
+ customerId: string;
5
+ cords: ICoords;
6
+ address: IAddress;
7
+ phoneNumber: string;
8
+ meta: string;
9
+ id: string;
10
+ itensCount: number;
11
+ total: IOrderTotal;
12
+ averageAmount: number;
13
+ createdAt: Date;
14
+ updatedAt: Date;
15
+ }
@@ -1,7 +1,7 @@
1
1
  import { IMenuScheduleV2 } from '../../mobyo/mobyo-api/interfaces/i-menu-schedule-v2';
2
- import { ECampaignRuleType } from '../enums/rule-types.enum';
3
- export interface ICampaignRule {
4
- type: ECampaignRuleType;
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
  }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,4 +1,4 @@
1
- export interface ICampaignSponsorship {
1
+ export interface IVoucherSponsorship {
2
2
  name: 'MERCHANT' | string;
3
3
  value: number;
4
4
  }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,25 +1,26 @@
1
- import { EDiscountType, ISponsorshipValue } from '../../general';
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
- allowsKeyChange: boolean;
5
- amount: number;
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
- maxUses: number;
18
- partnerId: string[];
19
- sponsorship: ISponsorshipValue[];
13
+ name: string;
14
+ activatedAt: Date;
15
+ rules: IVoucherRule[];
16
+ type: EDiscountType;
17
+ amount: number;
18
+ sponsorship: IVoucherSponsorship[];
20
19
  status: EVoucherStatus;
21
- tags: string[];
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
  }
@@ -1 +1,4 @@
1
1
  export { IVoucher } from './i-voucher';
2
+ export { IVoucherCustomer } from './i-voucher-customer';
3
+ export { IVoucherRule } from './i-voucher-rule';
4
+ export { IVoucherSponsorship } from './i-voucher-sponsorship';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cecon-interfaces",
3
- "version": "1.4.26",
3
+ "version": "1.4.29",
4
4
  "description": "Interfaces de Projetos Cecon",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -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,6 +0,0 @@
1
- import { ICampaignSponsorship } from '../interfaces';
2
- export declare class CampaignSponsorshipEntity implements ICampaignSponsorship {
3
- name: string;
4
- value: number;
5
- constructor(data?: Partial<CampaignSponsorshipEntity>);
6
- }
@@ -1,24 +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
- constructor(data?: Partial<CampaignEntity>);
24
- }