evo360-types 1.3.811 → 1.3.816
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.
- package/dist/apps/evo-csq/zod-schemas.d.ts +62 -62
- package/dist/apps/evo-finops/zod-schemas.d.ts +304 -22
- package/dist/apps/evo-finops/zod-schemas.js +65 -7
- package/dist/apps/evo-finops/zod-schemas.ts +68 -5
- package/dist/apps/evo-modules/zod-schemas.d.ts +4 -4
- package/dist/types/evo-finops/common/contract.d.ts +10 -0
- package/dist/types/evo-finops/common/contract.ts +13 -0
- package/dist/types/evo-finops/common/proposal.d.ts +13 -0
- package/dist/types/evo-finops/common/proposal.ts +16 -0
- package/dist/types/nex-vendas/adhesion.d.ts +37 -4
- package/dist/types/nex-vendas/adhesion.ts +38 -4
- package/dist/types/nex-vendas/index.d.ts +1 -0
- package/dist/types/nex-vendas/index.js +1 -0
- package/dist/types/nex-vendas/index.ts +1 -0
- package/dist/types/nex-vendas/journey.d.ts +8 -0
- package/dist/types/nex-vendas/journey.ts +6 -0
- package/dist/types/nex-vendas/offer-package.d.ts +165 -0
- package/dist/types/nex-vendas/offer-package.js +255 -0
- package/dist/types/nex-vendas/offer-package.ts +387 -0
- package/dist/types/nex-vendas/offer.d.ts +15 -1
- package/dist/types/nex-vendas/offer.ts +15 -1
- package/package.json +1 -1
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NEX_VENDAS_PACKAGE_METRIC_MODULE = exports.NEX_VENDAS_PACKAGE_ALLOWANCE_TEXT = exports.NEX_VENDAS_PACKAGE_CAPABILITY_LABELS = exports.NEX_VENDAS_PACKAGE_MODULE_LABELS = exports.NEX_VENDAS_PACKAGE_FORBIDDEN_FIXED_SERVICE_CATEGORIES = exports.NEX_VENDAS_PACKAGE_DEFAULT_FIXED_SERVICE_CATEGORY = void 0;
|
|
4
|
+
exports.getPackageMetricModule = getPackageMetricModule;
|
|
5
|
+
exports.getPackageModuleLabel = getPackageModuleLabel;
|
|
6
|
+
exports.formatPackageBRL = formatPackageBRL;
|
|
7
|
+
exports.formatPackageAllowanceText = formatPackageAllowanceText;
|
|
8
|
+
exports.buildPackageDisplay = buildPackageDisplay;
|
|
9
|
+
const contract_1 = require("../evo-finops/common/contract");
|
|
10
|
+
const catalog_1 = require("../evo-modules/catalog");
|
|
11
|
+
// ── Constantes ──
|
|
12
|
+
/** Item fixo do contrato quando o pacote não informa: "Acesso a plataforma de atendimento". */
|
|
13
|
+
exports.NEX_VENDAS_PACKAGE_DEFAULT_FIXED_SERVICE_CATEGORY = 'APPHM';
|
|
14
|
+
/**
|
|
15
|
+
* Categorias proibidas no item fixo do pacote. `SSR` vira `ssr_base` no extrato e
|
|
16
|
+
* liga a regra regressiva de atendimentos (`billing-statement-compute.ts`).
|
|
17
|
+
*/
|
|
18
|
+
exports.NEX_VENDAS_PACKAGE_FORBIDDEN_FIXED_SERVICE_CATEGORIES = ['SSR'];
|
|
19
|
+
/**
|
|
20
|
+
* Rótulos para o CLIENTE (glossário da fix-352), separados dos rótulos de
|
|
21
|
+
* catálogo/Nexus (`PLATFORM_MODULE_CATALOG[k].label`). Módulo sem rótulo aqui
|
|
22
|
+
* cai no rótulo do catálogo.
|
|
23
|
+
*/
|
|
24
|
+
exports.NEX_VENDAS_PACKAGE_MODULE_LABELS = {
|
|
25
|
+
telemedicine: 'Virtual Care (teleconsulta)',
|
|
26
|
+
campaigns: 'Campanhas',
|
|
27
|
+
automation: 'Automação',
|
|
28
|
+
nfse: 'Notas fiscais',
|
|
29
|
+
csq: 'CSQ — qualidade do atendimento',
|
|
30
|
+
emr: 'Prontuário eletrônico',
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* Sub-opções exibidas ao cliente quando LIGADAS. Capability fora deste mapa não
|
|
34
|
+
* aparece (ex.: `auto_admit`, detalhe operacional).
|
|
35
|
+
*/
|
|
36
|
+
exports.NEX_VENDAS_PACKAGE_CAPABILITY_LABELS = {
|
|
37
|
+
telemedicine: { recording: 'gravação', transcription: 'transcrição' },
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* Texto por extenso das franquias (`{n}` = quantidade). A ORDEM de declaração é
|
|
41
|
+
* a ordem fixa de exibição. Métrica fora daqui vai para o fim, na ordem do
|
|
42
|
+
* `NexFinopsMetricCatalog`, com texto genérico ("Rótulo: n").
|
|
43
|
+
*
|
|
44
|
+
* O texto do excedente reaproveita `one` sem o `{n}`: "R$ 1,45 por atendimento com a HubIA".
|
|
45
|
+
*/
|
|
46
|
+
exports.NEX_VENDAS_PACKAGE_ALLOWANCE_TEXT = {
|
|
47
|
+
attendances_ai: { one: '{n} atendimento com a HubIA', other: '{n} atendimentos com a HubIA' },
|
|
48
|
+
attendances_human: {
|
|
49
|
+
one: '{n} atendimento pela equipe da clínica',
|
|
50
|
+
other: '{n} atendimentos pela equipe da clínica',
|
|
51
|
+
},
|
|
52
|
+
attendances: { one: '{n} atendimento', other: '{n} atendimentos' },
|
|
53
|
+
teleconsultations_unrecorded: { one: '{n} teleconsulta sem gravação', other: '{n} teleconsultas sem gravação' },
|
|
54
|
+
teleconsultations_recorded: { one: '{n} teleconsulta com gravação', other: '{n} teleconsultas com gravação' },
|
|
55
|
+
campaigns_executed: { one: '{n} campanha', other: '{n} campanhas' },
|
|
56
|
+
automation_routines: {
|
|
57
|
+
one: '{n} rotina de automação ativa ao mesmo tempo',
|
|
58
|
+
other: '{n} rotinas de automação ativas ao mesmo tempo',
|
|
59
|
+
},
|
|
60
|
+
sms: { one: '{n} SMS', other: '{n} SMS' },
|
|
61
|
+
email: { one: '{n} e-mail', other: '{n} e-mails' },
|
|
62
|
+
nfse_issued: { one: '{n} nota fiscal', other: '{n} notas fiscais' },
|
|
63
|
+
};
|
|
64
|
+
/**
|
|
65
|
+
* Mapa métrica → módulo para as métricas SEM `allowance_metrics` no catálogo
|
|
66
|
+
* (o catálogo só declara `teleconsultations_unrecorded` na telemedicina). Use
|
|
67
|
+
* `getPackageMetricModule`, que consulta o catálogo primeiro.
|
|
68
|
+
* Métrica sem módulo (atendimentos, SMS, e-mail) não aparece aqui.
|
|
69
|
+
*/
|
|
70
|
+
exports.NEX_VENDAS_PACKAGE_METRIC_MODULE = {
|
|
71
|
+
teleconsultations_recorded: 'telemedicine',
|
|
72
|
+
campaigns_executed: 'campaigns',
|
|
73
|
+
automation_routines: 'automation',
|
|
74
|
+
nfse_issued: 'nfse',
|
|
75
|
+
};
|
|
76
|
+
// ── Funções puras ──
|
|
77
|
+
const hasOwn = (obj, key) => Object.prototype.hasOwnProperty.call(obj, key);
|
|
78
|
+
/**
|
|
79
|
+
* Módulo do catálogo do qual a métrica depende (`allowance_metrics` do catálogo,
|
|
80
|
+
* depois `NEX_VENDAS_PACKAGE_METRIC_MODULE`). null = métrica sem módulo.
|
|
81
|
+
* Usado pelo backend na regra `package_allowance_module_off`.
|
|
82
|
+
*/
|
|
83
|
+
function getPackageMetricModule(metric) {
|
|
84
|
+
for (const key of (0, catalog_1.listModuleKeys)()) {
|
|
85
|
+
const def = catalog_1.PLATFORM_MODULE_CATALOG[key];
|
|
86
|
+
for (const m of def.allowance_metrics) {
|
|
87
|
+
if (m.metric === metric)
|
|
88
|
+
return key;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
return hasOwn(exports.NEX_VENDAS_PACKAGE_METRIC_MODULE, metric) ? exports.NEX_VENDAS_PACKAGE_METRIC_MODULE[metric] : null;
|
|
92
|
+
}
|
|
93
|
+
/** Rótulo do módulo para o cliente (mapa do cliente → catálogo → chave). */
|
|
94
|
+
function getPackageModuleLabel(key) {
|
|
95
|
+
if (hasOwn(exports.NEX_VENDAS_PACKAGE_MODULE_LABELS, key))
|
|
96
|
+
return exports.NEX_VENDAS_PACKAGE_MODULE_LABELS[key];
|
|
97
|
+
const def = (0, catalog_1.getModuleDefinition)(key);
|
|
98
|
+
return def ? def.label : key;
|
|
99
|
+
}
|
|
100
|
+
/** Inteiro com separador de milhar pt-BR ("1.000"). */
|
|
101
|
+
function formatInt(n) {
|
|
102
|
+
const neg = n < 0;
|
|
103
|
+
const digits = String(Math.abs(Math.trunc(n)));
|
|
104
|
+
let out = '';
|
|
105
|
+
for (let i = 0; i < digits.length; i++) {
|
|
106
|
+
if (i > 0 && (digits.length - i) % 3 === 0)
|
|
107
|
+
out += '.';
|
|
108
|
+
out += digits[i];
|
|
109
|
+
}
|
|
110
|
+
return neg ? `-${out}` : out;
|
|
111
|
+
}
|
|
112
|
+
/** "R$ 1,45" / "R$ 1.234,50" — determinístico, sem depender do ICU do runtime. */
|
|
113
|
+
function formatPackageBRL(amount) {
|
|
114
|
+
const cents = Math.round(Math.abs(amount) * 100);
|
|
115
|
+
const reais = Math.floor(cents / 100);
|
|
116
|
+
const rest = cents % 100;
|
|
117
|
+
const sign = amount < 0 && cents > 0 ? '-' : '';
|
|
118
|
+
return `${sign}R$ ${formatInt(reais)},${rest < 10 ? `0${rest}` : String(rest)}`;
|
|
119
|
+
}
|
|
120
|
+
/** Texto por extenso da franquia ("100 atendimentos com a HubIA"). */
|
|
121
|
+
function formatPackageAllowanceText(metric, included) {
|
|
122
|
+
if (hasOwn(exports.NEX_VENDAS_PACKAGE_ALLOWANCE_TEXT, metric)) {
|
|
123
|
+
const t = exports.NEX_VENDAS_PACKAGE_ALLOWANCE_TEXT[metric];
|
|
124
|
+
return (included === 1 ? t.one : t.other).replace('{n}', formatInt(included));
|
|
125
|
+
}
|
|
126
|
+
const cat = contract_1.NexFinopsMetricCatalog[metric];
|
|
127
|
+
return `${cat ? cat.label : metric}: ${formatInt(included)}`;
|
|
128
|
+
}
|
|
129
|
+
/** Unidade no singular para o texto do excedente ("atendimento com a HubIA"). */
|
|
130
|
+
function excessUnit(metric) {
|
|
131
|
+
if (hasOwn(exports.NEX_VENDAS_PACKAGE_ALLOWANCE_TEXT, metric)) {
|
|
132
|
+
return exports.NEX_VENDAS_PACKAGE_ALLOWANCE_TEXT[metric].one.replace('{n}', '').trim();
|
|
133
|
+
}
|
|
134
|
+
const cat = contract_1.NexFinopsMetricCatalog[metric];
|
|
135
|
+
return cat ? cat.label : metric;
|
|
136
|
+
}
|
|
137
|
+
/** Posição de exibição da métrica: texto do pacote, depois catálogo, depois resto. */
|
|
138
|
+
function metricOrder(metric) {
|
|
139
|
+
const textKeys = Object.keys(exports.NEX_VENDAS_PACKAGE_ALLOWANCE_TEXT);
|
|
140
|
+
const i = textKeys.indexOf(metric);
|
|
141
|
+
if (i !== -1)
|
|
142
|
+
return i;
|
|
143
|
+
const j = Object.keys(contract_1.NexFinopsMetricCatalog).indexOf(metric);
|
|
144
|
+
return j !== -1 ? textKeys.length + j : Number.MAX_SAFE_INTEGER;
|
|
145
|
+
}
|
|
146
|
+
/** Chaves dos módulos do pacote: catálogo em ordem, depois chaves fora do catálogo. */
|
|
147
|
+
function orderedModuleKeys(modules) {
|
|
148
|
+
const catalogKeys = (0, catalog_1.listModuleKeys)();
|
|
149
|
+
const out = catalogKeys.filter((k) => hasOwn(modules, k));
|
|
150
|
+
for (const k of Object.keys(modules)) {
|
|
151
|
+
if (out.indexOf(k) === -1)
|
|
152
|
+
out.push(k);
|
|
153
|
+
}
|
|
154
|
+
return out;
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* Projeção do pacote para exibir. Função PURA (sem Firestore): o backend resolve
|
|
158
|
+
* a tabela (`resolvePriceTableLines(tables, pkg.price_table_id)`) e chama; o
|
|
159
|
+
* shop/Nexus só exibem o resultado (`package_display`).
|
|
160
|
+
*
|
|
161
|
+
* - `resolved: null` (tabela não resolveu) ⇒ `excess` e `addons` vazios; o resto sai igual.
|
|
162
|
+
* - Excedente: só métrica com franquia APLICADA e linha `usage` resolvida
|
|
163
|
+
* (`disabled`/ausente não aparece). Teto por faixas (`cap`) não é exibido.
|
|
164
|
+
* - Adicionais: só módulo declarado `enabled: false` com linha `recurring` resolvida.
|
|
165
|
+
* - Sub-opções: capabilities efetivas (default do catálogo + override do pacote)
|
|
166
|
+
* que estão `true` e têm rótulo em `NEX_VENDAS_PACKAGE_CAPABILITY_LABELS`.
|
|
167
|
+
*/
|
|
168
|
+
function buildPackageDisplay(input) {
|
|
169
|
+
const { pkg, base_amount, resolved } = input;
|
|
170
|
+
const modules = pkg.modules ?? {};
|
|
171
|
+
const list = typeof pkg.list_amount === 'number' && isFinite(pkg.list_amount) ? pkg.list_amount : null;
|
|
172
|
+
const discount = list !== null && list > 0 && list > base_amount ? Math.round(((list - base_amount) / list) * 100) : null;
|
|
173
|
+
const modules_included = [];
|
|
174
|
+
const modules_excluded = [];
|
|
175
|
+
const addons = [];
|
|
176
|
+
for (const key of orderedModuleKeys(modules)) {
|
|
177
|
+
const mod = modules[key];
|
|
178
|
+
if (!mod)
|
|
179
|
+
continue;
|
|
180
|
+
const label = getPackageModuleLabel(key);
|
|
181
|
+
if (mod.enabled) {
|
|
182
|
+
const def = (0, catalog_1.getModuleDefinition)(key);
|
|
183
|
+
const effective = {};
|
|
184
|
+
if (def) {
|
|
185
|
+
for (const cap of Object.keys(def.capabilities))
|
|
186
|
+
effective[cap] = def.capabilities[cap].default;
|
|
187
|
+
}
|
|
188
|
+
const overrides = mod.capabilities ?? {};
|
|
189
|
+
for (const cap of Object.keys(overrides))
|
|
190
|
+
effective[cap] = overrides[cap];
|
|
191
|
+
const capLabels = hasOwn(exports.NEX_VENDAS_PACKAGE_CAPABILITY_LABELS, key) ? exports.NEX_VENDAS_PACKAGE_CAPABILITY_LABELS[key] : {};
|
|
192
|
+
const details = [];
|
|
193
|
+
for (const cap of Object.keys(capLabels)) {
|
|
194
|
+
if (effective[cap] === true)
|
|
195
|
+
details.push(capLabels[cap]);
|
|
196
|
+
}
|
|
197
|
+
modules_included.push({ key, label, details });
|
|
198
|
+
}
|
|
199
|
+
else {
|
|
200
|
+
modules_excluded.push({ key, label });
|
|
201
|
+
const line = resolved && hasOwn(resolved.lines, key) ? resolved.lines[key].line : null;
|
|
202
|
+
if (line && line.kind === 'recurring')
|
|
203
|
+
addons.push({ key, label, amount: line.amount });
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
const applied = pkg.allowances ?? {};
|
|
207
|
+
const allowances = [];
|
|
208
|
+
for (const metric of Object.keys(applied)) {
|
|
209
|
+
const a = applied[metric];
|
|
210
|
+
if (!a)
|
|
211
|
+
continue;
|
|
212
|
+
allowances.push({ metric, included: a.included, text: formatPackageAllowanceText(metric, a.included), applied: true });
|
|
213
|
+
}
|
|
214
|
+
for (const d of pkg.display_allowances ?? []) {
|
|
215
|
+
// Defesa: chave repetida com a aplicada é erro de escrita (backend); a aplicada vence.
|
|
216
|
+
if (hasOwn(applied, d.metric))
|
|
217
|
+
continue;
|
|
218
|
+
allowances.push({
|
|
219
|
+
metric: d.metric,
|
|
220
|
+
included: d.included,
|
|
221
|
+
text: formatPackageAllowanceText(d.metric, d.included),
|
|
222
|
+
applied: false,
|
|
223
|
+
});
|
|
224
|
+
}
|
|
225
|
+
// Ordenação estável por posição fixa (empate mantém a ordem de inserção).
|
|
226
|
+
const indexed = allowances.map((item, i) => ({ item, i }));
|
|
227
|
+
indexed.sort((x, y) => metricOrder(x.item.metric) - metricOrder(y.item.metric) || x.i - y.i);
|
|
228
|
+
const sortedAllowances = indexed.map((x) => x.item);
|
|
229
|
+
const excess = [];
|
|
230
|
+
if (resolved) {
|
|
231
|
+
for (const item of sortedAllowances) {
|
|
232
|
+
if (!item.applied || !hasOwn(resolved.lines, item.metric))
|
|
233
|
+
continue;
|
|
234
|
+
const line = resolved.lines[item.metric].line;
|
|
235
|
+
if (line.kind !== 'usage')
|
|
236
|
+
continue;
|
|
237
|
+
excess.push({
|
|
238
|
+
metric: item.metric,
|
|
239
|
+
unit_price: line.unit_price,
|
|
240
|
+
text: `${formatPackageBRL(line.unit_price)} por ${excessUnit(item.metric)}`,
|
|
241
|
+
});
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
return {
|
|
245
|
+
list_amount: list,
|
|
246
|
+
discount_percent: discount,
|
|
247
|
+
modules_included,
|
|
248
|
+
modules_excluded,
|
|
249
|
+
allowances: sortedAllowances,
|
|
250
|
+
excess,
|
|
251
|
+
addons,
|
|
252
|
+
not_included: (pkg.not_included ?? []).slice(),
|
|
253
|
+
highlights: (pkg.highlights ?? []).slice(),
|
|
254
|
+
};
|
|
255
|
+
}
|
|
@@ -0,0 +1,387 @@
|
|
|
1
|
+
import type { INexFinopsContractAllowance } from '../evo-finops/common/contract';
|
|
2
|
+
import { NexFinopsMetricCatalog } from '../evo-finops/common/contract';
|
|
3
|
+
import type { ResolvedPriceTable } from '../evo-finops/common/price-table';
|
|
4
|
+
import { PLATFORM_MODULE_CATALOG, getModuleDefinition, listModuleKeys } from '../evo-modules/catalog';
|
|
5
|
+
|
|
6
|
+
// ── Pacote comercial da oferta (feat-353) ──
|
|
7
|
+
//
|
|
8
|
+
// A oferta deixa de ser só preço + condições e passa a carregar o PACOTE:
|
|
9
|
+
// módulos ligados/desligados (chaves de `PLATFORM_MODULE_CATALOG`), franquias
|
|
10
|
+
// APLICADAS (vão ao contrato) × EXIBIDAS (só apresentação), tabela de preço do
|
|
11
|
+
// excedente/adicionais e preço "de".
|
|
12
|
+
//
|
|
13
|
+
// Caminho do dado:
|
|
14
|
+
// oferta.package ──start──▶ proposta.package (cópia CONGELADA)
|
|
15
|
+
// ──ensureContract──▶ contrato: allowances, price_table_id
|
|
16
|
+
// (ATRELADO, não congela), services[0]
|
|
17
|
+
// (item fixo) e package_modules.
|
|
18
|
+
//
|
|
19
|
+
// A apresentação (shop, proposta pública, quadro de adesão) sai SEMPRE de
|
|
20
|
+
// `buildPackageDisplay`, calculada no backend. O front só exibe
|
|
21
|
+
// `package_display` — não importa esta função em runtime.
|
|
22
|
+
|
|
23
|
+
/** Estado de um módulo do catálogo (`PLATFORM_MODULE_CATALOG`) no pacote. */
|
|
24
|
+
export interface INexVendasPackageModule {
|
|
25
|
+
enabled: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Só chaves de `def.capabilities`, com o tipo do default (validado no backend).
|
|
28
|
+
* Ausente/null = defaults do catálogo. Merge raso sobre os defaults.
|
|
29
|
+
*/
|
|
30
|
+
capabilities?: Record<string, boolean | number | string> | null;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/** Franquia só de apresentação (NÃO vai ao contrato). Ex.: atendimentos humanos 500. */
|
|
34
|
+
export interface INexVendasPackageDisplayAllowance {
|
|
35
|
+
/** Chave do `NexFinopsMetricCatalog`. Não pode repetir chave de `allowances` (backend). */
|
|
36
|
+
metric: string;
|
|
37
|
+
included: number;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Pacote comercial da oferta (feat-328 Q1 "oferta = pacote"). A proposta guarda
|
|
42
|
+
* cópia congelada; o contrato recebe só parâmetros comerciais (allowances,
|
|
43
|
+
* price_table_id, item fixo, package_modules).
|
|
44
|
+
*
|
|
45
|
+
* Regras de negócio (todos os módulos do catálogo declarados, capability válida,
|
|
46
|
+
* franquia de módulo desligado, `list_amount > base_amount`, categoria ≠ `SSR`…)
|
|
47
|
+
* ficam no backend (`validateOfferPackage`); o zod só confere a forma.
|
|
48
|
+
*/
|
|
49
|
+
export interface INexVendasOfferPackage {
|
|
50
|
+
/** Tabela que precifica excedente e adicionais. Contrato ATRELADO (não congela). */
|
|
51
|
+
price_table_id: string;
|
|
52
|
+
/** Preço "de" — SÓ apresentação (shop, quadro). Contrato/Asaas usam `base_amount`. Deve ser > base_amount. */
|
|
53
|
+
list_amount?: number | null;
|
|
54
|
+
/**
|
|
55
|
+
* Categoria `billing_services` do item fixo (`services[0]` do contrato).
|
|
56
|
+
* Nunca `SSR` (viraria base de atendimentos no extrato). Ausente = `APPHM`
|
|
57
|
+
* (`NEX_VENDAS_PACKAGE_DEFAULT_FIXED_SERVICE_CATEGORY`).
|
|
58
|
+
*/
|
|
59
|
+
fixed_service_category?: string | null;
|
|
60
|
+
/** Descrição do item fixo (linha da cobrança/NFS-e). Ausente = `offer.name`. */
|
|
61
|
+
fixed_service_description?: string | null;
|
|
62
|
+
/** TODO módulo do catálogo declarado (ligado ou desligado) — validação D13 no backend. */
|
|
63
|
+
modules: Record<string, INexVendasPackageModule>;
|
|
64
|
+
/** Franquias APLICADAS — mesmo formato/zod do contrato; vão para `contract.allowances`. */
|
|
65
|
+
allowances: Record<string, INexFinopsContractAllowance>;
|
|
66
|
+
/** Franquias EXIBIDAS — só apresentação (o contrato não recebe). */
|
|
67
|
+
display_allowances?: INexVendasPackageDisplayAllowance[] | null;
|
|
68
|
+
/** Itens fora do pacote que não são módulo (ex.: "Secretárias Hub Médica"). */
|
|
69
|
+
not_included?: string[] | null;
|
|
70
|
+
/** Destaques curtos do card (opcional). */
|
|
71
|
+
highlights?: string[] | null;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/** Módulo incluído no pacote, pronto para exibir. */
|
|
75
|
+
export interface INexVendasPackageDisplayModule {
|
|
76
|
+
key: string;
|
|
77
|
+
label: string;
|
|
78
|
+
/** Sub-opções LIGADAS, em texto do cliente ("gravação", "transcrição"). */
|
|
79
|
+
details: string[];
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/** Módulo fora do pacote. */
|
|
83
|
+
export interface INexVendasPackageDisplayExcludedModule {
|
|
84
|
+
key: string;
|
|
85
|
+
label: string;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/** Franquia por extenso. `applied: false` = só exibida (não vai ao contrato, sem excedente). */
|
|
89
|
+
export interface INexVendasPackageDisplayAllowanceItem {
|
|
90
|
+
metric: string;
|
|
91
|
+
included: number;
|
|
92
|
+
/** "100 atendimentos com a HubIA". */
|
|
93
|
+
text: string;
|
|
94
|
+
applied: boolean;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/** Preço do excedente de uma métrica com franquia APLICADA. */
|
|
98
|
+
export interface INexVendasPackageDisplayExcess {
|
|
99
|
+
metric: string;
|
|
100
|
+
unit_price: number;
|
|
101
|
+
/** "R$ 1,45 por atendimento com a HubIA". */
|
|
102
|
+
text: string;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/** Adicional opcional (upsell): módulo DESLIGADO no pacote com linha `recurring` na tabela. */
|
|
106
|
+
export interface INexVendasPackageDisplayAddon {
|
|
107
|
+
key: string;
|
|
108
|
+
label: string;
|
|
109
|
+
/** Valor mensal (BRL). */
|
|
110
|
+
amount: number;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/** Projeção pronta para exibir — mesma função para shop, proposta pública e quadro. */
|
|
114
|
+
export interface INexVendasPackageDisplay {
|
|
115
|
+
list_amount: number | null;
|
|
116
|
+
/** Inteiro, derivado: round((list - base) / list × 100). null sem `list_amount` (ou list ≤ base). */
|
|
117
|
+
discount_percent: number | null;
|
|
118
|
+
modules_included: INexVendasPackageDisplayModule[];
|
|
119
|
+
modules_excluded: INexVendasPackageDisplayExcludedModule[];
|
|
120
|
+
/** Aplicadas + exibidas, na ordem fixa de `NEX_VENDAS_PACKAGE_ALLOWANCE_TEXT`. */
|
|
121
|
+
allowances: INexVendasPackageDisplayAllowanceItem[];
|
|
122
|
+
/** Excedente das métricas com franquia APLICADA, da tabela resolvida. Vazio sem tabela. */
|
|
123
|
+
excess: INexVendasPackageDisplayExcess[];
|
|
124
|
+
/** Adicionais opcionais (NFS-e 55, Prontuário 175 na `calFvw`). Vazio sem tabela. */
|
|
125
|
+
addons: INexVendasPackageDisplayAddon[];
|
|
126
|
+
not_included: string[];
|
|
127
|
+
highlights: string[];
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
// ── Constantes ──
|
|
131
|
+
|
|
132
|
+
/** Item fixo do contrato quando o pacote não informa: "Acesso a plataforma de atendimento". */
|
|
133
|
+
export const NEX_VENDAS_PACKAGE_DEFAULT_FIXED_SERVICE_CATEGORY = 'APPHM';
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* Categorias proibidas no item fixo do pacote. `SSR` vira `ssr_base` no extrato e
|
|
137
|
+
* liga a regra regressiva de atendimentos (`billing-statement-compute.ts`).
|
|
138
|
+
*/
|
|
139
|
+
export const NEX_VENDAS_PACKAGE_FORBIDDEN_FIXED_SERVICE_CATEGORIES: readonly string[] = ['SSR'];
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* Rótulos para o CLIENTE (glossário da fix-352), separados dos rótulos de
|
|
143
|
+
* catálogo/Nexus (`PLATFORM_MODULE_CATALOG[k].label`). Módulo sem rótulo aqui
|
|
144
|
+
* cai no rótulo do catálogo.
|
|
145
|
+
*/
|
|
146
|
+
export const NEX_VENDAS_PACKAGE_MODULE_LABELS: Readonly<Record<string, string>> = {
|
|
147
|
+
telemedicine: 'Virtual Care (teleconsulta)',
|
|
148
|
+
campaigns: 'Campanhas',
|
|
149
|
+
automation: 'Automação',
|
|
150
|
+
nfse: 'Notas fiscais',
|
|
151
|
+
csq: 'CSQ — qualidade do atendimento',
|
|
152
|
+
emr: 'Prontuário eletrônico',
|
|
153
|
+
};
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* Sub-opções exibidas ao cliente quando LIGADAS. Capability fora deste mapa não
|
|
157
|
+
* aparece (ex.: `auto_admit`, detalhe operacional).
|
|
158
|
+
*/
|
|
159
|
+
export const NEX_VENDAS_PACKAGE_CAPABILITY_LABELS: Readonly<Record<string, Readonly<Record<string, string>>>> = {
|
|
160
|
+
telemedicine: { recording: 'gravação', transcription: 'transcrição' },
|
|
161
|
+
};
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* Texto por extenso das franquias (`{n}` = quantidade). A ORDEM de declaração é
|
|
165
|
+
* a ordem fixa de exibição. Métrica fora daqui vai para o fim, na ordem do
|
|
166
|
+
* `NexFinopsMetricCatalog`, com texto genérico ("Rótulo: n").
|
|
167
|
+
*
|
|
168
|
+
* O texto do excedente reaproveita `one` sem o `{n}`: "R$ 1,45 por atendimento com a HubIA".
|
|
169
|
+
*/
|
|
170
|
+
export const NEX_VENDAS_PACKAGE_ALLOWANCE_TEXT: Readonly<Record<string, { one: string; other: string }>> = {
|
|
171
|
+
attendances_ai: { one: '{n} atendimento com a HubIA', other: '{n} atendimentos com a HubIA' },
|
|
172
|
+
attendances_human: {
|
|
173
|
+
one: '{n} atendimento pela equipe da clínica',
|
|
174
|
+
other: '{n} atendimentos pela equipe da clínica',
|
|
175
|
+
},
|
|
176
|
+
attendances: { one: '{n} atendimento', other: '{n} atendimentos' },
|
|
177
|
+
teleconsultations_unrecorded: { one: '{n} teleconsulta sem gravação', other: '{n} teleconsultas sem gravação' },
|
|
178
|
+
teleconsultations_recorded: { one: '{n} teleconsulta com gravação', other: '{n} teleconsultas com gravação' },
|
|
179
|
+
campaigns_executed: { one: '{n} campanha', other: '{n} campanhas' },
|
|
180
|
+
automation_routines: {
|
|
181
|
+
one: '{n} rotina de automação ativa ao mesmo tempo',
|
|
182
|
+
other: '{n} rotinas de automação ativas ao mesmo tempo',
|
|
183
|
+
},
|
|
184
|
+
sms: { one: '{n} SMS', other: '{n} SMS' },
|
|
185
|
+
email: { one: '{n} e-mail', other: '{n} e-mails' },
|
|
186
|
+
nfse_issued: { one: '{n} nota fiscal', other: '{n} notas fiscais' },
|
|
187
|
+
};
|
|
188
|
+
|
|
189
|
+
/**
|
|
190
|
+
* Mapa métrica → módulo para as métricas SEM `allowance_metrics` no catálogo
|
|
191
|
+
* (o catálogo só declara `teleconsultations_unrecorded` na telemedicina). Use
|
|
192
|
+
* `getPackageMetricModule`, que consulta o catálogo primeiro.
|
|
193
|
+
* Métrica sem módulo (atendimentos, SMS, e-mail) não aparece aqui.
|
|
194
|
+
*/
|
|
195
|
+
export const NEX_VENDAS_PACKAGE_METRIC_MODULE: Readonly<Record<string, string>> = {
|
|
196
|
+
teleconsultations_recorded: 'telemedicine',
|
|
197
|
+
campaigns_executed: 'campaigns',
|
|
198
|
+
automation_routines: 'automation',
|
|
199
|
+
nfse_issued: 'nfse',
|
|
200
|
+
};
|
|
201
|
+
|
|
202
|
+
// ── Funções puras ──
|
|
203
|
+
|
|
204
|
+
const hasOwn = (obj: object, key: string): boolean => Object.prototype.hasOwnProperty.call(obj, key);
|
|
205
|
+
|
|
206
|
+
/**
|
|
207
|
+
* Módulo do catálogo do qual a métrica depende (`allowance_metrics` do catálogo,
|
|
208
|
+
* depois `NEX_VENDAS_PACKAGE_METRIC_MODULE`). null = métrica sem módulo.
|
|
209
|
+
* Usado pelo backend na regra `package_allowance_module_off`.
|
|
210
|
+
*/
|
|
211
|
+
export function getPackageMetricModule(metric: string): string | null {
|
|
212
|
+
for (const key of listModuleKeys()) {
|
|
213
|
+
const def = PLATFORM_MODULE_CATALOG[key];
|
|
214
|
+
for (const m of def.allowance_metrics) {
|
|
215
|
+
if (m.metric === metric) return key;
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
return hasOwn(NEX_VENDAS_PACKAGE_METRIC_MODULE, metric) ? NEX_VENDAS_PACKAGE_METRIC_MODULE[metric] : null;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
/** Rótulo do módulo para o cliente (mapa do cliente → catálogo → chave). */
|
|
222
|
+
export function getPackageModuleLabel(key: string): string {
|
|
223
|
+
if (hasOwn(NEX_VENDAS_PACKAGE_MODULE_LABELS, key)) return NEX_VENDAS_PACKAGE_MODULE_LABELS[key];
|
|
224
|
+
const def = getModuleDefinition(key);
|
|
225
|
+
return def ? def.label : key;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
/** Inteiro com separador de milhar pt-BR ("1.000"). */
|
|
229
|
+
function formatInt(n: number): string {
|
|
230
|
+
const neg = n < 0;
|
|
231
|
+
const digits = String(Math.abs(Math.trunc(n)));
|
|
232
|
+
let out = '';
|
|
233
|
+
for (let i = 0; i < digits.length; i++) {
|
|
234
|
+
if (i > 0 && (digits.length - i) % 3 === 0) out += '.';
|
|
235
|
+
out += digits[i];
|
|
236
|
+
}
|
|
237
|
+
return neg ? `-${out}` : out;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
/** "R$ 1,45" / "R$ 1.234,50" — determinístico, sem depender do ICU do runtime. */
|
|
241
|
+
export function formatPackageBRL(amount: number): string {
|
|
242
|
+
const cents = Math.round(Math.abs(amount) * 100);
|
|
243
|
+
const reais = Math.floor(cents / 100);
|
|
244
|
+
const rest = cents % 100;
|
|
245
|
+
const sign = amount < 0 && cents > 0 ? '-' : '';
|
|
246
|
+
return `${sign}R$ ${formatInt(reais)},${rest < 10 ? `0${rest}` : String(rest)}`;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
/** Texto por extenso da franquia ("100 atendimentos com a HubIA"). */
|
|
250
|
+
export function formatPackageAllowanceText(metric: string, included: number): string {
|
|
251
|
+
if (hasOwn(NEX_VENDAS_PACKAGE_ALLOWANCE_TEXT, metric)) {
|
|
252
|
+
const t = NEX_VENDAS_PACKAGE_ALLOWANCE_TEXT[metric];
|
|
253
|
+
return (included === 1 ? t.one : t.other).replace('{n}', formatInt(included));
|
|
254
|
+
}
|
|
255
|
+
const cat = (NexFinopsMetricCatalog as Record<string, { label: string; unit: string }>)[metric];
|
|
256
|
+
return `${cat ? cat.label : metric}: ${formatInt(included)}`;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
/** Unidade no singular para o texto do excedente ("atendimento com a HubIA"). */
|
|
260
|
+
function excessUnit(metric: string): string {
|
|
261
|
+
if (hasOwn(NEX_VENDAS_PACKAGE_ALLOWANCE_TEXT, metric)) {
|
|
262
|
+
return NEX_VENDAS_PACKAGE_ALLOWANCE_TEXT[metric].one.replace('{n}', '').trim();
|
|
263
|
+
}
|
|
264
|
+
const cat = (NexFinopsMetricCatalog as Record<string, { label: string; unit: string }>)[metric];
|
|
265
|
+
return cat ? cat.label : metric;
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
/** Posição de exibição da métrica: texto do pacote, depois catálogo, depois resto. */
|
|
269
|
+
function metricOrder(metric: string): number {
|
|
270
|
+
const textKeys = Object.keys(NEX_VENDAS_PACKAGE_ALLOWANCE_TEXT);
|
|
271
|
+
const i = textKeys.indexOf(metric);
|
|
272
|
+
if (i !== -1) return i;
|
|
273
|
+
const j = Object.keys(NexFinopsMetricCatalog).indexOf(metric);
|
|
274
|
+
return j !== -1 ? textKeys.length + j : Number.MAX_SAFE_INTEGER;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
/** Chaves dos módulos do pacote: catálogo em ordem, depois chaves fora do catálogo. */
|
|
278
|
+
function orderedModuleKeys(modules: Record<string, INexVendasPackageModule>): string[] {
|
|
279
|
+
const catalogKeys = listModuleKeys();
|
|
280
|
+
const out = catalogKeys.filter((k) => hasOwn(modules, k));
|
|
281
|
+
for (const k of Object.keys(modules)) {
|
|
282
|
+
if (out.indexOf(k) === -1) out.push(k);
|
|
283
|
+
}
|
|
284
|
+
return out;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
/**
|
|
288
|
+
* Projeção do pacote para exibir. Função PURA (sem Firestore): o backend resolve
|
|
289
|
+
* a tabela (`resolvePriceTableLines(tables, pkg.price_table_id)`) e chama; o
|
|
290
|
+
* shop/Nexus só exibem o resultado (`package_display`).
|
|
291
|
+
*
|
|
292
|
+
* - `resolved: null` (tabela não resolveu) ⇒ `excess` e `addons` vazios; o resto sai igual.
|
|
293
|
+
* - Excedente: só métrica com franquia APLICADA e linha `usage` resolvida
|
|
294
|
+
* (`disabled`/ausente não aparece). Teto por faixas (`cap`) não é exibido.
|
|
295
|
+
* - Adicionais: só módulo declarado `enabled: false` com linha `recurring` resolvida.
|
|
296
|
+
* - Sub-opções: capabilities efetivas (default do catálogo + override do pacote)
|
|
297
|
+
* que estão `true` e têm rótulo em `NEX_VENDAS_PACKAGE_CAPABILITY_LABELS`.
|
|
298
|
+
*/
|
|
299
|
+
export function buildPackageDisplay(input: {
|
|
300
|
+
pkg: INexVendasOfferPackage;
|
|
301
|
+
base_amount: number;
|
|
302
|
+
resolved: ResolvedPriceTable | null;
|
|
303
|
+
}): INexVendasPackageDisplay {
|
|
304
|
+
const { pkg, base_amount, resolved } = input;
|
|
305
|
+
const modules = pkg.modules ?? {};
|
|
306
|
+
|
|
307
|
+
const list = typeof pkg.list_amount === 'number' && isFinite(pkg.list_amount) ? pkg.list_amount : null;
|
|
308
|
+
const discount =
|
|
309
|
+
list !== null && list > 0 && list > base_amount ? Math.round(((list - base_amount) / list) * 100) : null;
|
|
310
|
+
|
|
311
|
+
const modules_included: INexVendasPackageDisplayModule[] = [];
|
|
312
|
+
const modules_excluded: INexVendasPackageDisplayExcludedModule[] = [];
|
|
313
|
+
const addons: INexVendasPackageDisplayAddon[] = [];
|
|
314
|
+
|
|
315
|
+
for (const key of orderedModuleKeys(modules)) {
|
|
316
|
+
const mod = modules[key];
|
|
317
|
+
if (!mod) continue;
|
|
318
|
+
const label = getPackageModuleLabel(key);
|
|
319
|
+
if (mod.enabled) {
|
|
320
|
+
const def = getModuleDefinition(key);
|
|
321
|
+
const effective: Record<string, boolean | number | string> = {};
|
|
322
|
+
if (def) {
|
|
323
|
+
for (const cap of Object.keys(def.capabilities)) effective[cap] = def.capabilities[cap].default;
|
|
324
|
+
}
|
|
325
|
+
const overrides = mod.capabilities ?? {};
|
|
326
|
+
for (const cap of Object.keys(overrides)) effective[cap] = overrides[cap];
|
|
327
|
+
const capLabels = hasOwn(NEX_VENDAS_PACKAGE_CAPABILITY_LABELS, key) ? NEX_VENDAS_PACKAGE_CAPABILITY_LABELS[key] : {};
|
|
328
|
+
const details: string[] = [];
|
|
329
|
+
for (const cap of Object.keys(capLabels)) {
|
|
330
|
+
if (effective[cap] === true) details.push(capLabels[cap]);
|
|
331
|
+
}
|
|
332
|
+
modules_included.push({ key, label, details });
|
|
333
|
+
} else {
|
|
334
|
+
modules_excluded.push({ key, label });
|
|
335
|
+
const line = resolved && hasOwn(resolved.lines, key) ? resolved.lines[key].line : null;
|
|
336
|
+
if (line && line.kind === 'recurring') addons.push({ key, label, amount: line.amount });
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
const applied = pkg.allowances ?? {};
|
|
341
|
+
const allowances: INexVendasPackageDisplayAllowanceItem[] = [];
|
|
342
|
+
for (const metric of Object.keys(applied)) {
|
|
343
|
+
const a = applied[metric];
|
|
344
|
+
if (!a) continue;
|
|
345
|
+
allowances.push({ metric, included: a.included, text: formatPackageAllowanceText(metric, a.included), applied: true });
|
|
346
|
+
}
|
|
347
|
+
for (const d of pkg.display_allowances ?? []) {
|
|
348
|
+
// Defesa: chave repetida com a aplicada é erro de escrita (backend); a aplicada vence.
|
|
349
|
+
if (hasOwn(applied, d.metric)) continue;
|
|
350
|
+
allowances.push({
|
|
351
|
+
metric: d.metric,
|
|
352
|
+
included: d.included,
|
|
353
|
+
text: formatPackageAllowanceText(d.metric, d.included),
|
|
354
|
+
applied: false,
|
|
355
|
+
});
|
|
356
|
+
}
|
|
357
|
+
// Ordenação estável por posição fixa (empate mantém a ordem de inserção).
|
|
358
|
+
const indexed = allowances.map((item, i) => ({ item, i }));
|
|
359
|
+
indexed.sort((x, y) => metricOrder(x.item.metric) - metricOrder(y.item.metric) || x.i - y.i);
|
|
360
|
+
const sortedAllowances = indexed.map((x) => x.item);
|
|
361
|
+
|
|
362
|
+
const excess: INexVendasPackageDisplayExcess[] = [];
|
|
363
|
+
if (resolved) {
|
|
364
|
+
for (const item of sortedAllowances) {
|
|
365
|
+
if (!item.applied || !hasOwn(resolved.lines, item.metric)) continue;
|
|
366
|
+
const line = resolved.lines[item.metric].line;
|
|
367
|
+
if (line.kind !== 'usage') continue;
|
|
368
|
+
excess.push({
|
|
369
|
+
metric: item.metric,
|
|
370
|
+
unit_price: line.unit_price,
|
|
371
|
+
text: `${formatPackageBRL(line.unit_price)} por ${excessUnit(item.metric)}`,
|
|
372
|
+
});
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
return {
|
|
377
|
+
list_amount: list,
|
|
378
|
+
discount_percent: discount,
|
|
379
|
+
modules_included,
|
|
380
|
+
modules_excluded,
|
|
381
|
+
allowances: sortedAllowances,
|
|
382
|
+
excess,
|
|
383
|
+
addons,
|
|
384
|
+
not_included: (pkg.not_included ?? []).slice(),
|
|
385
|
+
highlights: (pkg.highlights ?? []).slice(),
|
|
386
|
+
};
|
|
387
|
+
}
|
|
@@ -2,6 +2,7 @@ import type { IFireGlobalDoc } from '../shared';
|
|
|
2
2
|
import type { NexFinopsProposalLoyaltyPeriod, NexFinopsProposalOrigem, NexFinopsProposalPaymentMethod } from '../evo-finops/common/proposal';
|
|
3
3
|
import type { INexFinopsContractAllowance } from '../evo-finops/common/contract';
|
|
4
4
|
import type { NexVendasContractType } from './adhesion';
|
|
5
|
+
import type { INexVendasOfferPackage, INexVendasPackageDisplay } from './offer-package';
|
|
5
6
|
/**
|
|
6
7
|
* Origem de marketing do `start`, capturada pelo shop (query string + `document.referrer`)
|
|
7
8
|
* e gravada server-side, sem cookie, na proposta e na jornada. Cada campo é `null`
|
|
@@ -69,8 +70,16 @@ export interface INexVendasOffer extends IFireGlobalDoc {
|
|
|
69
70
|
contract_template_key: string;
|
|
70
71
|
/** Cópia DERIVADA do modelo (backend grava; valor do cliente HTTP é sobrescrito). */
|
|
71
72
|
contract_type?: NexVendasContractType | null;
|
|
72
|
-
/**
|
|
73
|
+
/**
|
|
74
|
+
* D12 — `null` na v1 (sem franquia).
|
|
75
|
+
* @deprecated feat-353 — usar `package.allowances`. Sempre null (o backend força).
|
|
76
|
+
*/
|
|
73
77
|
allowances: Record<string, INexFinopsContractAllowance> | null;
|
|
78
|
+
/**
|
|
79
|
+
* feat-353 — pacote comercial (módulos, franquias aplicadas × exibidas, tabela de
|
|
80
|
+
* preço, preço "de"). Ausente/null = oferta v1 (comportamento anterior).
|
|
81
|
+
*/
|
|
82
|
+
package?: INexVendasOfferPackage | null;
|
|
74
83
|
terms?: string | null;
|
|
75
84
|
/** D13 — `valid_until` da proposta = hoje (SP) + N dias. Padrão 7. */
|
|
76
85
|
proposal_valid_days: number;
|
|
@@ -103,6 +112,11 @@ export interface INexVendasOfferPublic {
|
|
|
103
112
|
contract_type: NexVendasContractType;
|
|
104
113
|
terms: string | null;
|
|
105
114
|
site: string;
|
|
115
|
+
/**
|
|
116
|
+
* feat-353 — pacote pronto para exibir (`buildPackageDisplay`, calculado no
|
|
117
|
+
* backend). Ausente/null = oferta sem pacote ou backend anterior à feat-353.
|
|
118
|
+
*/
|
|
119
|
+
package_display?: INexVendasPackageDisplay | null;
|
|
106
120
|
}
|
|
107
121
|
/** Vitrine: `GET /offers?site=…` lista as ofertas `active && listed` do site. */
|
|
108
122
|
export interface INexVendasOfferListPublic {
|