evo360-types 1.3.283 → 1.3.288

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.
@@ -0,0 +1,42 @@
1
+ import type { IFireGlobalDoc } from '../../shared';
2
+ export type NexFinopsBillingStatus = 'draft' | 'issued' | 'paid' | 'overdue' | 'canceled';
3
+ export interface INexFinopsBillingServiceItem {
4
+ category: string;
5
+ description: string;
6
+ amount: number;
7
+ }
8
+ export interface INexFinopsBillingPaymentOption {
9
+ type: 'pix' | 'boleto' | 'payment_link';
10
+ provider_id?: string | null;
11
+ external_id?: string | null;
12
+ url?: string | null;
13
+ digitable_line?: string | null;
14
+ qr_code_payload?: string | null;
15
+ expires_at?: string | null;
16
+ status?: string | null;
17
+ }
18
+ export interface INexFinopsBillingCompetency {
19
+ year: number;
20
+ month: number;
21
+ key: string;
22
+ }
23
+ export interface INexFinopsBilling extends IFireGlobalDoc {
24
+ customer_id: string;
25
+ customer_ref?: string | null;
26
+ contract_id: string;
27
+ contract_ref?: string | null;
28
+ status: NexFinopsBillingStatus;
29
+ services: INexFinopsBillingServiceItem[];
30
+ amount: number;
31
+ discount: number;
32
+ total: number;
33
+ currency: 'BRL';
34
+ due_at: string;
35
+ paid_at?: string | null;
36
+ payment_method?: string | null;
37
+ payment_options?: INexFinopsBillingPaymentOption[];
38
+ competency?: INexFinopsBillingCompetency | null;
39
+ contract_snapshot?: Record<string, unknown> | null;
40
+ notes?: string | null;
41
+ }
42
+ export declare const NEX_FINOPS_BILLING_STATUS_TRANSITIONS: Record<NexFinopsBillingStatus, NexFinopsBillingStatus[]>;
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.NEX_FINOPS_BILLING_STATUS_TRANSITIONS = void 0;
4
+ // ── Status transitions ──
5
+ exports.NEX_FINOPS_BILLING_STATUS_TRANSITIONS = {
6
+ draft: ['issued', 'canceled'],
7
+ issued: ['paid', 'overdue', 'canceled'],
8
+ overdue: ['paid'],
9
+ paid: [],
10
+ canceled: [],
11
+ };
@@ -0,0 +1,86 @@
1
+ import type { IFireGlobalDoc } from '../../shared';
2
+
3
+ // ── Status ──
4
+
5
+ export type NexFinopsBillingStatus =
6
+ | 'draft'
7
+ | 'issued'
8
+ | 'paid'
9
+ | 'overdue'
10
+ | 'canceled';
11
+
12
+ // ── Sub-interfaces ──
13
+
14
+ export interface INexFinopsBillingServiceItem {
15
+ category: string;
16
+ description: string;
17
+ amount: number;
18
+ }
19
+
20
+ export interface INexFinopsBillingPaymentOption {
21
+ type: 'pix' | 'boleto' | 'payment_link';
22
+ provider_id?: string | null;
23
+ external_id?: string | null;
24
+ url?: string | null;
25
+ digitable_line?: string | null;
26
+ qr_code_payload?: string | null;
27
+ expires_at?: string | null;
28
+ status?: string | null;
29
+ }
30
+
31
+ export interface INexFinopsBillingCompetency {
32
+ year: number;
33
+ month: number;
34
+ key: string;
35
+ }
36
+
37
+ // ── Main Document ──
38
+
39
+ export interface INexFinopsBilling extends IFireGlobalDoc {
40
+ // Vínculos
41
+ customer_id: string;
42
+ customer_ref?: string | null;
43
+ contract_id: string;
44
+ contract_ref?: string | null;
45
+
46
+ // Status
47
+ status: NexFinopsBillingStatus;
48
+
49
+ // Serviços (snapshot do contrato)
50
+ services: INexFinopsBillingServiceItem[];
51
+
52
+ // Valores
53
+ amount: number;
54
+ discount: number;
55
+ total: number;
56
+ currency: 'BRL';
57
+
58
+ // Vencimento
59
+ due_at: string;
60
+
61
+ // Pagamento
62
+ paid_at?: string | null;
63
+ payment_method?: string | null;
64
+
65
+ // Formas de pagamento emitidas
66
+ payment_options?: INexFinopsBillingPaymentOption[];
67
+
68
+ // Competência
69
+ competency?: INexFinopsBillingCompetency | null;
70
+
71
+ // Snapshot do contrato
72
+ contract_snapshot?: Record<string, unknown> | null;
73
+
74
+ // Observações
75
+ notes?: string | null;
76
+ }
77
+
78
+ // ── Status transitions ──
79
+
80
+ export const NEX_FINOPS_BILLING_STATUS_TRANSITIONS: Record<NexFinopsBillingStatus, NexFinopsBillingStatus[]> = {
81
+ draft: ['issued', 'canceled'],
82
+ issued: ['paid', 'overdue', 'canceled'],
83
+ overdue: ['paid'],
84
+ paid: [],
85
+ canceled: [],
86
+ };
@@ -0,0 +1,27 @@
1
+ import type { IFireGlobalDoc } from '../../shared';
2
+ export type NexFinopsContractStatus = 'draft' | 'active' | 'inactive' | 'ended' | 'canceled';
3
+ export type NexFinopsContractRecurrence = 'one_time' | 'monthly';
4
+ export type NexFinopsPaymentMethod = 'pix' | 'boleto' | 'payment_link';
5
+ export interface INexFinopsContractServiceItem {
6
+ category: string;
7
+ description: string;
8
+ /** Valor unitário (decimal, BRL). */
9
+ amount: number;
10
+ }
11
+ export interface INexFinopsContract extends IFireGlobalDoc {
12
+ customer_id: string;
13
+ customer_ref?: string | null;
14
+ code?: string | null;
15
+ name: string;
16
+ status: NexFinopsContractStatus;
17
+ starts_at: string;
18
+ ends_at?: string | null;
19
+ recurrence: NexFinopsContractRecurrence;
20
+ due_day: number;
21
+ accepted_payment_methods: NexFinopsPaymentMethod[];
22
+ services: INexFinopsContractServiceItem[];
23
+ total_amount: number;
24
+ currency: 'BRL';
25
+ notes?: string | null;
26
+ }
27
+ export declare const NEX_FINOPS_CONTRACT_STATUS_TRANSITIONS: Record<NexFinopsContractStatus, NexFinopsContractStatus[]>;
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.NEX_FINOPS_CONTRACT_STATUS_TRANSITIONS = void 0;
4
+ // ── Status transitions ──
5
+ exports.NEX_FINOPS_CONTRACT_STATUS_TRANSITIONS = {
6
+ draft: ['active', 'canceled'],
7
+ active: ['inactive', 'ended', 'canceled'],
8
+ inactive: ['active'],
9
+ ended: [],
10
+ canceled: [],
11
+ };
@@ -0,0 +1,62 @@
1
+ import type { IFireGlobalDoc } from '../../shared';
2
+
3
+ // ── Status & Recurrence ──
4
+
5
+ export type NexFinopsContractStatus = 'draft' | 'active' | 'inactive' | 'ended' | 'canceled';
6
+ export type NexFinopsContractRecurrence = 'one_time' | 'monthly';
7
+ export type NexFinopsPaymentMethod = 'pix' | 'boleto' | 'payment_link';
8
+
9
+ // ── Service Item ──
10
+
11
+ export interface INexFinopsContractServiceItem {
12
+ category: string;
13
+ description: string;
14
+ /** Valor unitário (decimal, BRL). */
15
+ amount: number;
16
+ }
17
+
18
+ // ── Main Document ──
19
+
20
+ export interface INexFinopsContract extends IFireGlobalDoc {
21
+ // Vínculos
22
+ customer_id: string;
23
+ customer_ref?: string | null;
24
+
25
+ // Identificação
26
+ code?: string | null;
27
+ name: string;
28
+ status: NexFinopsContractStatus;
29
+
30
+ // Vigência
31
+ starts_at: string;
32
+ ends_at?: string | null;
33
+
34
+ // Recorrência e vencimento
35
+ recurrence: NexFinopsContractRecurrence;
36
+ due_day: number;
37
+
38
+ // Formas de pagamento aceitas
39
+ accepted_payment_methods: NexFinopsPaymentMethod[];
40
+
41
+ // Serviços
42
+ services: INexFinopsContractServiceItem[];
43
+
44
+ // Valor total (calculado = soma dos services[].amount)
45
+ total_amount: number;
46
+
47
+ // Moeda
48
+ currency: 'BRL';
49
+
50
+ // Observações
51
+ notes?: string | null;
52
+ }
53
+
54
+ // ── Status transitions ──
55
+
56
+ export const NEX_FINOPS_CONTRACT_STATUS_TRANSITIONS: Record<NexFinopsContractStatus, NexFinopsContractStatus[]> = {
57
+ draft: ['active', 'canceled'],
58
+ active: ['inactive', 'ended', 'canceled'],
59
+ inactive: ['active'],
60
+ ended: [],
61
+ canceled: [],
62
+ };
@@ -1,6 +1,8 @@
1
1
  export * from "./fb_collections";
