cecon-interfaces 2.0.62 → 2.0.64

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.
@@ -4,5 +4,6 @@ export * from './members';
4
4
  export * from './orders';
5
5
  export * from './payload';
6
6
  export * from './tab-customers';
7
+ export * from './tab-invoices';
7
8
  export * from './tokens';
8
9
  export * from './user';
@@ -20,5 +20,6 @@ __exportStar(require("./members"), exports);
20
20
  __exportStar(require("./orders"), exports);
21
21
  __exportStar(require("./payload"), exports);
22
22
  __exportStar(require("./tab-customers"), exports);
23
+ __exportStar(require("./tab-invoices"), exports);
23
24
  __exportStar(require("./tokens"), exports);
24
25
  __exportStar(require("./user"), exports);
@@ -1,7 +1,7 @@
1
1
  import { EDocType } from '../../../general';
2
2
  import { INatipayAddress } from '../../company';
3
3
  import { ETabBillingCycle } from '../enums/tab-billing-cycle.enum';
4
- import { ITabCustomer, ITabCustomerItemDiscount, ITabCustomerNotificationChannelPreferences, ITabCustomerNotificationPreferences } from '../interfaces/i-tab-customer';
4
+ import { ITabCustomer, ITabCustomerCallback, ITabCustomerItemDiscount, ITabCustomerNotificationChannelPreferences, ITabCustomerNotificationPreferences } from '../interfaces/i-tab-customer';
5
5
  export declare class TabCustomerNotificationChannelPreferencesEntity implements ITabCustomerNotificationChannelPreferences {
6
6
  newSale: boolean;
7
7
  payment: boolean;
@@ -28,6 +28,7 @@ export declare class TabCustomerEntity implements ITabCustomer {
28
28
  name: string;
29
29
  doc: string;
30
30
  docType: EDocType;
31
+ externalRef: string | null;
31
32
  email: string | null;
32
33
  phoneNumber: string | null;
33
34
  internationalCode: string | null;
@@ -42,6 +43,7 @@ export declare class TabCustomerEntity implements ITabCustomer {
42
43
  surchargePercent: number;
43
44
  itemDiscounts: ITabCustomerItemDiscount[];
44
45
  notificationPreferences: ITabCustomerNotificationPreferences;
46
+ callbacks: ITabCustomerCallback[];
45
47
  activeInvoiceId: string | null;
46
48
  invoiceSequence: number;
47
49
  tags: string[];
@@ -64,6 +64,7 @@ var TabCustomerEntity = /** @class */ (function () {
64
64
  this.name = '';
65
65
  this.doc = '';
66
66
  this.docType = general_1.EDocType.CPF;
67
+ this.externalRef = null;
67
68
  this.email = null;
68
69
  this.phoneNumber = null;
69
70
  this.internationalCode = null;
@@ -78,6 +79,7 @@ var TabCustomerEntity = /** @class */ (function () {
78
79
  this.surchargePercent = 0;
79
80
  this.itemDiscounts = [];
80
81
  this.notificationPreferences = new TabCustomerNotificationPreferencesEntity();
82
+ this.callbacks = [];
81
83
  this.activeInvoiceId = null;
82
84
  this.invoiceSequence = 0;
83
85
  this.tags = [];
@@ -25,6 +25,14 @@ export interface ITabCustomerItemDiscount {
25
25
  surchargePercent: number | null;
26
26
  surchargeAmount: number | null;
27
27
  }
28
+ /**
29
+ * Um endpoint que o parceiro/integrador quer ser notificado via HTTP POST
30
+ * sempre que uma fatura desse cliente mudar de status (ver ETabInvoiceStatus,
31
+ * `tab-invoices/enums`). Vetor pra permitir mais de um destino por cliente.
32
+ */
33
+ export interface ITabCustomerCallback {
34
+ url: string;
35
+ }
28
36
  /**
29
37
  * Cliente cadastrado numa loja para o módulo de conta assinada (venda fiado).
30
38
  * Coleção Firestore: containers/{containerId}/companies/{companyId}/tab-customers
@@ -36,6 +44,12 @@ export interface ITabCustomer {
36
44
  name: string;
37
45
  doc: string;
38
46
  docType: EDocType;
47
+ /**
48
+ * Referência do cliente no sistema do parceiro/integrador (ex.: id do
49
+ * cliente na base deles). Opcional, usada só para reconciliação externa —
50
+ * não substitui `doc` como chave de busca interna.
51
+ */
52
+ externalRef: string | null;
39
53
  email: string | null;
40
54
  phoneNumber: string | null;
41
55
  internationalCode: string | null;
@@ -62,6 +76,12 @@ export interface ITabCustomer {
62
76
  */
63
77
  itemDiscounts: ITabCustomerItemDiscount[];
64
78
  notificationPreferences: ITabCustomerNotificationPreferences;
79
+ /**
80
+ * Callbacks de mudança de status de fatura (webhook pro parceiro/integrador
81
+ * atualizar a base dele) — POST em cada URL sempre que uma fatura desse
82
+ * cliente mudar de status. Vazio = nenhum callback configurado.
83
+ */
84
+ callbacks: ITabCustomerCallback[];
65
85
  activeInvoiceId: string | null;
66
86
  invoiceSequence: number;
67
87
  tags: string[];
@@ -0,0 +1 @@
1
+ export { ETabInvoiceStatus } from './tab-invoice-status.enum';
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ETabInvoiceStatus = void 0;
4
+ var tab_invoice_status_enum_1 = require("./tab-invoice-status.enum");
5
+ Object.defineProperty(exports, "ETabInvoiceStatus", { enumerable: true, get: function () { return tab_invoice_status_enum_1.ETabInvoiceStatus; } });
@@ -0,0 +1,8 @@
1
+ export declare enum ETabInvoiceStatus {
2
+ OPEN = "OPEN",
3
+ CLOSED = "CLOSED",
4
+ OVERDUE = "OVERDUE",
5
+ PARTIALLY_PAID = "PARTIALLY_PAID",
6
+ PAID = "PAID",
7
+ CANCELLED = "CANCELLED"
8
+ }
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ETabInvoiceStatus = void 0;
4
+ var ETabInvoiceStatus;
5
+ (function (ETabInvoiceStatus) {
6
+ ETabInvoiceStatus["OPEN"] = "OPEN";
7
+ ETabInvoiceStatus["CLOSED"] = "CLOSED";
8
+ ETabInvoiceStatus["OVERDUE"] = "OVERDUE";
9
+ ETabInvoiceStatus["PARTIALLY_PAID"] = "PARTIALLY_PAID";
10
+ ETabInvoiceStatus["PAID"] = "PAID";
11
+ ETabInvoiceStatus["CANCELLED"] = "CANCELLED";
12
+ })(ETabInvoiceStatus || (exports.ETabInvoiceStatus = ETabInvoiceStatus = {}));
@@ -0,0 +1 @@
1
+ export * from './enums';
@@ -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("./enums"), exports);
@@ -9,5 +9,6 @@ export declare enum EOperationType {
9
9
  WITHDRAW = "Saque em conta",
10
10
  REGULAR_PAYMENT = "Pagamento de conta",
11
11
  AUTOMATIC_DEBIT = "D\u00E9bito autom\u00E1tico",
12
- TAB_INVOICE_PAYMENT = "Recebimento de fatura"
12
+ TAB_INVOICE_PAYMENT = "Recebimento de fatura",
13
+ TAB_INVOICE_ISSUANCE_FEE = "Emiss\u00E3o de fatura"
13
14
  }
@@ -15,4 +15,5 @@ var EOperationType;
15
15
  EOperationType["REGULAR_PAYMENT"] = "Pagamento de conta";
16
16
  EOperationType["AUTOMATIC_DEBIT"] = "D\u00E9bito autom\u00E1tico";
17
17
  EOperationType["TAB_INVOICE_PAYMENT"] = "Recebimento de fatura";
18
+ EOperationType["TAB_INVOICE_ISSUANCE_FEE"] = "Emiss\u00E3o de fatura";
18
19
  })(EOperationType || (exports.EOperationType = EOperationType = {}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cecon-interfaces",
3
- "version": "2.0.62",
3
+ "version": "2.0.64",
4
4
  "description": "Interfaces de Projetos Cecon",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",