@credithub/harlan-components 1.7.0 → 1.8.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/lib/cjs/components/consultasComplementares.d.ts +1 -0
- package/lib/cjs/components/consultasComplementares.js +3 -0
- package/lib/cjs/components/dossie/summary/summary.js +6 -4
- package/lib/cjs/components/veiculos/types.d.ts +0 -0
- package/lib/cjs/components/veiculos/types.js +0 -0
- package/lib/cjs/components/veiculos/veiculos.d.ts +22 -0
- package/lib/cjs/components/veiculos/veiculos.js +93 -0
- package/lib/cjs/consultaSimples.js +2 -1
- package/lib/cjs/index.d.ts +1 -0
- package/lib/cjs/index.js +3 -1
- package/lib/cjs/utils/xpath.d.ts +1 -0
- package/lib/cjs/utils/xpath.js +4 -0
- package/lib/esm/components/consultasComplementares.d.ts +1 -0
- package/lib/esm/components/consultasComplementares.js +3 -0
- package/lib/esm/components/dossie/summary/summary.js +6 -4
- package/lib/esm/components/veiculos/types.d.ts +0 -0
- package/lib/esm/components/veiculos/types.js +0 -0
- package/lib/esm/components/veiculos/veiculos.d.ts +22 -0
- package/lib/esm/components/veiculos/veiculos.js +65 -0
- package/lib/esm/consultaSimples.js +3 -2
- package/lib/esm/index.d.ts +1 -0
- package/lib/esm/index.js +1 -0
- package/lib/esm/utils/xpath.d.ts +1 -0
- package/lib/esm/utils/xpath.js +4 -0
- package/package.json +1 -1
|
@@ -9,6 +9,7 @@ type QueryType<DataType = any> = {
|
|
|
9
9
|
data?: ParsedResponse<DataType> | null;
|
|
10
10
|
};
|
|
11
11
|
type ConsultasComplementaresProps = {
|
|
12
|
+
veiculos: QueryType;
|
|
12
13
|
refinSerasa: QueryType<PefinRefinSerasaResponse>;
|
|
13
14
|
refinBoaVista: QueryType<RefinBoaVistaResponse>;
|
|
14
15
|
scoreBoaVista: QueryType<ScoreResponse>;
|
|
@@ -42,6 +42,9 @@ var ConsultasComplementaresProvider = function (_a) {
|
|
|
42
42
|
imoveis: {
|
|
43
43
|
consultaRealizada: false,
|
|
44
44
|
},
|
|
45
|
+
veiculos: {
|
|
46
|
+
consultaRealizada: false,
|
|
47
|
+
},
|
|
45
48
|
hasCredits: hasCredits,
|
|
46
49
|
}), consultasComplementares = _b[0], setConsultasComplementares = _b[1];
|
|
47
50
|
return (react_1.default.createElement(exports.ConsultasComplementaresContext.Provider, { value: {
|
|
@@ -47,10 +47,10 @@ var string_1 = require("../../../utils/string");
|
|
|
47
47
|
var number_1 = require("../../../utils/number");
|
|
48
48
|
var consultasComplementares_1 = require("../../../components/consultasComplementares");
|
|
49
49
|
var Summary = function (_a) {
|
|
50
|
-
var _b, _c, _d, _e;
|
|
50
|
+
var _b, _c, _d, _e, _f;
|
|
51
51
|
var finderResponse = _a.finderResponse;
|
|
52
52
|
var consultasComplementaresContext = (0, react_1.useContext)(consultasComplementares_1.ConsultasComplementaresContext);
|
|
53
|
-
var
|
|
53
|
+
var _g = (consultasComplementaresContext && consultasComplementaresContext) || {}, consultasComplementares = _g.consultasComplementares, setConsultasComplementares = _g.setConsultasComplementares, hasCredits = _g.hasCredits;
|
|
54
54
|
var getField = function (path, formatter) {
|
|
55
55
|
var value = xpath_1.default.select("string(".concat(path, ")"), xpath_1.default.select("//cadastro", finderResponse)[0]);
|
|
56
56
|
return formatter ? formatter(value) : value;
|
|
@@ -71,7 +71,7 @@ var Summary = function (_a) {
|
|
|
71
71
|
: callback();
|
|
72
72
|
};
|
|
73
73
|
};
|
|
74
|
-
var
|
|
74
|
+
var _h = {
|
|
75
75
|
cards: [
|
|
76
76
|
{
|
|
77
77
|
title: getField("nome"),
|
|
@@ -238,13 +238,15 @@ var Summary = function (_a) {
|
|
|
238
238
|
{
|
|
239
239
|
title: "Consultar Veículos",
|
|
240
240
|
price: productsPrices === null || productsPrices === void 0 ? void 0 : productsPrices.veiculos,
|
|
241
|
+
onClick: handleOnClick('veiculos'),
|
|
242
|
+
hide: (_f = consultasComplementares === null || consultasComplementares === void 0 ? void 0 : consultasComplementares.veiculos) === null || _f === void 0 ? void 0 : _f.consultaRealizada
|
|
241
243
|
},
|
|
242
244
|
{
|
|
243
245
|
title: "Consultar SCR",
|
|
244
246
|
price: productsPrices === null || productsPrices === void 0 ? void 0 : productsPrices.scr,
|
|
245
247
|
},
|
|
246
248
|
],
|
|
247
|
-
}, cards =
|
|
249
|
+
}, cards = _h.cards, products = _h.products;
|
|
248
250
|
return (react_1.default.createElement("div", { className: (0, classnames_1.default)("container") },
|
|
249
251
|
react_1.default.createElement("div", { className: (0, classnames_1.default)("content", "summary-content") },
|
|
250
252
|
cards.map(function (card, index) { return (react_1.default.createElement(addItem_1.default, { key: index, name: card.header, value: card.title, className: (0, classnames_1.default)("field"), style: { display: "inline-block" } })); }),
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
declare function Veiculos({ documento }: {
|
|
3
|
+
documento: string;
|
|
4
|
+
}): React.JSX.Element | null;
|
|
5
|
+
export type PendenciaBoaVista = {
|
|
6
|
+
ocorrencia: string;
|
|
7
|
+
credor: string;
|
|
8
|
+
entrada: string;
|
|
9
|
+
vencimento: string;
|
|
10
|
+
valor: string;
|
|
11
|
+
informante: string;
|
|
12
|
+
contrato: string;
|
|
13
|
+
avalista: string;
|
|
14
|
+
cidade: string;
|
|
15
|
+
uf: string;
|
|
16
|
+
situacao: string;
|
|
17
|
+
orgaoemissor: string;
|
|
18
|
+
totalpendencias: string;
|
|
19
|
+
totalvalor: string;
|
|
20
|
+
categoria: string;
|
|
21
|
+
};
|
|
22
|
+
export default Veiculos;
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
|
+
if (k2 === undefined) k2 = k;
|
|
15
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
16
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
17
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
18
|
+
}
|
|
19
|
+
Object.defineProperty(o, k2, desc);
|
|
20
|
+
}) : (function(o, m, k, k2) {
|
|
21
|
+
if (k2 === undefined) k2 = k;
|
|
22
|
+
o[k2] = m[k];
|
|
23
|
+
}));
|
|
24
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
25
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
26
|
+
}) : function(o, v) {
|
|
27
|
+
o["default"] = v;
|
|
28
|
+
});
|
|
29
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
30
|
+
if (mod && mod.__esModule) return mod;
|
|
31
|
+
var result = {};
|
|
32
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
33
|
+
__setModuleDefault(result, mod);
|
|
34
|
+
return result;
|
|
35
|
+
};
|
|
36
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
37
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
38
|
+
};
|
|
39
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
|
+
/* eslint-disable react-hooks/exhaustive-deps */
|
|
41
|
+
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
42
|
+
var react_1 = __importStar(require("react"));
|
|
43
|
+
var header_1 = __importDefault(require("../interface/header"));
|
|
44
|
+
var addItem_1 = __importDefault(require("../common/addItem"));
|
|
45
|
+
var result_1 = require("../interface/result");
|
|
46
|
+
var consultasComplementares_1 = require("../consultasComplementares");
|
|
47
|
+
var webservice_1 = require("../webservice");
|
|
48
|
+
var classnames_1 = __importDefault(require("classnames"));
|
|
49
|
+
var string_1 = require("../../utils/string");
|
|
50
|
+
var xpath_1 = __importDefault(require("../../utils/xpath"));
|
|
51
|
+
function Veiculos(_a) {
|
|
52
|
+
var _b;
|
|
53
|
+
var _c, _d, _e;
|
|
54
|
+
var documento = _a.documento;
|
|
55
|
+
var consultasComplementaresContext = (0, react_1.useContext)(consultasComplementares_1.ConsultasComplementaresContext);
|
|
56
|
+
var _f = consultasComplementaresContext !== null && consultasComplementaresContext !== void 0 ? consultasComplementaresContext : {}, consultasComplementares = _f.consultasComplementares, setConsultasComplementares = _f.setConsultasComplementares;
|
|
57
|
+
var _g = (0, webservice_1.useQuery)("SELECT FROM 'VEICULOS'.'CONSULTA'", { documento: documento }, !!((_c = consultasComplementares === null || consultasComplementares === void 0 ? void 0 : consultasComplementares.veiculos) === null || _c === void 0 ? void 0 : _c.consultaRealizada)), response = _g.response, isLoading = _g.isLoading, error = _g.error;
|
|
58
|
+
var registros = (0, react_1.useMemo)(function () { return ((response === null || response === void 0 ? void 0 : response.document) && xpath_1.default.select('//veiculos/registro', response === null || response === void 0 ? void 0 : response.document) || []).map(string_1.addNoValueContent); }, [response]);
|
|
59
|
+
var veiculosRef = (0, react_1.useRef)(null);
|
|
60
|
+
var consultaVeiculosRealizada = (0, react_1.useMemo)(function () { var _a; return (_a = consultasComplementares === null || consultasComplementares === void 0 ? void 0 : consultasComplementares.veiculos) === null || _a === void 0 ? void 0 : _a.consultaRealizada; }, [(_d = consultasComplementares === null || consultasComplementares === void 0 ? void 0 : consultasComplementares.veiculos) === null || _d === void 0 ? void 0 : _d.consultaRealizada
|
|
61
|
+
]);
|
|
62
|
+
(0, react_1.useEffect)(function () {
|
|
63
|
+
var _a;
|
|
64
|
+
(_a = veiculosRef.current) === null || _a === void 0 ? void 0 : _a.scrollIntoView();
|
|
65
|
+
}, [consultaVeiculosRealizada]);
|
|
66
|
+
(0, react_1.useEffect)(function () {
|
|
67
|
+
response && setConsultasComplementares && setConsultasComplementares(function (prev) { return (__assign(__assign({}, prev), { veiculos: __assign(__assign({}, prev.veiculos), { data: response }) })); });
|
|
68
|
+
}, [response]);
|
|
69
|
+
if (!((_e = consultasComplementares === null || consultasComplementares === void 0 ? void 0 : consultasComplementares.veiculos) === null || _e === void 0 ? void 0 : _e.consultaRealizada))
|
|
70
|
+
return null;
|
|
71
|
+
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
72
|
+
react_1.default.createElement(header_1.default, { innerRef: veiculosRef, title: 'Ve\u00EDculos Registrados no CPF/CNPJ', subtitle: 'Informa\u00E7\u00F5es de Ve\u00EDculos Registrados no CPF/CNPJ', description: registros.length ? registros.length > 1 ? "Foram encontrados ".concat(registros.length, " ve\u00EDculos registrados no CPF/CNPJ") : 'Foi encontrato 1 veículo registrado no CPF/CNPJ' : 'Nenhum veículo encontrado', className: (0, classnames_1.default)((_b = {},
|
|
73
|
+
_b[webservice_1.headerStatus[webservice_1.RequestStatus.Loading]] = isLoading,
|
|
74
|
+
_b[webservice_1.headerStatus[webservice_1.RequestStatus.Error]] = error,
|
|
75
|
+
_b['gradient-error'] = registros.length,
|
|
76
|
+
_b)) }),
|
|
77
|
+
react_1.default.createElement(result_1.Result, null, registros.map(function (registro, i) { return (react_1.default.createElement("div", { key: i, className: "container" },
|
|
78
|
+
react_1.default.createElement("div", { className: "content" },
|
|
79
|
+
react_1.default.createElement(addItem_1.default, { name: 'Placa', value: xpath_1.default.getField('placa', registro) }),
|
|
80
|
+
react_1.default.createElement(addItem_1.default, { name: 'Munic\u00EDpio', value: xpath_1.default.getField('municipio', registro) }),
|
|
81
|
+
react_1.default.createElement(addItem_1.default, { name: 'Estado', value: xpath_1.default.getField('uf', registro) }),
|
|
82
|
+
react_1.default.createElement(addItem_1.default, { name: 'Renavam', value: xpath_1.default.getField('renavam', registro) }),
|
|
83
|
+
react_1.default.createElement(addItem_1.default, { name: 'Chassi', value: xpath_1.default.getField('chassi', registro) }),
|
|
84
|
+
react_1.default.createElement(addItem_1.default, { name: 'Motor', value: xpath_1.default.getField('motor', registro) }),
|
|
85
|
+
react_1.default.createElement(addItem_1.default, { name: 'Ano de Fabrica\u00E7\u00E3o', value: xpath_1.default.getField('ano_fabricacao', registro) }),
|
|
86
|
+
react_1.default.createElement(addItem_1.default, { name: 'Ano do Modelo', value: xpath_1.default.getField('ano_modelo', registro) }),
|
|
87
|
+
react_1.default.createElement(addItem_1.default, { name: 'Marca / Modelo', value: xpath_1.default.getField('marca_modelo', registro) }),
|
|
88
|
+
react_1.default.createElement(addItem_1.default, { name: 'Proced\u00EAncia', value: xpath_1.default.getField('procedencia', registro) }),
|
|
89
|
+
react_1.default.createElement(addItem_1.default, { name: 'Esp\u00E9cie', value: xpath_1.default.getField('especie', registro) }),
|
|
90
|
+
react_1.default.createElement(addItem_1.default, { name: 'Combust\u00EDvel', value: xpath_1.default.getField('combustivel', registro) }),
|
|
91
|
+
react_1.default.createElement(addItem_1.default, { name: 'Cor', value: xpath_1.default.getField('cor', registro) })))); }))));
|
|
92
|
+
}
|
|
93
|
+
exports.default = Veiculos;
|
|
@@ -27,7 +27,8 @@ var ConsultaSimples = function (_a) {
|
|
|
27
27
|
react_1.default.createElement(_1.RefinBoaVista, { documento: documento }),
|
|
28
28
|
react_1.default.createElement(_1.RefinSerasa, { documento: documento }),
|
|
29
29
|
react_1.default.createElement(scoreService_1.default, { documento: documento }),
|
|
30
|
-
react_1.default.createElement(imoveisService_1.default, { documento: documento })
|
|
30
|
+
react_1.default.createElement(imoveisService_1.default, { documento: documento }),
|
|
31
|
+
react_1.default.createElement(_1.Veiculos, { documento: documento })),
|
|
31
32
|
react_1.default.createElement(_1.Protestos, null),
|
|
32
33
|
react_1.default.createElement(_1.CCF, null),
|
|
33
34
|
react_1.default.createElement(_1.ProcessosJuridicos, { onClickConsultarProcessoJuridico: console.log })))))))));
|
package/lib/cjs/index.d.ts
CHANGED
|
@@ -19,3 +19,4 @@ export { default as DividasPublicas } from './components/dividasPublicas/dividas
|
|
|
19
19
|
export { default as PessoaPoliticamenteExposta } from './components/pep/pep';
|
|
20
20
|
export { default as RefinSerasa } from './components/refinSerasa/refinSerasa';
|
|
21
21
|
export { default as RefinBoaVista } from './components/refinBoaVista/refinBoaVista';
|
|
22
|
+
export { default as Veiculos } from './components/veiculos/veiculos';
|
package/lib/cjs/index.js
CHANGED
|
@@ -17,7 +17,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
17
17
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
18
18
|
};
|
|
19
19
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
-
exports.RefinBoaVista = exports.RefinSerasa = exports.PessoaPoliticamenteExposta = exports.DividasPublicas = exports.ConsultaSimples = exports.ResultWithoutInformation = exports.BankAccounts = exports.CustomChartSection = exports.Chart = exports.Addresses = exports.ProcessosJuridicos = exports.Dossie = exports.CCF = exports.Protestos = exports.Partners = exports.Contacts = exports.AddItemField = exports.Loading = exports.Header = exports.Section = void 0;
|
|
20
|
+
exports.Veiculos = exports.RefinBoaVista = exports.RefinSerasa = exports.PessoaPoliticamenteExposta = exports.DividasPublicas = exports.ConsultaSimples = exports.ResultWithoutInformation = exports.BankAccounts = exports.CustomChartSection = exports.Chart = exports.Addresses = exports.ProcessosJuridicos = exports.Dossie = exports.CCF = exports.Protestos = exports.Partners = exports.Contacts = exports.AddItemField = exports.Loading = exports.Header = exports.Section = void 0;
|
|
21
21
|
var section_1 = require("./components/interface/section");
|
|
22
22
|
Object.defineProperty(exports, "Section", { enumerable: true, get: function () { return __importDefault(section_1).default; } });
|
|
23
23
|
var header_1 = require("./components/interface/header");
|
|
@@ -59,3 +59,5 @@ var refinSerasa_1 = require("./components/refinSerasa/refinSerasa");
|
|
|
59
59
|
Object.defineProperty(exports, "RefinSerasa", { enumerable: true, get: function () { return __importDefault(refinSerasa_1).default; } });
|
|
60
60
|
var refinBoaVista_1 = require("./components/refinBoaVista/refinBoaVista");
|
|
61
61
|
Object.defineProperty(exports, "RefinBoaVista", { enumerable: true, get: function () { return __importDefault(refinBoaVista_1).default; } });
|
|
62
|
+
var veiculos_1 = require("./components/veiculos/veiculos");
|
|
63
|
+
Object.defineProperty(exports, "Veiculos", { enumerable: true, get: function () { return __importDefault(veiculos_1).default; } });
|
package/lib/cjs/utils/xpath.d.ts
CHANGED
package/lib/cjs/utils/xpath.js
CHANGED
|
@@ -7,6 +7,10 @@ var XPathUtils = /** @class */ (function () {
|
|
|
7
7
|
XPathUtils.select = function (expression, node) {
|
|
8
8
|
return webservice_1.xpath.select(expression, node);
|
|
9
9
|
};
|
|
10
|
+
XPathUtils.getField = function (path, documentNode, formatter) {
|
|
11
|
+
var value = XPathUtils.select("string(".concat(path, ")"), documentNode);
|
|
12
|
+
return formatter ? formatter(value) : value;
|
|
13
|
+
};
|
|
10
14
|
return XPathUtils;
|
|
11
15
|
}());
|
|
12
16
|
exports.default = XPathUtils;
|
|
@@ -9,6 +9,7 @@ type QueryType<DataType = any> = {
|
|
|
9
9
|
data?: ParsedResponse<DataType> | null;
|
|
10
10
|
};
|
|
11
11
|
type ConsultasComplementaresProps = {
|
|
12
|
+
veiculos: QueryType;
|
|
12
13
|
refinSerasa: QueryType<PefinRefinSerasaResponse>;
|
|
13
14
|
refinBoaVista: QueryType<RefinBoaVistaResponse>;
|
|
14
15
|
scoreBoaVista: QueryType<ScoreResponse>;
|
|
@@ -16,6 +16,9 @@ export var ConsultasComplementaresProvider = function (_a) {
|
|
|
16
16
|
imoveis: {
|
|
17
17
|
consultaRealizada: false,
|
|
18
18
|
},
|
|
19
|
+
veiculos: {
|
|
20
|
+
consultaRealizada: false,
|
|
21
|
+
},
|
|
19
22
|
hasCredits: hasCredits,
|
|
20
23
|
}), consultasComplementares = _b[0], setConsultasComplementares = _b[1];
|
|
21
24
|
return (React.createElement(ConsultasComplementaresContext.Provider, { value: {
|
|
@@ -18,10 +18,10 @@ import { formatCnpj, formatCpf } from "../../../utils/string";
|
|
|
18
18
|
import { formatMoney } from "../../../utils/number";
|
|
19
19
|
import { ConsultasComplementaresContext, } from "../../../components/consultasComplementares";
|
|
20
20
|
export var Summary = function (_a) {
|
|
21
|
-
var _b, _c, _d, _e;
|
|
21
|
+
var _b, _c, _d, _e, _f;
|
|
22
22
|
var finderResponse = _a.finderResponse;
|
|
23
23
|
var consultasComplementaresContext = useContext(ConsultasComplementaresContext);
|
|
24
|
-
var
|
|
24
|
+
var _g = (consultasComplementaresContext && consultasComplementaresContext) || {}, consultasComplementares = _g.consultasComplementares, setConsultasComplementares = _g.setConsultasComplementares, hasCredits = _g.hasCredits;
|
|
25
25
|
var getField = function (path, formatter) {
|
|
26
26
|
var value = XPathUtils.select("string(".concat(path, ")"), XPathUtils.select("//cadastro", finderResponse)[0]);
|
|
27
27
|
return formatter ? formatter(value) : value;
|
|
@@ -42,7 +42,7 @@ export var Summary = function (_a) {
|
|
|
42
42
|
: callback();
|
|
43
43
|
};
|
|
44
44
|
};
|
|
45
|
-
var
|
|
45
|
+
var _h = {
|
|
46
46
|
cards: [
|
|
47
47
|
{
|
|
48
48
|
title: getField("nome"),
|
|
@@ -209,13 +209,15 @@ export var Summary = function (_a) {
|
|
|
209
209
|
{
|
|
210
210
|
title: "Consultar Veículos",
|
|
211
211
|
price: productsPrices === null || productsPrices === void 0 ? void 0 : productsPrices.veiculos,
|
|
212
|
+
onClick: handleOnClick('veiculos'),
|
|
213
|
+
hide: (_f = consultasComplementares === null || consultasComplementares === void 0 ? void 0 : consultasComplementares.veiculos) === null || _f === void 0 ? void 0 : _f.consultaRealizada
|
|
212
214
|
},
|
|
213
215
|
{
|
|
214
216
|
title: "Consultar SCR",
|
|
215
217
|
price: productsPrices === null || productsPrices === void 0 ? void 0 : productsPrices.scr,
|
|
216
218
|
},
|
|
217
219
|
],
|
|
218
|
-
}, cards =
|
|
220
|
+
}, cards = _h.cards, products = _h.products;
|
|
219
221
|
return (React.createElement("div", { className: cn("container") },
|
|
220
222
|
React.createElement("div", { className: cn("content", "summary-content") },
|
|
221
223
|
cards.map(function (card, index) { return (React.createElement(AddItemField, { key: index, name: card.header, value: card.title, className: cn("field"), style: { display: "inline-block" } })); }),
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
declare function Veiculos({ documento }: {
|
|
3
|
+
documento: string;
|
|
4
|
+
}): React.JSX.Element | null;
|
|
5
|
+
export type PendenciaBoaVista = {
|
|
6
|
+
ocorrencia: string;
|
|
7
|
+
credor: string;
|
|
8
|
+
entrada: string;
|
|
9
|
+
vencimento: string;
|
|
10
|
+
valor: string;
|
|
11
|
+
informante: string;
|
|
12
|
+
contrato: string;
|
|
13
|
+
avalista: string;
|
|
14
|
+
cidade: string;
|
|
15
|
+
uf: string;
|
|
16
|
+
situacao: string;
|
|
17
|
+
orgaoemissor: string;
|
|
18
|
+
totalpendencias: string;
|
|
19
|
+
totalvalor: string;
|
|
20
|
+
categoria: string;
|
|
21
|
+
};
|
|
22
|
+
export default Veiculos;
|
|
@@ -0,0 +1,65 @@
|
|
|
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
|
+
/* eslint-disable react-hooks/exhaustive-deps */
|
|
13
|
+
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
14
|
+
import React, { useContext, useEffect, useMemo, useRef } from 'react';
|
|
15
|
+
import Header from '../interface/header';
|
|
16
|
+
import AddItemField from '../common/addItem';
|
|
17
|
+
import { Result } from '../interface/result';
|
|
18
|
+
import { ConsultasComplementaresContext } from '../consultasComplementares';
|
|
19
|
+
import { RequestStatus, headerStatus, useQuery } from '../webservice';
|
|
20
|
+
import classNames from 'classnames';
|
|
21
|
+
import { addNoValueContent } from '../../utils/string';
|
|
22
|
+
import XPathUtils from '../../utils/xpath';
|
|
23
|
+
function Veiculos(_a) {
|
|
24
|
+
var _b;
|
|
25
|
+
var _c, _d, _e;
|
|
26
|
+
var documento = _a.documento;
|
|
27
|
+
var consultasComplementaresContext = useContext(ConsultasComplementaresContext);
|
|
28
|
+
var _f = consultasComplementaresContext !== null && consultasComplementaresContext !== void 0 ? consultasComplementaresContext : {}, consultasComplementares = _f.consultasComplementares, setConsultasComplementares = _f.setConsultasComplementares;
|
|
29
|
+
var _g = useQuery("SELECT FROM 'VEICULOS'.'CONSULTA'", { documento: documento }, !!((_c = consultasComplementares === null || consultasComplementares === void 0 ? void 0 : consultasComplementares.veiculos) === null || _c === void 0 ? void 0 : _c.consultaRealizada)), response = _g.response, isLoading = _g.isLoading, error = _g.error;
|
|
30
|
+
var registros = useMemo(function () { return ((response === null || response === void 0 ? void 0 : response.document) && XPathUtils.select('//veiculos/registro', response === null || response === void 0 ? void 0 : response.document) || []).map(addNoValueContent); }, [response]);
|
|
31
|
+
var veiculosRef = useRef(null);
|
|
32
|
+
var consultaVeiculosRealizada = useMemo(function () { var _a; return (_a = consultasComplementares === null || consultasComplementares === void 0 ? void 0 : consultasComplementares.veiculos) === null || _a === void 0 ? void 0 : _a.consultaRealizada; }, [(_d = consultasComplementares === null || consultasComplementares === void 0 ? void 0 : consultasComplementares.veiculos) === null || _d === void 0 ? void 0 : _d.consultaRealizada
|
|
33
|
+
]);
|
|
34
|
+
useEffect(function () {
|
|
35
|
+
var _a;
|
|
36
|
+
(_a = veiculosRef.current) === null || _a === void 0 ? void 0 : _a.scrollIntoView();
|
|
37
|
+
}, [consultaVeiculosRealizada]);
|
|
38
|
+
useEffect(function () {
|
|
39
|
+
response && setConsultasComplementares && setConsultasComplementares(function (prev) { return (__assign(__assign({}, prev), { veiculos: __assign(__assign({}, prev.veiculos), { data: response }) })); });
|
|
40
|
+
}, [response]);
|
|
41
|
+
if (!((_e = consultasComplementares === null || consultasComplementares === void 0 ? void 0 : consultasComplementares.veiculos) === null || _e === void 0 ? void 0 : _e.consultaRealizada))
|
|
42
|
+
return null;
|
|
43
|
+
return (React.createElement(React.Fragment, null,
|
|
44
|
+
React.createElement(Header, { innerRef: veiculosRef, title: 'Ve\u00EDculos Registrados no CPF/CNPJ', subtitle: 'Informa\u00E7\u00F5es de Ve\u00EDculos Registrados no CPF/CNPJ', description: registros.length ? registros.length > 1 ? "Foram encontrados ".concat(registros.length, " ve\u00EDculos registrados no CPF/CNPJ") : 'Foi encontrato 1 veículo registrado no CPF/CNPJ' : 'Nenhum veículo encontrado', className: classNames((_b = {},
|
|
45
|
+
_b[headerStatus[RequestStatus.Loading]] = isLoading,
|
|
46
|
+
_b[headerStatus[RequestStatus.Error]] = error,
|
|
47
|
+
_b['gradient-error'] = registros.length,
|
|
48
|
+
_b)) }),
|
|
49
|
+
React.createElement(Result, null, registros.map(function (registro, i) { return (React.createElement("div", { key: i, className: "container" },
|
|
50
|
+
React.createElement("div", { className: "content" },
|
|
51
|
+
React.createElement(AddItemField, { name: 'Placa', value: XPathUtils.getField('placa', registro) }),
|
|
52
|
+
React.createElement(AddItemField, { name: 'Munic\u00EDpio', value: XPathUtils.getField('municipio', registro) }),
|
|
53
|
+
React.createElement(AddItemField, { name: 'Estado', value: XPathUtils.getField('uf', registro) }),
|
|
54
|
+
React.createElement(AddItemField, { name: 'Renavam', value: XPathUtils.getField('renavam', registro) }),
|
|
55
|
+
React.createElement(AddItemField, { name: 'Chassi', value: XPathUtils.getField('chassi', registro) }),
|
|
56
|
+
React.createElement(AddItemField, { name: 'Motor', value: XPathUtils.getField('motor', registro) }),
|
|
57
|
+
React.createElement(AddItemField, { name: 'Ano de Fabrica\u00E7\u00E3o', value: XPathUtils.getField('ano_fabricacao', registro) }),
|
|
58
|
+
React.createElement(AddItemField, { name: 'Ano do Modelo', value: XPathUtils.getField('ano_modelo', registro) }),
|
|
59
|
+
React.createElement(AddItemField, { name: 'Marca / Modelo', value: XPathUtils.getField('marca_modelo', registro) }),
|
|
60
|
+
React.createElement(AddItemField, { name: 'Proced\u00EAncia', value: XPathUtils.getField('procedencia', registro) }),
|
|
61
|
+
React.createElement(AddItemField, { name: 'Esp\u00E9cie', value: XPathUtils.getField('especie', registro) }),
|
|
62
|
+
React.createElement(AddItemField, { name: 'Combust\u00EDvel', value: XPathUtils.getField('combustivel', registro) }),
|
|
63
|
+
React.createElement(AddItemField, { name: 'Cor', value: XPathUtils.getField('cor', registro) })))); }))));
|
|
64
|
+
}
|
|
65
|
+
export default Veiculos;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { Section, Contacts, Partners, Dossie, Addresses, CCF, Protestos, ProcessosJuridicos, BankAccounts, WebServiceProvider, Queries, CustomChartSection, RefinSerasa, RefinBoaVista, } from "./";
|
|
2
|
+
import { Section, Contacts, Partners, Dossie, Addresses, CCF, Protestos, ProcessosJuridicos, BankAccounts, WebServiceProvider, Queries, CustomChartSection, RefinSerasa, RefinBoaVista, Veiculos, } from "./";
|
|
3
3
|
import { ConsultasComplementaresProvider } from "./components/consultasComplementares";
|
|
4
4
|
import ConsultaScore from "./components/score/scoreService";
|
|
5
5
|
import ConsultaImoveis from "./components/imoveis/imoveisService";
|
|
@@ -22,7 +22,8 @@ var ConsultaSimples = function (_a) {
|
|
|
22
22
|
React.createElement(RefinBoaVista, { documento: documento }),
|
|
23
23
|
React.createElement(RefinSerasa, { documento: documento }),
|
|
24
24
|
React.createElement(ConsultaScore, { documento: documento }),
|
|
25
|
-
React.createElement(ConsultaImoveis, { documento: documento })
|
|
25
|
+
React.createElement(ConsultaImoveis, { documento: documento }),
|
|
26
|
+
React.createElement(Veiculos, { documento: documento })),
|
|
26
27
|
React.createElement(Protestos, null),
|
|
27
28
|
React.createElement(CCF, null),
|
|
28
29
|
React.createElement(ProcessosJuridicos, { onClickConsultarProcessoJuridico: console.log })))))))));
|
package/lib/esm/index.d.ts
CHANGED
|
@@ -19,3 +19,4 @@ export { default as DividasPublicas } from './components/dividasPublicas/dividas
|
|
|
19
19
|
export { default as PessoaPoliticamenteExposta } from './components/pep/pep';
|
|
20
20
|
export { default as RefinSerasa } from './components/refinSerasa/refinSerasa';
|
|
21
21
|
export { default as RefinBoaVista } from './components/refinBoaVista/refinBoaVista';
|
|
22
|
+
export { default as Veiculos } from './components/veiculos/veiculos';
|
package/lib/esm/index.js
CHANGED
|
@@ -19,3 +19,4 @@ export { default as DividasPublicas } from './components/dividasPublicas/dividas
|
|
|
19
19
|
export { default as PessoaPoliticamenteExposta } from './components/pep/pep';
|
|
20
20
|
export { default as RefinSerasa } from './components/refinSerasa/refinSerasa';
|
|
21
21
|
export { default as RefinBoaVista } from './components/refinBoaVista/refinBoaVista';
|
|
22
|
+
export { default as Veiculos } from './components/veiculos/veiculos';
|
package/lib/esm/utils/xpath.d.ts
CHANGED
package/lib/esm/utils/xpath.js
CHANGED
|
@@ -5,6 +5,10 @@ var XPathUtils = /** @class */ (function () {
|
|
|
5
5
|
XPathUtils.select = function (expression, node) {
|
|
6
6
|
return x.select(expression, node);
|
|
7
7
|
};
|
|
8
|
+
XPathUtils.getField = function (path, documentNode, formatter) {
|
|
9
|
+
var value = XPathUtils.select("string(".concat(path, ")"), documentNode);
|
|
10
|
+
return formatter ? formatter(value) : value;
|
|
11
|
+
};
|
|
8
12
|
return XPathUtils;
|
|
9
13
|
}());
|
|
10
14
|
export default XPathUtils;
|