2
2
  export * from "./common";
3
3
  export * from "./common/taker";
4
+ export * from "./common/contract";
5
+ export * from "./common/billing";
4
6
  export * from "./providers";
5
7
  export * from "./providers/provider_fiscal_types";
6
8
  export * from "./providers/asaas/asaas_provider";
@@ -18,6 +18,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
18
18
  __exportStar(require("./fb_collections"), exports);
19
19
  __exportStar(require("./common"), exports);
20
20
  __exportStar(require("./common/taker"), exports);
21
+ __exportStar(require("./common/contract"), exports);
22
+ __exportStar(require("./common/billing"), exports);
21
23
  __exportStar(require("./providers"), exports);
22
24
  __exportStar(require("./providers/provider_fiscal_types"), exports);
23
25
  __exportStar(require("./providers/asaas/asaas_provider"), exports);
@@ -3,6 +3,8 @@
3
3
  export * from "./fb_collections";
4
4
  export * from "./common";
5
5
  export * from "./common/taker";
6
+ export * from "./common/contract";
7
+ export * from "./common/billing";
6
8
  export * from "./providers";
7
9
  export * from "./providers/provider_fiscal_types";
8
10
  export * from "./providers/asaas/asaas_provider";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "evo360-types",
3
- "version": "1.3.283",
3
+ "version": "1.3.288",
4
4
  "description": "HREVO360 Shared Types",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",