@credithub/harlan-components 1.93.0 → 1.94.0
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/@types/domain/index.d.ts +4 -5
- package/dist/components/dossie/generativeAi/dataUtils.js +26 -7
- package/dist/components/liminar/useLiminarProtestosDoPassado.d.ts +0 -18
- package/dist/components/liminar/useLiminarProtestosDoPassado.js +10 -5
- package/dist/components/protestosPagosBaixados/adaptToChart.d.ts +4 -0
- package/dist/components/protestosPagosBaixados/adaptToChart.js +86 -0
- package/dist/components/protestosPagosBaixados/index.d.ts +7 -1
- package/dist/components/protestosPagosBaixados/index.js +71 -24
- package/dist/consultaSimples.js +1 -1
- package/lib/cjs/index.js +419 -262
- package/lib/esm/index.js +419 -262
- package/package.json +1 -1
|
@@ -5,17 +5,16 @@ export type { Contact, ContactsState } from '@/@types/domain/contactsTypes';
|
|
|
5
5
|
export type { Divida, DividasPublicasState } from '@/@types/domain/dividasTypes';
|
|
6
6
|
export type { DocumentHistoryData } from '@/@types/domain/documentHistoryData';
|
|
7
7
|
export type { CarouselState, DossieState, SummaryState, TransactionTableState } from '@/@types/domain/dossieTypes';
|
|
8
|
-
export type {
|
|
8
|
+
export type { ImoveisConsultaResponse, IPTUItem } from '@/@types/domain/imoveisTypes';
|
|
9
9
|
export type { LiminarResponse } from '@/@types/domain/liminarTypes';
|
|
10
10
|
export type { Partner, PartnersState } from '@/@types/domain/partnersTypes';
|
|
11
11
|
export type { PepData, PepState } from '@/@types/domain/pepTypes';
|
|
12
12
|
export type { EnvolvidoUltimaMovimentacao, ProcessoJuridicoResume, ProcessosJuridicosState } from '@/@types/domain/processosJuridicosTypes';
|
|
13
|
+
export type { ProtestoHistoricoItem, ProtestoHistoricoResponse, ProtestosPagosBaixadosState } from '@/@types/domain/protestosPagosBaixadosTypes';
|
|
13
14
|
export type { ProtestoData, ProtestosState } from '@/@types/domain/protestosTypes';
|
|
14
15
|
export type { ReclameAquiResponse, ReclameAquiState } from '@/@types/domain/reclameAquiTypes';
|
|
15
16
|
export type { RefinBoaVistaResponse, RefinBoaVistaState, Spc } from '@/@types/domain/refinBoaVistaTypes';
|
|
16
17
|
export type { PefinRefinSerasaResponse, RefinSerasaState } from '@/@types/domain/refinSerasaTypes';
|
|
17
|
-
export type { ScoreResponse, ScoreState } from '@/@types/domain/scoreTypes';
|
|
18
|
-
export type { RegistroVeiculo, VeiculosState } from '@/@types/domain/veiculosTypes';
|
|
18
|
+
export type { ScoreResponse, ScoreSerasaState, ScoreState } from '@/@types/domain/scoreTypes';
|
|
19
19
|
export type { SCRState } from '@/@types/domain/scrTypes';
|
|
20
|
-
export type {
|
|
21
|
-
export type { ProtestosPagosBaixadosState } from '@/@types/domain/protestosPagosBaixadosTypes';
|
|
20
|
+
export type { RegistroVeiculo, VeiculosState } from '@/@types/domain/veiculosTypes';
|
|
@@ -95,13 +95,12 @@ function deepCleanData(data) {
|
|
|
95
95
|
// Main normaliser --------------------------------------------------------------
|
|
96
96
|
// -----------------------------------------------------------------------------
|
|
97
97
|
export var selectRelevantData = function (data) {
|
|
98
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
99
|
-
var
|
|
100
|
-
;
|
|
98
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
99
|
+
var _m = data || {}, protestosNumero = _m.protestos, ccfNumero = _m.ccf, dividasPublicas = _m.dividasPublicas, contasBancarias = _m.bankAccounts, ccfData = _m.ccfData, dividas = _m.divida, _o = _m.dossie, dossie = _o === void 0 ? {} : _o, liminar = _m.liminar, socios = _m.partners, dadosPessoasExpostasPoliticamente = _m.pepData, detalhesProcessosJuridicos = _m.processosJuridicosData, dadosReclameAqui = _m.reclameAqui, refinBoaVista = _m.refinBoaVista, refinSerasa = _m.refinSerasa, dadosScore = _m.scoreData, _p = _m.scr, scr = _p === void 0 ? { isLoaded: false } : _p, _q = _m.veiculos, veiculos = _q === void 0 ? [] : _q, ResumoDosDados = _m.documentHistory, insolvencia = _m.insolvencia, consulta = _m.protestosPagosBaixados;
|
|
101
100
|
// ────────────────────────────────────────────────
|
|
102
101
|
// 1. Protestos – somente a entrada mais recente
|
|
103
102
|
// ────────────────────────────────────────────────
|
|
104
|
-
var
|
|
103
|
+
var _r = ResumoDosDados !== null && ResumoDosDados !== void 0 ? ResumoDosDados : {}, _omit = _r.protestoLiminar, ResumoSafe = __rest(_r, ["protestoLiminar"]);
|
|
105
104
|
var protestosData = [];
|
|
106
105
|
if (Array.isArray(ResumoSafe === null || ResumoSafe === void 0 ? void 0 : ResumoSafe.protestoHistory) &&
|
|
107
106
|
ResumoSafe.protestoHistory.length) {
|
|
@@ -169,12 +168,31 @@ export var selectRelevantData = function (data) {
|
|
|
169
168
|
? 'Registro de falência encontrado'
|
|
170
169
|
: undefined;
|
|
171
170
|
// ────────────────────────────────────────────────
|
|
171
|
+
// 5. Protestos pagos e baixados
|
|
172
|
+
// ────────────────────────────────────────────────
|
|
173
|
+
var protestosPagosBaixadosResumo = ((_j = consulta === null || consulta === void 0 ? void 0 : consulta.protestos) === null || _j === void 0 ? void 0 : _j.length)
|
|
174
|
+
? (function () {
|
|
175
|
+
var _a, _b;
|
|
176
|
+
var qtd = consulta.protestos.length;
|
|
177
|
+
var total = consulta.protestos.reduce(function (s, p) {
|
|
178
|
+
return s + (Number(p.valor) || Number(p.valorProtestado) || 0);
|
|
179
|
+
}, 0);
|
|
180
|
+
var datas = consulta.protestos
|
|
181
|
+
.map(function (p) { return new Date(p.dataProtesto || p.data); })
|
|
182
|
+
.filter(function (d) { return !isNaN(d.getTime()); })
|
|
183
|
+
.sort(function (a, b) { return a.getTime() - b.getTime(); });
|
|
184
|
+
var inicio = (_a = datas[0]) === null || _a === void 0 ? void 0 : _a.toISOString().slice(0, 10);
|
|
185
|
+
var fim = (_b = datas[datas.length - 1]) === null || _b === void 0 ? void 0 : _b.toISOString().slice(0, 10);
|
|
186
|
+
return "Foram encontrados ".concat(qtd, " protestos pagos/baixados, total aproximado R$ ").concat(total.toFixed(2), ", entre ").concat(inicio, " e ").concat(fim);
|
|
187
|
+
})()
|
|
188
|
+
: undefined;
|
|
189
|
+
// ────────────────────────────────────────────────
|
|
172
190
|
// 6. Construção final
|
|
173
191
|
// ────────────────────────────────────────────────
|
|
174
192
|
var dadosOrganizados = {
|
|
175
193
|
protestosData: protestosData,
|
|
176
|
-
quantidadeProtestos: (
|
|
177
|
-
ccf: (
|
|
194
|
+
quantidadeProtestos: (_k = ResumoSafe === null || ResumoSafe === void 0 ? void 0 : ResumoSafe.quantidadeProtestos) !== null && _k !== void 0 ? _k : protestosData.length,
|
|
195
|
+
ccf: (_l = ccfNumero !== null && ccfNumero !== void 0 ? ccfNumero : ResumoSafe === null || ResumoSafe === void 0 ? void 0 : ResumoSafe.quantidadeChequesSemFundos) !== null && _l !== void 0 ? _l : 0,
|
|
178
196
|
ccfData: ccfData !== null && ccfData !== void 0 ? ccfData : {},
|
|
179
197
|
dividasPublicas: dividasPublicas,
|
|
180
198
|
liminar: liminarInfo,
|
|
@@ -192,7 +210,8 @@ export var selectRelevantData = function (data) {
|
|
|
192
210
|
dadosScore: dadosScore,
|
|
193
211
|
ResumoDosDados: ResumoSafe,
|
|
194
212
|
tipoPessoa: tipoPessoa,
|
|
195
|
-
insolvencia: insolvenciaInfo
|
|
213
|
+
insolvencia: insolvenciaInfo,
|
|
214
|
+
protestosPagosBaixados: protestosPagosBaixadosResumo
|
|
196
215
|
};
|
|
197
216
|
var dadosFiltrados = deepCleanData(dadosOrganizados);
|
|
198
217
|
return { dadosFiltrados: dadosFiltrados };
|
|
@@ -2,24 +2,6 @@ interface LiminarProtestosDoPassadoProps {
|
|
|
2
2
|
/** CNPJ/CPF analisado para detectar instrumentos de protesto que sumiram do CENPROT */
|
|
3
3
|
documento: string;
|
|
4
4
|
}
|
|
5
|
-
export interface ProtestoHistoricoItem {
|
|
6
|
-
cpfCnpj: string;
|
|
7
|
-
data: string;
|
|
8
|
-
dataProtesto: string;
|
|
9
|
-
valor: number;
|
|
10
|
-
valorProtestado: number;
|
|
11
|
-
temAnuencia: boolean;
|
|
12
|
-
nomeApresentante: string | null;
|
|
13
|
-
nomeCedente: string | null;
|
|
14
|
-
chave: string;
|
|
15
|
-
creation: string;
|
|
16
|
-
custas: number;
|
|
17
|
-
missingAt: string;
|
|
18
|
-
protestoProvavelmenteExpirado: boolean;
|
|
19
|
-
}
|
|
20
|
-
export interface ProtestoHistoricoResponse {
|
|
21
|
-
[key: string]: ProtestoHistoricoItem[];
|
|
22
|
-
}
|
|
23
5
|
/**
|
|
24
6
|
* Hook que identifica indícios de liminar de sustação de protesto.
|
|
25
7
|
*
|
|
@@ -45,11 +45,11 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
45
45
|
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
46
46
|
}
|
|
47
47
|
};
|
|
48
|
+
import { useGlobalData } from '../../contexts/globalDataContext';
|
|
49
|
+
import PostHogContext from '../../contexts/PostHogContext';
|
|
48
50
|
import { Client } from '@credithub/webservice';
|
|
49
51
|
import { useCallback, useContext } from 'react';
|
|
50
52
|
import { WebService } from '../webservice';
|
|
51
|
-
import { useGlobalData } from '../../contexts/globalDataContext';
|
|
52
|
-
import PostHogContext from '../../contexts/PostHogContext';
|
|
53
53
|
/**
|
|
54
54
|
* Hook que identifica indícios de liminar de sustação de protesto.
|
|
55
55
|
*
|
|
@@ -101,7 +101,7 @@ var useLiminarProtestosDoPassado = function (_a) {
|
|
|
101
101
|
});
|
|
102
102
|
}); };
|
|
103
103
|
var fetch = useCallback(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
104
|
-
var data, parsedData, _a, _b, numerosChave, ocultos, running, idx, launch, _loop_1;
|
|
104
|
+
var data, parsedData, _a, _b, numerosChave, ocultos, running, idx, launch, _loop_1, protestosDoPassado;
|
|
105
105
|
return __generator(this, function (_c) {
|
|
106
106
|
switch (_c.label) {
|
|
107
107
|
case 0: return [4 /*yield*/, client.request("SELECT FROM 'Protestos'.'History'", {
|
|
@@ -113,7 +113,9 @@ var useLiminarProtestosDoPassado = function (_a) {
|
|
|
113
113
|
return [4 /*yield*/, Client.WebService.parse(data)];
|
|
114
114
|
case 2:
|
|
115
115
|
parsedData = _b.apply(_a, [(_c.sent())]).flat();
|
|
116
|
-
numerosChave = parsedData
|
|
116
|
+
numerosChave = parsedData
|
|
117
|
+
.filter(function (item) { return item.missingAt; })
|
|
118
|
+
.map(function (item) { return item.chave; });
|
|
117
119
|
ocultos = [];
|
|
118
120
|
running = [];
|
|
119
121
|
idx = 0;
|
|
@@ -149,9 +151,12 @@ var useLiminarProtestosDoPassado = function (_a) {
|
|
|
149
151
|
_c.label = 5;
|
|
150
152
|
case 5: return [3 /*break*/, 3];
|
|
151
153
|
case 6:
|
|
154
|
+
protestosDoPassado = parsedData
|
|
155
|
+
.filter(function (item) { return item.missingAt; })
|
|
156
|
+
.filter(function (item) { return !ocultos.includes(item.chave); });
|
|
152
157
|
setData(function (prev) { return (__assign(__assign({}, prev), { protestosPagosBaixados: {
|
|
153
158
|
isLoaded: true,
|
|
154
|
-
protestos:
|
|
159
|
+
protestos: protestosDoPassado
|
|
155
160
|
} })); });
|
|
156
161
|
if (ocultos.length > 0 && posthog) {
|
|
157
162
|
posthog.capture('liminar_protestos_ocultos', {
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ProtestoHistoricoItem } from '@/@types/domain/protestosPagosBaixadosTypes';
|
|
2
|
+
import type { Consulta } from '../../components/chart/types/iChart';
|
|
3
|
+
export declare function adaptToUI(items: ProtestoHistoricoItem[]): ProtestoHistoricoItem[];
|
|
4
|
+
export declare function buildChartSeries(items: ProtestoHistoricoItem[]): Consulta[];
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
// Pré-compila regexes fora do hot path
|
|
13
|
+
var ISO_RE = /^\d{4}-\d{2}-\d{2}/;
|
|
14
|
+
var BR_RE = /^(\d{2})\/(\d{2})\/(\d{4})/;
|
|
15
|
+
export function adaptToUI(items) {
|
|
16
|
+
// Se realmente não quiser adaptar nada, pode remover esta função e usar items direto.
|
|
17
|
+
// Aqui normalizo datas vazias para string vazia e default para campos opcionais.
|
|
18
|
+
return items.map(function (i) {
|
|
19
|
+
var _a, _b, _c, _d, _e;
|
|
20
|
+
return (__assign(__assign({}, i), { dataProtesto: (_b = (_a = i.dataProtesto) !== null && _a !== void 0 ? _a : i.data) !== null && _b !== void 0 ? _b : '', nomeCedente: (_c = i.nomeCedente) !== null && _c !== void 0 ? _c : '', nomeApresentante: (_d = i.nomeApresentante) !== null && _d !== void 0 ? _d : '', valor: Number.isFinite(i.valor)
|
|
21
|
+
? i.valor
|
|
22
|
+
: safeNumber((_e = i.valor) !== null && _e !== void 0 ? _e : i.valorProtestado), custas: Number.isFinite(i.custas)
|
|
23
|
+
? i.custas
|
|
24
|
+
: safeNumber(i.custas) }));
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
export function buildChartSeries(items) {
|
|
28
|
+
var bucket = items.reduce(function (acc, item) {
|
|
29
|
+
var _a;
|
|
30
|
+
var date = toYMD(item.dataProtesto);
|
|
31
|
+
if (!date)
|
|
32
|
+
return acc;
|
|
33
|
+
var valor = safeNumber((_a = item.valor) !== null && _a !== void 0 ? _a : item.valorProtestado);
|
|
34
|
+
var curr = acc.get(date);
|
|
35
|
+
if (curr) {
|
|
36
|
+
curr.quantidade += 1;
|
|
37
|
+
curr.valorTotal += valor;
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
acc.set(date, { quantidade: 1, valorTotal: valor });
|
|
41
|
+
}
|
|
42
|
+
return acc;
|
|
43
|
+
}, new Map());
|
|
44
|
+
return Array.from(bucket.entries())
|
|
45
|
+
.map(function (_a) {
|
|
46
|
+
var data = _a[0], _b = _a[1], quantidade = _b.quantidade, valorTotal = _b.valorTotal;
|
|
47
|
+
return ({
|
|
48
|
+
data: data,
|
|
49
|
+
quantidade: quantidade,
|
|
50
|
+
valorTotal: valorTotal
|
|
51
|
+
});
|
|
52
|
+
})
|
|
53
|
+
.sort(function (a, b) { return a.data.localeCompare(b.data); });
|
|
54
|
+
}
|
|
55
|
+
/** Converte várias entradas de data para 'YYYY-MM-DD' em UTC sem viés de timezone local. */
|
|
56
|
+
function toYMD(input) {
|
|
57
|
+
if (!input)
|
|
58
|
+
return null;
|
|
59
|
+
if (ISO_RE.test(input)) {
|
|
60
|
+
// Evita variação de timezone ao reinterpretar; corta direto yyyy-mm-dd
|
|
61
|
+
return input.slice(0, 10);
|
|
62
|
+
}
|
|
63
|
+
var br = input.match(BR_RE);
|
|
64
|
+
if (br) {
|
|
65
|
+
var dd = br[1], mm = br[2], yyyy = br[3];
|
|
66
|
+
var ts_1 = Date.UTC(Number(yyyy), Number(mm) - 1, Number(dd));
|
|
67
|
+
return Number.isNaN(ts_1) ? null : new Date(ts_1).toISOString().slice(0, 10);
|
|
68
|
+
}
|
|
69
|
+
// Fallback: tenta Date.parse em UTC padronizando com 'Z' quando faltar
|
|
70
|
+
var ts = Date.parse(input.endsWith('Z') ? input : "".concat(input, "Z"));
|
|
71
|
+
return Number.isNaN(ts) ? null : new Date(ts).toISOString().slice(0, 10);
|
|
72
|
+
}
|
|
73
|
+
function safeNumber(value) {
|
|
74
|
+
if (typeof value === 'number' && Number.isFinite(value))
|
|
75
|
+
return value;
|
|
76
|
+
if (typeof value === 'string') {
|
|
77
|
+
// Remove moeda, espaços, separador de milhar e normaliza vírgula para ponto
|
|
78
|
+
var cleaned = value
|
|
79
|
+
.replace(/[^\d,.-]/g, '') // mantém dígitos, vírgula, ponto, sinal
|
|
80
|
+
.replace(/\.(?=\d{3}(?:\D|$))/g, '') // remove ponto de milhar
|
|
81
|
+
.replace(',', '.'); // vírgula decimal
|
|
82
|
+
var n = Number(cleaned);
|
|
83
|
+
return Number.isFinite(n) ? n : 0;
|
|
84
|
+
}
|
|
85
|
+
return 0;
|
|
86
|
+
}
|
|
@@ -1,3 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
2
|
+
interface ProtestosPagosBaixadosProps {
|
|
3
|
+
/**
|
|
4
|
+
* Se verdadeiro, exibe apenas para instituições financeiras
|
|
5
|
+
*/
|
|
6
|
+
isFinancial?: boolean;
|
|
7
|
+
}
|
|
8
|
+
declare const ProtestosPagosBaixados: React.FC<ProtestosPagosBaixadosProps>;
|
|
3
9
|
export default ProtestosPagosBaixados;
|
|
@@ -1,38 +1,85 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
4
12
|
import ProtestosIcon from '../../assets/icones/protestos';
|
|
5
13
|
import { useGlobalData } from '../../contexts/globalDataContext';
|
|
6
|
-
import { ResultContent } from '../interface/result';
|
|
7
|
-
import AddItemField from '../common/addItem';
|
|
8
|
-
import { formatDocument } from '../../utils/string';
|
|
9
14
|
import { formatMoney } from '../../utils/number';
|
|
15
|
+
import { formatDocument } from '../../utils/string';
|
|
16
|
+
import React, { useEffect, useMemo, useRef } from 'react';
|
|
17
|
+
import AddItemField from '../common/addItem';
|
|
18
|
+
import { ResultContent } from '../interface/result';
|
|
10
19
|
import StatusMessage from '../interface/statusMessage';
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
20
|
+
import Section from '../section';
|
|
21
|
+
import { RequestStatus } from '../webservice';
|
|
22
|
+
import { adaptToUI, buildChartSeries } from './adaptToChart';
|
|
23
|
+
var ProtestosPagosBaixados = function (_a) {
|
|
24
|
+
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
25
|
+
var _p = _a.isFinancial, isFinancial = _p === void 0 ? false : _p;
|
|
26
|
+
var _q = useGlobalData(), data = _q.data, setData = _q.setData;
|
|
27
|
+
if (!isFinancial)
|
|
28
|
+
return null;
|
|
29
|
+
var items = ((_b = data === null || data === void 0 ? void 0 : data.protestosPagosBaixados) === null || _b === void 0 ? void 0 : _b.protestos) || [];
|
|
30
|
+
var signature = useMemo(function () {
|
|
31
|
+
if (!items.length)
|
|
32
|
+
return '';
|
|
33
|
+
return items
|
|
34
|
+
.map(function (i) {
|
|
35
|
+
var _a, _b, _c, _d;
|
|
36
|
+
var dataKey = (_b = (_a = i.dataProtesto) !== null && _a !== void 0 ? _a : i.data) !== null && _b !== void 0 ? _b : '';
|
|
37
|
+
var v = String((_d = (_c = i.valor) !== null && _c !== void 0 ? _c : i.valorProtestado) !== null && _d !== void 0 ? _d : '');
|
|
38
|
+
return "".concat(i.chave, "|").concat(dataKey, "|").concat(v);
|
|
39
|
+
})
|
|
40
|
+
.join(';');
|
|
41
|
+
}, [items]);
|
|
42
|
+
var series = useMemo(function () { return (items.length ? buildChartSeries(items) : []); }, [items]);
|
|
43
|
+
var lastSignatureRef = useRef('');
|
|
44
|
+
useEffect(function () {
|
|
45
|
+
if (!items.length)
|
|
46
|
+
return;
|
|
47
|
+
if (signature === lastSignatureRef.current)
|
|
48
|
+
return;
|
|
49
|
+
setData(function (prev) {
|
|
50
|
+
var _a, _b, _c, _d;
|
|
51
|
+
return (__assign(__assign({}, prev), { protestosPagosBaixados: {
|
|
52
|
+
isLoaded: (_b = (_a = prev === null || prev === void 0 ? void 0 : prev.protestosPagosBaixados) === null || _a === void 0 ? void 0 : _a.isLoaded) !== null && _b !== void 0 ? _b : true,
|
|
53
|
+
protestos: ((_d = (_c = prev === null || prev === void 0 ? void 0 : prev.protestosPagosBaixados) === null || _c === void 0 ? void 0 : _c.protestos) === null || _d === void 0 ? void 0 : _d.length)
|
|
54
|
+
? prev.protestosPagosBaixados.protestos
|
|
55
|
+
: items,
|
|
56
|
+
consulta: series
|
|
57
|
+
} }));
|
|
58
|
+
});
|
|
59
|
+
lastSignatureRef.current = signature;
|
|
60
|
+
}, [items, series, setData, signature]);
|
|
14
61
|
return (React.createElement(Section, { ctx: {
|
|
15
|
-
type: ((
|
|
62
|
+
type: ((_c = data === null || data === void 0 ? void 0 : data.protestosPagosBaixados) === null || _c === void 0 ? void 0 : _c.isLoaded)
|
|
63
|
+
? RequestStatus.Success
|
|
64
|
+
: RequestStatus.Loading,
|
|
16
65
|
error: null,
|
|
17
66
|
response: undefined,
|
|
18
67
|
refetch: function () { },
|
|
19
68
|
document: '',
|
|
20
69
|
Section: Section,
|
|
21
|
-
progress: 90
|
|
22
|
-
}, title: "Protestos pagos e/ou baixados", subtitle: "Protestos pagos e/ou baixados", description: React.createElement(StatusMessage, { type: ((
|
|
70
|
+
progress: 90
|
|
71
|
+
}, title: "Protestos pagos e/ou baixados", subtitle: "Protestos pagos e/ou baixados", description: React.createElement(StatusMessage, { type: ((_e = (_d = data === null || data === void 0 ? void 0 : data.protestosPagosBaixados) === null || _d === void 0 ? void 0 : _d.protestos) === null || _e === void 0 ? void 0 : _e.length)
|
|
72
|
+
? 'error'
|
|
73
|
+
: 'default' }, !((_g = (_f = data === null || data === void 0 ? void 0 : data.protestosPagosBaixados) === null || _f === void 0 ? void 0 : _f.protestos) === null || _g === void 0 ? void 0 : _g.length)
|
|
23
74
|
? 'Não foram encontradas ocorrências'
|
|
24
|
-
: ((
|
|
75
|
+
: ((_j = (_h = data === null || data === void 0 ? void 0 : data.protestosPagosBaixados) === null || _h === void 0 ? void 0 : _h.protestos) === null || _j === void 0 ? void 0 : _j.length) === 1
|
|
25
76
|
? 'Foi encontrado um protesto'
|
|
26
|
-
: "Foram encontrados ".concat((
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
React.createElement(AddItemField, { name: "Possui Anu\u00EAncia / Protesto Pago", value: protesto.temAnuencia ? 'Sim' : 'Não' }),
|
|
34
|
-
React.createElement(AddItemField, { name: "Valor Do Protesto", value: formatMoney(protesto.valor) }),
|
|
35
|
-
protesto.custas && (React.createElement(AddItemField, { name: "Custas de Cart\u00F3rio para Baixa", value: formatMoney(protesto.custas) })))); })));
|
|
36
|
-
} }));
|
|
77
|
+
: "Foram encontrados ".concat((_l = (_k = data === null || data === void 0 ? void 0 : data.protestosPagosBaixados) === null || _k === void 0 ? void 0 : _k.protestos) === null || _l === void 0 ? void 0 : _l.length, " protestos")), variant: ((_o = (_m = data === null || data === void 0 ? void 0 : data.protestosPagosBaixados) === null || _m === void 0 ? void 0 : _m.protestos) === null || _o === void 0 ? void 0 : _o.length) ? 'error' : 'default', icon: ProtestosIcon, onSuccess: function () { return (React.createElement("div", null, adaptToUI(items).map(function (protesto) { return (React.createElement(ResultContent, { key: protesto.chave, print: "repeat(7, 1fr)", desktop: "repeat(8, 1fr)", tablet: "repeat(4, 1fr)", mobile: "repeat(2, 1fr)" },
|
|
78
|
+
React.createElement(AddItemField, { name: "Quem Protestou", value: protesto.nomeCedente }),
|
|
79
|
+
React.createElement(AddItemField, { name: "Atrav\u00E9s De", value: protesto.nomeApresentante }),
|
|
80
|
+
React.createElement(AddItemField, { name: "CPF/CNPJ Protestado", value: formatDocument(protesto.cpfCnpj) }),
|
|
81
|
+
React.createElement(AddItemField, { name: "Data Do Protesto", value: protesto.dataProtesto }),
|
|
82
|
+
React.createElement(AddItemField, { name: "Possui Anu\u00EAncia / Protesto Pago", value: protesto.temAnuencia ? 'Sim' : 'Não' }),
|
|
83
|
+
React.createElement(AddItemField, { name: "Valor Do Protesto", value: formatMoney(protesto.valor) }))); }))); } }));
|
|
37
84
|
};
|
|
38
85
|
export default ProtestosPagosBaixados;
|
package/dist/consultaSimples.js
CHANGED
|
@@ -95,7 +95,7 @@ var ConsultaSimples = function (_a) {
|
|
|
95
95
|
React.createElement(Veiculos, { documento: documento })),
|
|
96
96
|
React.createElement(ProtestosSP, null),
|
|
97
97
|
React.createElement(Protestos, null),
|
|
98
|
-
React.createElement(ProtestosPagosBaixados,
|
|
98
|
+
React.createElement(ProtestosPagosBaixados, { isFinancial: isFinancial }),
|
|
99
99
|
React.createElement(CCF, null),
|
|
100
100
|
React.createElement(DividasPublicas, null),
|
|
101
101
|
React.createElement(ProcessosJuridicos, { onClickConsultarProcessoJuridico: onClickConsultarProcessoJuridico }))))))))))))))),
|