evo360-types 1.3.469 → 1.3.474

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.
@@ -2,7 +2,13 @@ import type { IFireGlobalDoc } from '../../shared';
2
2
 
3
3
  // ── Status & Recurrence ──
4
4
 
5
- export type NexFinopsContractStatus = 'draft' | 'active' | 'inactive' | 'ended' | 'canceled';
5
+ /**
6
+ * `cancellation_requested`: o cliente pediu o cancelamento e o contrato está em
7
+ * processo de encerramento — mas **continua em vigência** e continua faturando
8
+ * (ver `NEX_FINOPS_BILLABLE_CONTRACT_STATUSES`). Só sai desse estado ao encerrar
9
+ * (`ended`), ao ser anulado (`canceled`) ou se o cliente voltar atrás (`active`).
10
+ */
11
+ export type NexFinopsContractStatus = 'draft' | 'active' | 'cancellation_requested' | 'inactive' | 'ended' | 'canceled';
6
12
  export type NexFinopsContractRecurrence = 'one_time' | 'monthly';
7
13
  export type NexFinopsPaymentMethod = 'pix' | 'boleto' | 'payment_link';
8
14
 
@@ -55,8 +61,21 @@ export interface INexFinopsContract extends IFireGlobalDoc {
55
61
 
56
62
  export const NEX_FINOPS_CONTRACT_STATUS_TRANSITIONS: Record<NexFinopsContractStatus, NexFinopsContractStatus[]> = {
57
63
  draft: ['active', 'canceled'],
58
- active: ['inactive', 'ended', 'canceled'],
64
+ active: ['cancellation_requested', 'inactive', 'ended', 'canceled'],
65
+ // Volta para 'active' cobre o cliente que desiste do cancelamento.
66
+ cancellation_requested: ['ended', 'canceled', 'active'],
59
67
  inactive: ['active'],
60
68
  ended: [],
61
69
  canceled: [],
62
70
  };
71
+
72
+ /**
73
+ * Status em que um contrato ainda gera cobrança.
74
+ *
75
+ * `cancellation_requested` entra aqui de propósito: o contrato pediu cancelamento
76
+ * mas segue em vigência até encerrar, e deve continuar sendo cobrado no período.
77
+ *
78
+ * Tipado como `readonly string[]` (e não `readonly NexFinopsContractStatus[]`) para
79
+ * que `.includes(x)` aceite qualquer string sem cast no ponto de uso.
80
+ */
81
+ export const NEX_FINOPS_BILLABLE_CONTRACT_STATUSES: readonly string[] = ['active', 'cancellation_requested'];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "evo360-types",
3
- "version": "1.3.469",
3
+ "version": "1.3.474",
4
4
  "description": "HREVO360 Shared Types",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",