cecon-interfaces 1.8.1 → 1.8.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. package/dist/esm2022/mercado-pago/interfaces/payments/i-mercado-pago-payment-camelcase.mjs +1 -1
  2. package/dist/esm2022/mercado-pago/interfaces/payments/i-mercado-pago-payment.mjs +1 -1
  3. package/dist/esm2022/natipay/company/entities/fee-from.entity.mjs +3 -1
  4. package/dist/esm2022/natipay/company/entities/fee-sale-channel.entity.mjs +3 -1
  5. package/dist/esm2022/natipay/company/interfaces/i-fee-channel.mjs +1 -1
  6. package/dist/esm2022/natipay/company/interfaces/i-fee-from.mjs +1 -1
  7. package/dist/esm2022/transaction/entities/transaction.entity.mjs +5 -4
  8. package/dist/esm2022/transaction/enums/fee-payer.enum.mjs +6 -0
  9. package/dist/esm2022/transaction/enums/index.mjs +3 -1
  10. package/dist/esm2022/transaction/enums/transaction-operation.enum.mjs +8 -0
  11. package/dist/esm2022/transaction/interfaces/i-transaction.mjs +1 -1
  12. package/dist/fesm2022/cecon-interfaces.mjs +20 -3
  13. package/dist/fesm2022/cecon-interfaces.mjs.map +1 -1
  14. package/dist/mercado-pago/interfaces/payments/i-mercado-pago-payment-camelcase.d.ts +8 -2
  15. package/dist/mercado-pago/interfaces/payments/i-mercado-pago-payment.d.ts +12 -0
  16. package/dist/natipay/company/entities/fee-from.entity.d.ts +2 -0
  17. package/dist/natipay/company/entities/fee-from.entity.js +2 -0
  18. package/dist/natipay/company/entities/fee-sale-channel.entity.d.ts +2 -0
  19. package/dist/natipay/company/entities/fee-sale-channel.entity.js +2 -0
  20. package/dist/natipay/company/interfaces/i-fee-channel.d.ts +4 -2
  21. package/dist/natipay/company/interfaces/i-fee-from.d.ts +2 -0
  22. package/dist/package.json +1 -1
  23. package/dist/transaction/entities/transaction.entity.d.ts +2 -1
  24. package/dist/transaction/entities/transaction.entity.js +3 -2
  25. package/dist/transaction/enums/fee-payer.enum.d.ts +4 -0
  26. package/dist/transaction/enums/fee-payer.enum.js +13 -0
  27. package/dist/transaction/enums/index.d.ts +2 -0
  28. package/dist/transaction/enums/index.js +5 -1
  29. package/dist/transaction/enums/transaction-operation.enum.d.ts +6 -0
  30. package/dist/transaction/enums/transaction-operation.enum.js +17 -0
  31. package/dist/transaction/interfaces/i-transaction.d.ts +2 -0
  32. package/package.json +1 -1
