cecon-interfaces 2.0.59 → 2.0.60

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.
@@ -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, ITabCustomerNotificationChannelPreferences, ITabCustomerNotificationPreferences } from '../interfaces/i-tab-customer';
4
+ import { ITabCustomer, ITabCustomerItemDiscount, ITabCustomerNotificationChannelPreferences, ITabCustomerNotificationPreferences } from '../interfaces/i-tab-customer';
5
5
  export declare class TabCustomerNotificationChannelPreferencesEntity implements ITabCustomerNotificationChannelPreferences {
6
6
  newSale: boolean;
7
7
  payment: boolean;
@@ -25,12 +25,14 @@ export declare class TabCustomerEntity implements ITabCustomer {
25
25
  internationalCode: string | null;
26
26
  address: INatipayAddress | null;
27
27
  billingCycle: ETabBillingCycle;
28
- closingDayOfMonth: number | null;
29
28
  creditLimit: number;
30
29
  requiresAuthCode: boolean;
31
30
  authCodeHash: string | null;
32
31
  blocked: boolean;
33
32
  blockedReason: string | null;
33
+ discountPercent: number;
34
+ surchargePercent: number;
35
+ itemDiscounts: ITabCustomerItemDiscount[];
34
36
  notificationPreferences: ITabCustomerNotificationPreferences;
35
37
  activeInvoiceId: string | null;
36
38
  invoiceSequence: number;
@@ -49,12 +49,14 @@ class TabCustomerEntity {
49
49
  this.internationalCode = null;
50
50
  this.address = null;
51
51
  this.billingCycle = tab_billing_cycle_enum_1.ETabBillingCycle.MONTHLY;
52
- this.closingDayOfMonth = null;
53
52
  this.creditLimit = 0;
54
53
  this.requiresAuthCode = false;
55
54
  this.authCodeHash = null;
56
55
  this.blocked = false;
57
56
  this.blockedReason = null;
57
+ this.discountPercent = 0;
58
+ this.surchargePercent = 0;
59
+ this.itemDiscounts = [];
58
60
  this.notificationPreferences = new TabCustomerNotificationPreferencesEntity();
59
61
  this.activeInvoiceId = null;
60
62
  this.invoiceSequence = 0;
@@ -10,6 +10,18 @@ export interface ITabCustomerNotificationPreferences {
10
10
  whatsapp: ITabCustomerNotificationChannelPreferences;
11
11
  email: ITabCustomerNotificationChannelPreferences;
12
12
  }
13
+ /**
14
+ * Exceção de desconto por item: sempre que uma venda [set-conta] contiver um
15
+ * item com esse `productId`, o desconto é aplicado automaticamente na fatura
16
+ * (um novo ITabInvoiceEntry de categoria ADJUSTMENT). Use `discountPercent`
17
+ * (0-100) OU `discountAmount` (R$ fixo) — se ambos vierem, `discountPercent`
18
+ * prevalece.
19
+ */
20
+ export interface ITabCustomerItemDiscount {
21
+ productId: number;
22
+ discountPercent: number | null;
23
+ discountAmount: number | null;
24
+ }
13
25
  /**
14
26
  * Cliente cadastrado numa loja para o módulo de conta assinada (venda fiado).
15
27
  * Coleção Firestore: containers/{containerId}/companies/{companyId}/tab-customers
@@ -26,12 +38,26 @@ export interface ITabCustomer {
26
38
  internationalCode: string | null;
27
39
  address: INatipayAddress | null;
28
40
  billingCycle: ETabBillingCycle;
29
- closingDayOfMonth: number | null;
30
41
  creditLimit: number;
31
42
  requiresAuthCode: boolean;
32
43
  authCodeHash: string | null;
33
44
  blocked: boolean;
34
45
  blockedReason: string | null;
46
+ /**
47
+ * Desconto (%) aplicado automaticamente no saldo total da fatura no
48
+ * momento do fechamento (0-100, 0 = sem desconto).
49
+ */
50
+ discountPercent: number;
51
+ /**
52
+ * Acréscimo (%) aplicado automaticamente no saldo total da fatura no
53
+ * momento do fechamento (0-100, 0 = sem acréscimo).
54
+ */
55
+ surchargePercent: number;
56
+ /**
57
+ * Exceções de desconto por item, aplicadas em toda venda [set-conta] que
58
+ * contiver o item correspondente.
59
+ */
60
+ itemDiscounts: ITabCustomerItemDiscount[];
35
61
  notificationPreferences: ITabCustomerNotificationPreferences;
36
62
  activeInvoiceId: string | null;
37
63
  invoiceSequence: number;
@@ -1 +1 @@
1
- export { ITabCustomer, ITabCustomerNotificationChannelPreferences, ITabCustomerNotificationPreferences } from './i-tab-customer';
1
+ export { ITabCustomer, ITabCustomerItemDiscount, ITabCustomerNotificationChannelPreferences, ITabCustomerNotificationPreferences, } from './i-tab-customer';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cecon-interfaces",
3
- "version": "2.0.59",
3
+ "version": "2.0.60",
4
4
  "description": "Interfaces de Projetos Cecon",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",