@@ -1,3 +1,4 @@
1
+ import { EPaymentMethodId, EPaymentTypeId, EReleaseStatus } from '../../../transaction';
1
2
  export interface IMercadoPagoPaymentCamelCase {
2
3
  additionalInfo: {};
3
4
  card: {};
@@ -5,7 +6,6 @@ export interface IMercadoPagoPaymentCamelCase {
5
6
  couponAmount: number;
6
7
  currencyId: string;
7
8
  dateApproved: string;
8
- moneyReleaseStatus: string;
9
9
  dateCreated: string;
10
10
  dateLastUpdated: string;
11
11
  description: string;
@@ -13,7 +13,8 @@ export interface IMercadoPagoPaymentCamelCase {
13
13
  id: number;
14
14
  installments: number;
15
15
  metadata: {};
16
- moneyReleaseDate: string;
16
+ moneyReleaseDate: Date;
17
+ moneyReleaseStatus: EReleaseStatus;
17
18
  payer: {
18
19
  id: number;
19
20
  email: string;
@@ -24,6 +25,11 @@ export interface IMercadoPagoPaymentCamelCase {
24
25
  type: string;
25
26
  };
26
27
  paymentMethodId: string;
28
+ paymentMethods: {
29
+ issuerId: string;
30
+ id: EPaymentMethodId;
31
+ type: EPaymentTypeId;
32
+ };
27
33
  paymentTypeId: string;
28
34
  status: string;
29
35
  statusDetail: string;
@@ -21,6 +21,18 @@ export interface IMercadoPagoPayment {
21
21
  };
22
22
  type: string;
23
23
  };
24
+ payment_methods: {
25
+ excluded_payment_methods: [
26
+ {
27
+ id: string;
28
+ }
29
+ ];
30
+ excluded_payment_types: [
31
+ {
32
+ id: string;
33
+ }
34
+ ];
35
+ };
24
36
  metadata: {};
25
37
  additional_info: {};
26
38
  external_reference?: string;
@@ -1,9 +1,11 @@
1
1
  import { EFrom } from "../../../general";
2
2
  import { EAmountMode, EOperationType } from "../../../transaction";
3
+ import { EFeePayer } from "../../../transaction/enums/fee-payer.enum";
3
4
  import { IFeeFrom } from "../interfaces";
4
5
  export declare class FeeFromEntity implements IFeeFrom {
5
6
  amount: number;
6
7
  amountMode: EAmountMode;
8
+ feePayer: EFeePayer;
7
9
  from: EFrom;
8
10
  operationType: EOperationType;
9
11
  constructor(data?: Partial<FeeFromEntity>);
@@ -3,10 +3,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.FeeFromEntity = void 0;
4
4
  var general_1 = require("../../../general");
5
5
  var transaction_1 = require("../../../transaction");
6
+ var fee_payer_enum_1 = require("../../../transaction/enums/fee-payer.enum");
6
7
  var FeeFromEntity = /** @class */ (function () {
7
8
  function FeeFromEntity(data) {
8
9
  this.amount = -1;
9
10
  this.amountMode = transaction_1.EAmountMode.PERCENTAGE;
11
+ this.feePayer = fee_payer_enum_1.EFeePayer.PLATFORM;
10
12
  this.from = general_1.EFrom.DEFAULT;
11
13
  this.operationType = transaction_1.EOperationType.NATIPAY;
12
14
  if (data) {
@@ -1,9 +1,11 @@
1
1
  import { ENatipaySaleChannel } from '../..';
2
2
  import { EAmountMode, EOperationType } from '../../../transaction';
3
+ import { EFeePayer } from '../../../transaction/enums/fee-payer.enum';
3
4
  import { IFeeSaleChannel } from '../interfaces';
4
5
  export declare class FeeSaleChannelEntity implements IFeeSaleChannel {
5
6
  amount: number;
6
7
  amountMode: EAmountMode;
8
+ feePayer: EFeePayer;
7
9
  operationType: EOperationType;
8
10
  saleChannel: ENatipaySaleChannel;
9
11
  constructor(data?: Partial<FeeSaleChannelEntity>);
@@ -3,10 +3,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.FeeSaleChannelEntity = void 0;
4
4
  var __1 = require("../..");
5
5
  var transaction_1 = require("../../../transaction");
6
+ var fee_payer_enum_1 = require("../../../transaction/enums/fee-payer.enum");
6
7
  var FeeSaleChannelEntity = /** @class */ (function () {
7
8
  function FeeSaleChannelEntity(data) {
8
9
  this.amount = 0;
9
10
  this.amountMode = transaction_1.EAmountMode.PERCENTAGE;
11
+ this.feePayer = fee_payer_enum_1.EFeePayer.PLATFORM;
10
12
  this.operationType = transaction_1.EOperationType.NATIPAY;
11
13
  this.saleChannel = __1.ENatipaySaleChannel.DEFAULT;
12
14
  if (data) {
@@ -1,8 +1,10 @@
1
- import { ENatipaySaleChannel } from "../..";
2
- import { EAmountMode, EOperationType } from "../../../transaction/enums";
1
+ import { ENatipaySaleChannel } from '../..';
2
+ import { EAmountMode, EOperationType } from '../../../transaction/enums';
3
+ import { EFeePayer } from '../../../transaction/enums/fee-payer.enum';
3
4
  export interface IFeeSaleChannel {
4
5
  amount: number;
5
6
  amountMode: EAmountMode;
6
7
  operationType: EOperationType;
7
8
  saleChannel: ENatipaySaleChannel;
9
+ feePayer: EFeePayer;
8
10
  }
@@ -1,8 +1,10 @@
1
1
  import { EFrom } from '../../../general';
2
2
  import { EAmountMode, EOperationType } from '../../../transaction/enums';
3
+ import { EFeePayer } from '../../../transaction/enums/fee-payer.enum';
3
4
  export interface IFeeFrom {
4
5
  amount: number;
5
6
  amountMode: EAmountMode;
6
7
  operationType: EOperationType;
7
8
  from: EFrom;
9
+ feePayer: EFeePayer;
8
10
  }
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cecon-interfaces",
3
- "version": "1.8.1",
3
+ "version": "1.8.3",
4
4
  "description": "Interfaces de Projetos Cecon",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -1,6 +1,6 @@
1
1
  import { EFrom, IDesenfilaInfo, IInfo, IMobyoInfo } from '../../general';
2
2
  import { ENatipaySaleChannel } from '../../natipay';
3
- import { EMpStatus, EMpStatusDetail, EOperationType, EPaymentMethodId, EReleaseStatus, ETransactionProvider, ETransactionStatus } from '../enums';
3
+ import { EMpStatus, EMpStatusDetail, EOperationType, EPaymentMethodId, EReleaseStatus, ETransactionOperation, ETransactionProvider, ETransactionStatus } from '../enums';
4
4
  import { ITransaction } from '../interfaces';
5
5
  import { FeeDetailEntity } from './fee-detail.entity';
6
6
  import { TransactionBalanceEntity } from './transaction-balance.entity';
@@ -40,6 +40,7 @@ export declare class TransactionEntity implements ITransaction {
40
40
  total: TransactionTotalEntity | null;
41
41
  transactionAmount: number;
42
42
  transactionAmountRefunded: number;
43
+ transactionOperation: ETransactionOperation;
43
44
  transactionStatus: ETransactionStatus;
44
45
  updatedAt: Date;
45
46
  constructor(data?: Partial<TransactionEntity>);
@@ -14,14 +14,14 @@ var TransactionEntity = /** @class */ (function () {
14
14
  this.dateLastUpdated = new Date();
15
15
  this.dateOfExpiration = null;
16
16
  this.description = '';
17
- this.desenfilaInfo = new general_1.DesenfilaInfoEntity();
17
+ this.desenfilaInfo = new general_1.DesenfilaInfoEntity(); // TODO: Verificar se é necessário
18
18
  this.externalOrderReference = '';
19
19
  this.feeDetails = [];
20
20
  this.from = general_1.EFrom.NATIPAY;
21
21
  this.id = '';
22
22
  this.installments = 0;
23
23
  this.liveMode = true;
24
- this.mobyoInfo = new general_1.MobyoInfoEntity();
24
+ this.mobyoInfo = new general_1.MobyoInfoEntity(); // TODO: Verificar se é necessário
25
25
  this.moneyReleaseDate = null;
26
26
  this.moneyReleaseStatus = enums_1.EReleaseStatus.PENDING;
27
27
  this.natiInfo = new general_1.InfoEntity();
@@ -39,6 +39,7 @@ var TransactionEntity = /** @class */ (function () {
39
39
  this.total = null;
40
40
  this.transactionAmount = 0;
41
41
  this.transactionAmountRefunded = 0;
42
+ this.transactionOperation = enums_1.ETransactionOperation.STAMP_NEEDED;
42
43
  this.transactionStatus = enums_1.ETransactionStatus.PROCESSING;
43
44
  this.updatedAt = new Date();
44
45
  if (data) {
@@ -0,0 +1,4 @@
1
+ export declare enum EFeePayer {
2
+ MERCHANT = "MERCHANT",
3
+ PLATFORM = "PLATFORM"
4
+ }
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.EFeePayer = void 0;
4
+ var EFeePayer;
5
+ (function (EFeePayer) {
6
+ EFeePayer["MERCHANT"] = "MERCHANT";
7
+ EFeePayer["PLATFORM"] = "PLATFORM";
8
+ })(EFeePayer || (exports.EFeePayer = EFeePayer = {}));
9
+ /**
10
+ * MERCHANT: O pagador da transação é o lojista.
11
+ * PLATFORM: O pagador da transação é a plataforma.
12
+ * Usado nos fees para saber de onde sairá o valor do fee.
13
+ */
@@ -8,3 +8,5 @@ export { ETransactionResumesTargetType } from './transaction-resumes-target-type
8
8
  export { ETransactionStatus } from './transaction-status.enum';
9
9
  export { EAmountMode } from './amount-mode.enum';
10
10
  export { ETransactionProvider } from './provider.enum';
11
+ export { ETransactionOperation } from './transaction-operation.enum';
12
+ export { EFeePayer } from './fee-payer.enum';
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ETransactionProvider = exports.EAmountMode = exports.ETransactionStatus = exports.ETransactionResumesTargetType = exports.EReleaseStatus = exports.EPaymentTypeId = exports.EPaymentMethodId = exports.ESponsorIdentifier = exports.EOperationType = exports.EMpStatus = exports.EMpStatusDetail = void 0;
3
+ exports.EFeePayer = exports.ETransactionOperation = exports.ETransactionProvider = exports.EAmountMode = exports.ETransactionStatus = exports.ETransactionResumesTargetType = exports.EReleaseStatus = exports.EPaymentTypeId = exports.EPaymentMethodId = exports.ESponsorIdentifier = exports.EOperationType = exports.EMpStatus = exports.EMpStatusDetail = void 0;
4
4
  var mp_status_detail_enum_1 = require("./mp-status-detail.enum");
5
5
  Object.defineProperty(exports, "EMpStatusDetail", { enumerable: true, get: function () { return mp_status_detail_enum_1.EMpStatusDetail; } });
6
6
  var mp_status_enum_1 = require("./mp-status.enum");
@@ -22,3 +22,7 @@ var amount_mode_enum_1 = require("./amount-mode.enum");
22
22
  Object.defineProperty(exports, "EAmountMode", { enumerable: true, get: function () { return amount_mode_enum_1.EAmountMode; } });
23
23
  var provider_enum_1 = require("./provider.enum");
24
24
  Object.defineProperty(exports, "ETransactionProvider", { enumerable: true, get: function () { return provider_enum_1.ETransactionProvider; } });
25
+ var transaction_operation_enum_1 = require("./transaction-operation.enum");
26
+ Object.defineProperty(exports, "ETransactionOperation", { enumerable: true, get: function () { return transaction_operation_enum_1.ETransactionOperation; } });
27
+ var fee_payer_enum_1 = require("./fee-payer.enum");
28
+ Object.defineProperty(exports, "EFeePayer", { enumerable: true, get: function () { return fee_payer_enum_1.EFeePayer; } });
@@ -0,0 +1,6 @@
1
+ export declare enum ETransactionOperation {
2
+ STAMP_NEEDED = "STAMP_NEEDED",
3
+ SPONSORS_NEEDED = "SPONSORS_NEEDED",
4
+ COMPLETE_NEEDED = "COMPLETE_NEEDED",
5
+ COMPLETED = "COMPLETED"
6
+ }
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ETransactionOperation = void 0;
4
+ var ETransactionOperation;
5
+ (function (ETransactionOperation) {
6
+ ETransactionOperation["STAMP_NEEDED"] = "STAMP_NEEDED";
7
+ ETransactionOperation["SPONSORS_NEEDED"] = "SPONSORS_NEEDED";
8
+ ETransactionOperation["COMPLETE_NEEDED"] = "COMPLETE_NEEDED";
9
+ ETransactionOperation["COMPLETED"] = "COMPLETED";
10
+ })(ETransactionOperation || (exports.ETransactionOperation = ETransactionOperation = {}));
11
+ /**
12
+ * Usado para saber se a transação precisa de um stamp, sponsors ou completar.
13
+ * STAMP_NEEDED: A transação precisa de um stamp. Será criada uma cópia da transação na Natipay com o stamp e a operaçao SPONSORS_NEEDED.
14
+ * SPONSORS_NEEDED: Será verificado se a transação possui SPONSORS. Caso possua será criada transações com o COMPLETE_NEEDED.
15
+ * COMPLETE_NEEDED: A transação precisa de completar. Será criada uma cópia da transação na Natipay ou na Loja com o valor completo e a operaçao COMPLETED.
16
+ * COMPLETED: A transação foi completada.
17
+ */
@@ -1,6 +1,7 @@
1
1
  import { EFrom, IDesenfilaInfo, IInfo, IMobyoInfo } from '../../general';
2
2
  import { ENatipaySaleChannel } from '../../natipay/orders/enums';
3
3
  import { EMpStatus, EMpStatusDetail, EOperationType, EPaymentMethodId, EReleaseStatus, ETransactionProvider, ETransactionStatus } from '../enums';
4
+ import { ETransactionOperation } from '../enums/transaction-operation.enum';
4
5
  import { ITransactionBalance } from './i-balance';
5
6
  import { IFeeDetail } from './i-fee-detail';
6
7
  import { ITransactionPaymentMethod } from './i-payment-method';
@@ -40,5 +41,6 @@ export interface ITransaction {
40
41
  transactionAmount: number;
41
42
  transactionAmountRefunded: number;
42
43
  transactionStatus: ETransactionStatus;
44
+ transactionOperation: ETransactionOperation;
43
45
  updatedAt: Date;
44
46
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cecon-interfaces",
3
- "version": "1.8.1",
3
+ "version": "1.8.3",
4
4
  "description": "Interfaces de Projetos Cecon",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",