@77sol-lab/form-schemas 1.7.0 → 3.0.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/{chunk-HMC73HBG.mjs → chunk-4T4DDJJZ.mjs} +7 -7
- package/{chunk-DIYEI2PA.mjs → chunk-65WB3CQB.mjs} +9 -9
- package/{chunk-VP4HT24O.mjs → chunk-6AISIJ3O.mjs} +7 -7
- package/{chunk-LU5ODSGQ.mjs → chunk-7ULQG7YJ.mjs} +9 -9
- package/{chunk-QMODZE4A.mjs → chunk-7VU2KIBV.mjs} +7 -7
- package/chunk-BXLQYGEB.mjs +105 -0
- package/{chunk-VDFDTLU5.mjs → chunk-CGBX6OCD.mjs} +7 -7
- package/{chunk-ENDOIQ32.mjs → chunk-CJSJ3VDW.mjs} +138 -60
- package/{chunk-6ZUOXZY3.mjs → chunk-EG5RVHCZ.mjs} +9 -9
- package/{chunk-5EHEC3RT.mjs → chunk-F4RMWUXJ.mjs} +10 -10
- package/{chunk-KJTTMDZP.mjs → chunk-GBKY6QE3.mjs} +7 -7
- package/{chunk-AM7HTUI3.mjs → chunk-HF7G6PTH.mjs} +9 -9
- package/{chunk-65EE5FW3.mjs → chunk-HX5UJCA2.mjs} +7 -7
- package/{chunk-L3OISOZA.mjs → chunk-HXHJSQ2X.mjs} +9 -9
- package/{chunk-UF45URAJ.mjs → chunk-IVY6IQXZ.mjs} +9 -9
- package/{chunk-FBDTG3WD.mjs → chunk-K3QXEL6M.mjs} +20 -21
- package/{chunk-CPDLICOP.mjs → chunk-LDL7QLPB.mjs} +7 -7
- package/{chunk-ORQ52KPA.mjs → chunk-LRIO6V7H.mjs} +7 -7
- package/{chunk-MM6LQXI6.mjs → chunk-OIGZEDM3.mjs} +7 -7
- package/{chunk-PDBPFNAN.mjs → chunk-OJUTNXHL.mjs} +136 -39
- package/{chunk-KBILM3GO.mjs → chunk-OKAMQBUN.mjs} +7 -7
- package/{chunk-TDL42FZZ.mjs → chunk-PCTF5JYB.mjs} +9 -9
- package/{chunk-2BHUMNK5.mjs → chunk-PCXYLWDD.mjs} +9 -9
- package/chunk-QEPJ2RLU.mjs +18 -0
- package/{chunk-5P6NWFTX.mjs → chunk-QQCSQ3L4.mjs} +10 -10
- package/{chunk-TKHIBI4R.mjs → chunk-R5TJYTTO.mjs} +9 -9
- package/{chunk-U4ZDMJX2.mjs → chunk-T2FBV7WO.mjs} +10 -10
- package/{chunk-RWOX5QO3.mjs → chunk-TNZ33455.mjs} +7 -7
- package/{chunk-Y67MNG2X.mjs → chunk-TWOBBIQC.mjs} +9 -9
- package/{chunk-22SYVROO.mjs → chunk-TZEPVIC4.mjs} +9 -9
- package/{chunk-FIPFWGBQ.mjs → chunk-UK62IINL.mjs} +7 -7
- package/{chunk-BYAXV4TG.mjs → chunk-VTTNXB64.mjs} +7 -7
- package/{chunk-DJDG3UYR.mjs → chunk-VWKF4I2L.mjs} +9 -9
- package/financing/formalization/index.d.cts +4848 -19624
- package/financing/formalization/index.d.ts +4848 -19624
- package/financing/formalization/index.js +516 -278
- package/financing/formalization/index.mjs +33 -33
- package/financing/formalization/schemas/AlfaPFSchema.d.cts +107 -395
- package/financing/formalization/schemas/AlfaPFSchema.d.ts +107 -395
- package/financing/formalization/schemas/AlfaPFSchema.js +127 -47
- package/financing/formalization/schemas/AlfaPFSchema.mjs +3 -3
- package/financing/formalization/schemas/AlfaPJSchema.d.cts +119 -621
- package/financing/formalization/schemas/AlfaPJSchema.d.ts +119 -621
- package/financing/formalization/schemas/AlfaPJSchema.js +188 -46
- package/financing/formalization/schemas/AlfaPJSchema.mjs +2 -2
- package/financing/formalization/schemas/BancoDoBrasilPFSchema.d.cts +107 -395
- package/financing/formalization/schemas/BancoDoBrasilPFSchema.d.ts +107 -395
- package/financing/formalization/schemas/BancoDoBrasilPFSchema.js +127 -47
- package/financing/formalization/schemas/BancoDoBrasilPFSchema.mjs +3 -3
- package/financing/formalization/schemas/BancoDoBrasilPJSchema.d.cts +119 -621
- package/financing/formalization/schemas/BancoDoBrasilPJSchema.d.ts +119 -621
- package/financing/formalization/schemas/BancoDoBrasilPJSchema.js +188 -46
- package/financing/formalization/schemas/BancoDoBrasilPJSchema.mjs +2 -2
- package/financing/formalization/schemas/BtgPFSchema.d.cts +107 -395
- package/financing/formalization/schemas/BtgPFSchema.d.ts +107 -395
- package/financing/formalization/schemas/BtgPFSchema.js +127 -47
- package/financing/formalization/schemas/BtgPFSchema.mjs +3 -3
- package/financing/formalization/schemas/BtgPJSchema.d.cts +147 -747
- package/financing/formalization/schemas/BtgPJSchema.d.ts +147 -747
- package/financing/formalization/schemas/BtgPJSchema.js +193 -47
- package/financing/formalization/schemas/BtgPJSchema.mjs +3 -3
- package/financing/formalization/schemas/BvPFSchema.d.cts +125 -477
- package/financing/formalization/schemas/BvPFSchema.d.ts +125 -477
- package/financing/formalization/schemas/BvPFSchema.js +129 -49
- package/financing/formalization/schemas/BvPFSchema.mjs +3 -3
- package/financing/formalization/schemas/BvPJSchema.d.cts +149 -819
- package/financing/formalization/schemas/BvPJSchema.d.ts +149 -819
- package/financing/formalization/schemas/BvPJSchema.js +193 -47
- package/financing/formalization/schemas/BvPJSchema.mjs +3 -3
- package/financing/formalization/schemas/CaixaEconomicaFederalPFSchema.d.cts +107 -395
- package/financing/formalization/schemas/CaixaEconomicaFederalPFSchema.d.ts +107 -395
- package/financing/formalization/schemas/CaixaEconomicaFederalPFSchema.js +127 -47
- package/financing/formalization/schemas/CaixaEconomicaFederalPFSchema.mjs +3 -3
- package/financing/formalization/schemas/CaixaEconomicaFederalPJSchema.d.cts +119 -621
- package/financing/formalization/schemas/CaixaEconomicaFederalPJSchema.d.ts +119 -621
- package/financing/formalization/schemas/CaixaEconomicaFederalPJSchema.js +188 -46
- package/financing/formalization/schemas/CaixaEconomicaFederalPJSchema.mjs +2 -2
- package/financing/formalization/schemas/CashMePFSchema.d.cts +107 -395
- package/financing/formalization/schemas/CashMePFSchema.d.ts +107 -395
- package/financing/formalization/schemas/CashMePFSchema.js +127 -47
- package/financing/formalization/schemas/CashMePFSchema.mjs +3 -3
- package/financing/formalization/schemas/CashMePJSchema.d.cts +119 -621
- package/financing/formalization/schemas/CashMePJSchema.d.ts +119 -621
- package/financing/formalization/schemas/CashMePJSchema.js +188 -46
- package/financing/formalization/schemas/CashMePJSchema.mjs +2 -2
- package/financing/formalization/schemas/Credito77PFSchema.d.cts +107 -395
- package/financing/formalization/schemas/Credito77PFSchema.d.ts +107 -395
- package/financing/formalization/schemas/Credito77PFSchema.js +127 -47
- package/financing/formalization/schemas/Credito77PFSchema.mjs +3 -3
- package/financing/formalization/schemas/Credito77PJSchema.d.cts +119 -621
- package/financing/formalization/schemas/Credito77PJSchema.d.ts +119 -621
- package/financing/formalization/schemas/Credito77PJSchema.js +188 -46
- package/financing/formalization/schemas/Credito77PJSchema.mjs +2 -2
- package/financing/formalization/schemas/EosPFSchema.d.cts +107 -395
- package/financing/formalization/schemas/EosPFSchema.d.ts +107 -395
- package/financing/formalization/schemas/EosPFSchema.js +127 -47
- package/financing/formalization/schemas/EosPFSchema.mjs +3 -3
- package/financing/formalization/schemas/EosPJSchema.d.cts +119 -621
- package/financing/formalization/schemas/EosPJSchema.d.ts +119 -621
- package/financing/formalization/schemas/EosPJSchema.js +188 -46
- package/financing/formalization/schemas/EosPJSchema.mjs +2 -2
- package/financing/formalization/schemas/HdtEnergyPFSchema.d.cts +107 -395
- package/financing/formalization/schemas/HdtEnergyPFSchema.d.ts +107 -395
- package/financing/formalization/schemas/HdtEnergyPFSchema.js +127 -47
- package/financing/formalization/schemas/HdtEnergyPFSchema.mjs +3 -3
- package/financing/formalization/schemas/HdtEnergyPJSchema.d.cts +119 -621
- package/financing/formalization/schemas/HdtEnergyPJSchema.d.ts +119 -621
- package/financing/formalization/schemas/HdtEnergyPJSchema.js +188 -46
- package/financing/formalization/schemas/HdtEnergyPJSchema.mjs +2 -2
- package/financing/formalization/schemas/LosangoPFSchema.d.cts +107 -395
- package/financing/formalization/schemas/LosangoPFSchema.d.ts +107 -395
- package/financing/formalization/schemas/LosangoPFSchema.js +127 -47
- package/financing/formalization/schemas/LosangoPFSchema.mjs +3 -3
- package/financing/formalization/schemas/LosangoPJSchema.d.cts +119 -621
- package/financing/formalization/schemas/LosangoPJSchema.d.ts +119 -621
- package/financing/formalization/schemas/LosangoPJSchema.js +188 -46
- package/financing/formalization/schemas/LosangoPJSchema.mjs +2 -2
- package/financing/formalization/schemas/SafraPFSchema.d.cts +107 -395
- package/financing/formalization/schemas/SafraPFSchema.d.ts +107 -395
- package/financing/formalization/schemas/SafraPFSchema.js +127 -47
- package/financing/formalization/schemas/SafraPFSchema.mjs +3 -3
- package/financing/formalization/schemas/SafraPJSchema.d.cts +119 -621
- package/financing/formalization/schemas/SafraPJSchema.d.ts +119 -621
- package/financing/formalization/schemas/SafraPJSchema.js +188 -46
- package/financing/formalization/schemas/SafraPJSchema.mjs +2 -2
- package/financing/formalization/schemas/SantanderPFSchema.d.cts +107 -395
- package/financing/formalization/schemas/SantanderPFSchema.d.ts +107 -395
- package/financing/formalization/schemas/SantanderPFSchema.js +127 -47
- package/financing/formalization/schemas/SantanderPFSchema.mjs +3 -3
- package/financing/formalization/schemas/SantanderPJSchema.d.cts +119 -621
- package/financing/formalization/schemas/SantanderPJSchema.d.ts +119 -621
- package/financing/formalization/schemas/SantanderPJSchema.js +188 -46
- package/financing/formalization/schemas/SantanderPJSchema.mjs +2 -2
- package/financing/formalization/schemas/SolAgoraPFSchema.d.cts +107 -395
- package/financing/formalization/schemas/SolAgoraPFSchema.d.ts +107 -395
- package/financing/formalization/schemas/SolAgoraPFSchema.js +127 -47
- package/financing/formalization/schemas/SolAgoraPFSchema.mjs +3 -3
- package/financing/formalization/schemas/SolAgoraPJSchema.d.cts +145 -725
- package/financing/formalization/schemas/SolAgoraPJSchema.d.ts +145 -725
- package/financing/formalization/schemas/SolAgoraPJSchema.js +193 -47
- package/financing/formalization/schemas/SolAgoraPJSchema.mjs +3 -3
- package/financing/formalization/schemas/SolfacilPFSchema.d.cts +107 -395
- package/financing/formalization/schemas/SolfacilPFSchema.d.ts +107 -395
- package/financing/formalization/schemas/SolfacilPFSchema.js +127 -47
- package/financing/formalization/schemas/SolfacilPFSchema.mjs +3 -3
- package/financing/formalization/schemas/SolfacilPJSchema.d.cts +131 -679
- package/financing/formalization/schemas/SolfacilPJSchema.d.ts +131 -679
- package/financing/formalization/schemas/SolfacilPJSchema.js +188 -46
- package/financing/formalization/schemas/SolfacilPJSchema.mjs +2 -2
- package/financing/formalization/schemas/UnifiedPFSchema.d.cts +185 -557
- package/financing/formalization/schemas/UnifiedPFSchema.d.ts +185 -557
- package/financing/formalization/schemas/UnifiedPFSchema.js +141 -61
- package/financing/formalization/schemas/UnifiedPFSchema.mjs +3 -3
- package/financing/formalization/schemas/UnifiedPJSchema.d.cts +265 -1269
- package/financing/formalization/schemas/UnifiedPJSchema.d.ts +265 -1269
- package/financing/formalization/schemas/UnifiedPJSchema.js +238 -92
- package/financing/formalization/schemas/UnifiedPJSchema.mjs +3 -3
- package/index.d.cts +2 -1
- package/index.d.ts +2 -1
- package/index.js +516 -278
- package/index.mjs +33 -33
- package/package.json +2 -2
- package/chunk-4PZYGTUU.mjs +0 -105
- package/chunk-JZ7DY7SU.mjs +0 -13
package/index.js
CHANGED
|
@@ -4,41 +4,74 @@ var zod = require('zod');
|
|
|
4
4
|
|
|
5
5
|
// src/shared/fields/primitives.ts
|
|
6
6
|
var REQUIRED_MESSAGE = "Campo obrigat\xF3rio";
|
|
7
|
-
var REQUIRED_STRING_PARAMS = {
|
|
8
|
-
required_error: REQUIRED_MESSAGE,
|
|
9
|
-
invalid_type_error: REQUIRED_MESSAGE
|
|
10
|
-
};
|
|
11
7
|
function requiredString() {
|
|
12
|
-
return zod.z.string(
|
|
8
|
+
return zod.z.string({ error: REQUIRED_MESSAGE });
|
|
13
9
|
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
return
|
|
10
|
+
var DEFAULT_TEXT_MAX_LENGTH = 255;
|
|
11
|
+
function textField(maxLength = DEFAULT_TEXT_MAX_LENGTH) {
|
|
12
|
+
return requiredString().trim().min(1, REQUIRED_MESSAGE).max(maxLength, `M\xE1ximo ${maxLength} caracteres`);
|
|
17
13
|
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
14
|
+
function requiredNumber(invalidTypeMessage) {
|
|
15
|
+
return zod.z.number({
|
|
16
|
+
error: (issue) => issue.input === void 0 ? REQUIRED_MESSAGE : invalidTypeMessage
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
var numberField = requiredNumber("Valor num\xE9rico inv\xE1lido").nonnegative(
|
|
20
|
+
"Valor n\xE3o pode ser negativo"
|
|
21
|
+
);
|
|
22
|
+
var integerField = requiredNumber("Valor num\xE9rico inv\xE1lido").int("Deve ser um n\xFAmero inteiro").nonnegative("Valor n\xE3o pode ser negativo");
|
|
23
|
+
function optionalField(schema) {
|
|
24
|
+
return zod.z.preprocess(
|
|
25
|
+
(value) => typeof value === "string" && value.trim() === "" ? void 0 : value,
|
|
26
|
+
schema.optional()
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
function unrecognizedKeysMessage(keys) {
|
|
30
|
+
const list = keys.map((key) => `"${key}"`).join(", ");
|
|
31
|
+
return keys.length === 1 ? `Campo n\xE3o reconhecido: ${list}` : `Campos n\xE3o reconhecidos: ${list}`;
|
|
32
|
+
}
|
|
33
|
+
function requiredObject(shape) {
|
|
34
|
+
return zod.z.object(shape, {
|
|
35
|
+
error: (issue) => {
|
|
36
|
+
if (issue.code === "invalid_type") {
|
|
37
|
+
return REQUIRED_MESSAGE;
|
|
38
|
+
}
|
|
39
|
+
if (issue.code === "unrecognized_keys") {
|
|
40
|
+
return unrecognizedKeysMessage(issue.keys);
|
|
25
41
|
}
|
|
26
|
-
return
|
|
42
|
+
return void 0;
|
|
27
43
|
}
|
|
28
44
|
});
|
|
29
45
|
}
|
|
46
|
+
function requiredArray(element) {
|
|
47
|
+
return zod.z.array(element, {
|
|
48
|
+
error: (issue) => issue.code === "invalid_type" ? REQUIRED_MESSAGE : void 0
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
function enumField(values) {
|
|
52
|
+
return zod.z.enum(values, {
|
|
53
|
+
// No zod 4 todo input fora da lista (inclusive undefined/null) gera um único
|
|
54
|
+
// issue `invalid_value`. Tratamos ausência, tipo inválido e string vazia
|
|
55
|
+
// (select não preenchido) como "obrigatório"; um valor de fato inválido cai
|
|
56
|
+
// na mensagem padrão do zod (retornar undefined delega ao error map default).
|
|
57
|
+
error: (issue) => typeof issue.input !== "string" || issue.input === "" ? REQUIRED_MESSAGE : void 0
|
|
58
|
+
});
|
|
59
|
+
}
|
|
30
60
|
var MAX_UPLOAD_BYTES = 5 * 1024 * 1024;
|
|
31
61
|
var ACCEPTED_UPLOAD_MIME = ["image/jpeg", "image/png", "application/pdf"];
|
|
32
|
-
var
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
)
|
|
62
|
+
var UPLOAD_URL_PROTOCOL = /^https$/;
|
|
63
|
+
var UPLOAD_URL_HOSTNAME = /^(?!localhost$)(?!(\d{1,3}\.){3}\d{1,3}$)[a-z0-9.-]+$/i;
|
|
64
|
+
var fileUploadField = requiredObject({
|
|
65
|
+
url: optionalField(
|
|
66
|
+
zod.z.url({
|
|
67
|
+
protocol: UPLOAD_URL_PROTOCOL,
|
|
68
|
+
hostname: UPLOAD_URL_HOSTNAME,
|
|
69
|
+
error: "URL do arquivo inv\xE1lida"
|
|
70
|
+
})
|
|
71
|
+
),
|
|
72
|
+
mime: zod.z.enum(ACCEPTED_UPLOAD_MIME, { error: "Formato deve ser JPEG, PNG ou PDF" }),
|
|
73
|
+
sizeBytes: requiredNumber("Tamanho do arquivo inv\xE1lido").int("Tamanho do arquivo deve ser um n\xFAmero inteiro").positive("Tamanho do arquivo deve ser positivo").max(MAX_UPLOAD_BYTES, "Arquivo deve ter no m\xE1ximo 5MB")
|
|
74
|
+
});
|
|
42
75
|
|
|
43
76
|
// src/shared/enums/civil-status.ts
|
|
44
77
|
var CivilStatusEnum = enumField([
|
|
@@ -75,11 +108,16 @@ var CommunionRegimeLabels = {
|
|
|
75
108
|
// src/shared/enums/document-type.ts
|
|
76
109
|
var DocumentTypeEnum = enumField([
|
|
77
110
|
"documento_de_identidade",
|
|
78
|
-
"carteira_nacional_de_habilita\xE7\xE3o"
|
|
111
|
+
"carteira_nacional_de_habilita\xE7\xE3o",
|
|
112
|
+
// Exigido pela RN-015 para nacionalidade estrangeira. Sem este membro a
|
|
113
|
+
// regra seria insatisfazível: todo schema é .strict() com type_doc
|
|
114
|
+
// restrito a este enum.
|
|
115
|
+
"registro_de_estrangeiro"
|
|
79
116
|
]);
|
|
80
117
|
var DocumentTypeLabels = {
|
|
81
118
|
documento_de_identidade: "Documento de identidade (RG)",
|
|
82
|
-
carteira_nacional_de_habilita\u00E7\u00E3o: "Carteira Nacional de Habilita\xE7\xE3o (CNH)"
|
|
119
|
+
carteira_nacional_de_habilita\u00E7\u00E3o: "Carteira Nacional de Habilita\xE7\xE3o (CNH)",
|
|
120
|
+
registro_de_estrangeiro: "Registro Nacional de Estrangeiro (RNE)"
|
|
83
121
|
};
|
|
84
122
|
|
|
85
123
|
// src/shared/enums/nationality.ts
|
|
@@ -304,7 +342,10 @@ var PATTERNS = {
|
|
|
304
342
|
cep: /^\d{8}$/,
|
|
305
343
|
phoneBR: /^\d{11}$/,
|
|
306
344
|
email: /^[^\s@]+@[^\s@]+\.[^\s@]+$/,
|
|
307
|
-
dateDMY: /^\d{2}\/\d{2}\/\d{4}
|
|
345
|
+
dateDMY: /^\d{2}\/\d{2}\/\d{4}$/,
|
|
346
|
+
// Formato do RNE, exigido pela RN-015 para nacionalidade estrangeira.
|
|
347
|
+
rneNumber: /^[A-Za-z0-9]+$/
|
|
348
|
+
};
|
|
308
349
|
|
|
309
350
|
// src/shared/regex/validators.ts
|
|
310
351
|
function onlyDigits(value) {
|
|
@@ -421,19 +462,19 @@ function parseBRLCurrency(value) {
|
|
|
421
462
|
if (typeof value !== "string") {
|
|
422
463
|
return value;
|
|
423
464
|
}
|
|
424
|
-
const
|
|
425
|
-
if (
|
|
465
|
+
const normalized = value.replace(/R\$/gi, "").replace(/\s/g, "").replace(/\./g, "").replace(",", ".");
|
|
466
|
+
if (normalized === "") {
|
|
426
467
|
return void 0;
|
|
427
468
|
}
|
|
428
|
-
const normalized = trimmed.replace(/R\$/gi, "").replace(/\s/g, "").replace(/\./g, "").replace(",", ".");
|
|
429
469
|
const parsed = Number(normalized);
|
|
430
470
|
return Number.isNaN(parsed) ? value : parsed;
|
|
431
471
|
}
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
);
|
|
436
|
-
zod.z.
|
|
472
|
+
function brlAmount() {
|
|
473
|
+
return requiredNumber("Valor monet\xE1rio inv\xE1lido").positive("Valor deve ser positivo");
|
|
474
|
+
}
|
|
475
|
+
var currencySchema = zod.z.preprocess(parseBRLCurrency, brlAmount());
|
|
476
|
+
var optionalCurrencySchema = zod.z.preprocess(parseBRLCurrency, brlAmount().optional());
|
|
477
|
+
requiredNumber("Valor num\xE9rico inv\xE1lido").int("Deve ser um n\xFAmero inteiro").min(1, "M\xEDnimo 1").max(28, "M\xE1ximo 28");
|
|
437
478
|
|
|
438
479
|
// src/domains/financing/formalization/refinements.ts
|
|
439
480
|
var RG_MAX_EMISSION_YEARS = 10;
|
|
@@ -448,7 +489,7 @@ function applyPartnerRefinement(data, ctx) {
|
|
|
448
489
|
const isEmpty = value === void 0 || value === null || typeof value === "string" && value.trim().length === 0;
|
|
449
490
|
if (isEmpty) {
|
|
450
491
|
ctx.addIssue({
|
|
451
|
-
code:
|
|
492
|
+
code: "custom",
|
|
452
493
|
path: [field],
|
|
453
494
|
message: "Campo obrigat\xF3rio para o estado civil informado"
|
|
454
495
|
});
|
|
@@ -462,25 +503,54 @@ function applyCommonRefinements(data, ctx) {
|
|
|
462
503
|
}
|
|
463
504
|
if (!data.proof_kinship_type) {
|
|
464
505
|
ctx.addIssue({
|
|
465
|
-
code:
|
|
506
|
+
code: "custom",
|
|
466
507
|
path: ["proof_kinship_type"],
|
|
467
508
|
message: "Tipo de comprovante \xE9 obrigat\xF3rio quando a conta est\xE1 em nome de terceiro"
|
|
468
509
|
});
|
|
469
510
|
}
|
|
470
511
|
if (!data.proof_kinship) {
|
|
471
512
|
ctx.addIssue({
|
|
472
|
-
code:
|
|
513
|
+
code: "custom",
|
|
473
514
|
path: ["proof_kinship"],
|
|
474
515
|
message: "Documento de v\xEDnculo \xE9 obrigat\xF3rio quando a conta est\xE1 em nome de terceiro"
|
|
475
516
|
});
|
|
476
517
|
}
|
|
477
518
|
}
|
|
519
|
+
var FOREIGN_DOCUMENT_TYPE = "registro_de_estrangeiro";
|
|
520
|
+
function applyForeignDocumentRefinement(data, ctx) {
|
|
521
|
+
const nationality = data.nationality;
|
|
522
|
+
const isForeign = typeof nationality === "string" && nationality.toLowerCase() !== NATIONALITY_BRAZIL;
|
|
523
|
+
if (!isForeign || !("type_doc" in data)) {
|
|
524
|
+
return;
|
|
525
|
+
}
|
|
526
|
+
if (data.type_doc !== FOREIGN_DOCUMENT_TYPE) {
|
|
527
|
+
ctx.addIssue({
|
|
528
|
+
code: "custom",
|
|
529
|
+
path: ["type_doc"],
|
|
530
|
+
message: "Para nacionalidade estrangeira, o documento deve ser Registro de Estrangeiro (RNE)"
|
|
531
|
+
});
|
|
532
|
+
return;
|
|
533
|
+
}
|
|
534
|
+
if (typeof data.doc === "string" && !PATTERNS.rneNumber.test(data.doc)) {
|
|
535
|
+
ctx.addIssue({
|
|
536
|
+
code: "custom",
|
|
537
|
+
path: ["doc"],
|
|
538
|
+
message: "RNE deve conter apenas letras e n\xFAmeros"
|
|
539
|
+
});
|
|
540
|
+
}
|
|
541
|
+
}
|
|
542
|
+
function isRecord(data) {
|
|
543
|
+
return typeof data === "object" && data !== null;
|
|
544
|
+
}
|
|
478
545
|
function applyPfRefinements(data, ctx) {
|
|
546
|
+
if (!isRecord(data)) {
|
|
547
|
+
return;
|
|
548
|
+
}
|
|
479
549
|
applyCommonRefinements(data, ctx);
|
|
480
550
|
applyPartnerRefinement(data, ctx);
|
|
481
551
|
if ("nature_of_occupation" in data && typeof data.nature_of_occupation === "string" && OCCUPATIONS_REQUIRING_CNPJ.includes(data.nature_of_occupation) && !data.cnpj_proprietary) {
|
|
482
552
|
ctx.addIssue({
|
|
483
|
-
code:
|
|
553
|
+
code: "custom",
|
|
484
554
|
path: ["cnpj_proprietary"],
|
|
485
555
|
message: "CNPJ do propriet\xE1rio \xE9 obrigat\xF3rio para esta ocupa\xE7\xE3o"
|
|
486
556
|
});
|
|
@@ -489,19 +559,32 @@ function applyPfRefinements(data, ctx) {
|
|
|
489
559
|
const years = yearsSinceDMY(data.doc_issue_date);
|
|
490
560
|
if (years !== null && years > RG_MAX_EMISSION_YEARS) {
|
|
491
561
|
ctx.addIssue({
|
|
492
|
-
code:
|
|
562
|
+
code: "custom",
|
|
493
563
|
path: ["doc_issue_date"],
|
|
494
564
|
message: `RG deve ter no m\xE1ximo ${RG_MAX_EMISSION_YEARS} anos de emiss\xE3o`
|
|
495
565
|
});
|
|
496
566
|
}
|
|
497
567
|
}
|
|
568
|
+
applyForeignDocumentRefinement(data, ctx);
|
|
498
569
|
}
|
|
499
570
|
function applyPjRefinements(data, ctx) {
|
|
571
|
+
if (!isRecord(data)) {
|
|
572
|
+
return;
|
|
573
|
+
}
|
|
500
574
|
applyCommonRefinements(data, ctx);
|
|
501
575
|
}
|
|
576
|
+
function onlyUnknownKeysAborted(payload) {
|
|
577
|
+
return payload.aborted !== true && !payload.issues.some((issue) => issue.continue !== true && issue.code !== "unrecognized_keys");
|
|
578
|
+
}
|
|
579
|
+
var pfRefinement = zod.z.superRefine(applyPfRefinements, {
|
|
580
|
+
when: onlyUnknownKeysAborted
|
|
581
|
+
});
|
|
582
|
+
var pjRefinement = zod.z.superRefine(applyPjRefinements, {
|
|
583
|
+
when: onlyUnknownKeysAborted
|
|
584
|
+
});
|
|
502
585
|
var formalizationExtras = {
|
|
503
586
|
voucher_local_installation_address: fileUploadField,
|
|
504
|
-
proof_kinship_type: ProofKinshipTypeEnum
|
|
587
|
+
proof_kinship_type: optionalField(ProofKinshipTypeEnum),
|
|
505
588
|
proof_kinship: fileUploadField.optional(),
|
|
506
589
|
document_front_upload: fileUploadField,
|
|
507
590
|
document_back_upload: fileUploadField,
|
|
@@ -509,7 +592,7 @@ var formalizationExtras = {
|
|
|
509
592
|
};
|
|
510
593
|
|
|
511
594
|
// src/domains/financing/formalization/schemas/AlfaPFSchema.ts
|
|
512
|
-
var alfaPfObject =
|
|
595
|
+
var alfaPfObject = requiredObject({
|
|
513
596
|
...formalizationExtras,
|
|
514
597
|
name: textField(),
|
|
515
598
|
cep: cepSchema,
|
|
@@ -518,12 +601,12 @@ var alfaPfObject = zod.z.object({
|
|
|
518
601
|
birth_date: birthDateSchema,
|
|
519
602
|
number: textField(),
|
|
520
603
|
sex: SexEnum,
|
|
521
|
-
complement: textField(15)
|
|
604
|
+
complement: optionalField(textField(15)),
|
|
522
605
|
mother_name: textField(),
|
|
523
606
|
district: textField(),
|
|
524
607
|
energy_account_in_requester_name: textField(),
|
|
525
608
|
city: textField(),
|
|
526
|
-
energy_bill_owner_document: cpfCnpjSchema
|
|
609
|
+
energy_bill_owner_document: optionalField(cpfCnpjSchema),
|
|
527
610
|
state: UfEnum,
|
|
528
611
|
nationality: NationalityEnum.default(NATIONALITY_BRAZIL),
|
|
529
612
|
cellphone: phoneBRSchema,
|
|
@@ -535,10 +618,12 @@ var alfaPfObject = zod.z.object({
|
|
|
535
618
|
issuing_body: textField(6),
|
|
536
619
|
doc_issue_date: issueDateSchema
|
|
537
620
|
});
|
|
538
|
-
var alfaPfSchema = alfaPfObject.strict().
|
|
539
|
-
|
|
621
|
+
var alfaPfSchema = alfaPfObject.strict().check(pfRefinement);
|
|
622
|
+
|
|
623
|
+
// src/domains/financing/formalization/schemas/AlfaPJSchema.ts
|
|
624
|
+
var alfaPjObject = requiredObject({
|
|
540
625
|
...formalizationExtras,
|
|
541
|
-
financing_company:
|
|
626
|
+
financing_company: requiredObject({
|
|
542
627
|
corporate_name: textField(),
|
|
543
628
|
cep: cepSchema,
|
|
544
629
|
address: textField(),
|
|
@@ -546,7 +631,7 @@ var alfaPjObject = zod.z.object({
|
|
|
546
631
|
number: textField(),
|
|
547
632
|
cnpj: cnpjSchema,
|
|
548
633
|
email: emailSchema,
|
|
549
|
-
complement: textField(15)
|
|
634
|
+
complement: optionalField(textField(15)),
|
|
550
635
|
phone: phoneBRSchema,
|
|
551
636
|
district: textField(),
|
|
552
637
|
legal_nature: textField(),
|
|
@@ -556,15 +641,15 @@ var alfaPjObject = zod.z.object({
|
|
|
556
641
|
economic_activity: textField(),
|
|
557
642
|
monthly_income: currencySchema
|
|
558
643
|
}).strict(),
|
|
559
|
-
financing_company_guarantor:
|
|
560
|
-
|
|
644
|
+
financing_company_guarantor: requiredArray(
|
|
645
|
+
requiredObject({
|
|
561
646
|
name: textField(),
|
|
562
647
|
cep: cepSchema,
|
|
563
648
|
cpf: cpfSchema,
|
|
564
649
|
address: textField(),
|
|
565
650
|
birth_date: birthDateSchema,
|
|
566
651
|
number: textField(),
|
|
567
|
-
complement: textField(15)
|
|
652
|
+
complement: optionalField(textField(15)),
|
|
568
653
|
cellphone: phoneBRSchema,
|
|
569
654
|
email: emailSchema,
|
|
570
655
|
district: textField(),
|
|
@@ -577,8 +662,10 @@ var alfaPjObject = zod.z.object({
|
|
|
577
662
|
}).strict()
|
|
578
663
|
)
|
|
579
664
|
});
|
|
580
|
-
var alfaPjSchema = alfaPjObject.strict().
|
|
581
|
-
|
|
665
|
+
var alfaPjSchema = alfaPjObject.strict().check(pjRefinement);
|
|
666
|
+
|
|
667
|
+
// src/domains/financing/formalization/schemas/BancoDoBrasilPFSchema.ts
|
|
668
|
+
var bancoDoBrasilPfObject = requiredObject({
|
|
582
669
|
...formalizationExtras,
|
|
583
670
|
name: textField(),
|
|
584
671
|
cep: cepSchema,
|
|
@@ -587,12 +674,12 @@ var bancoDoBrasilPfObject = zod.z.object({
|
|
|
587
674
|
birth_date: birthDateSchema,
|
|
588
675
|
number: textField(),
|
|
589
676
|
sex: SexEnum,
|
|
590
|
-
complement: textField(15)
|
|
677
|
+
complement: optionalField(textField(15)),
|
|
591
678
|
mother_name: textField(),
|
|
592
679
|
district: textField(),
|
|
593
680
|
energy_account_in_requester_name: textField(),
|
|
594
681
|
city: textField(),
|
|
595
|
-
energy_bill_owner_document: cpfCnpjSchema
|
|
682
|
+
energy_bill_owner_document: optionalField(cpfCnpjSchema),
|
|
596
683
|
state: UfEnum,
|
|
597
684
|
nationality: NationalityEnum.default(NATIONALITY_BRAZIL),
|
|
598
685
|
cellphone: phoneBRSchema,
|
|
@@ -604,10 +691,12 @@ var bancoDoBrasilPfObject = zod.z.object({
|
|
|
604
691
|
issuing_body: textField(6),
|
|
605
692
|
doc_issue_date: issueDateSchema
|
|
606
693
|
});
|
|
607
|
-
var bancoDoBrasilPfSchema = bancoDoBrasilPfObject.strict().
|
|
608
|
-
|
|
694
|
+
var bancoDoBrasilPfSchema = bancoDoBrasilPfObject.strict().check(pfRefinement);
|
|
695
|
+
|
|
696
|
+
// src/domains/financing/formalization/schemas/BancoDoBrasilPJSchema.ts
|
|
697
|
+
var bancoDoBrasilPjObject = requiredObject({
|
|
609
698
|
...formalizationExtras,
|
|
610
|
-
financing_company:
|
|
699
|
+
financing_company: requiredObject({
|
|
611
700
|
corporate_name: textField(),
|
|
612
701
|
cep: cepSchema,
|
|
613
702
|
address: textField(),
|
|
@@ -615,7 +704,7 @@ var bancoDoBrasilPjObject = zod.z.object({
|
|
|
615
704
|
number: textField(),
|
|
616
705
|
cnpj: cnpjSchema,
|
|
617
706
|
email: emailSchema,
|
|
618
|
-
complement: textField(15)
|
|
707
|
+
complement: optionalField(textField(15)),
|
|
619
708
|
phone: phoneBRSchema,
|
|
620
709
|
district: textField(),
|
|
621
710
|
legal_nature: textField(),
|
|
@@ -625,15 +714,15 @@ var bancoDoBrasilPjObject = zod.z.object({
|
|
|
625
714
|
economic_activity: textField(),
|
|
626
715
|
monthly_income: currencySchema
|
|
627
716
|
}).strict(),
|
|
628
|
-
financing_company_guarantor:
|
|
629
|
-
|
|
717
|
+
financing_company_guarantor: requiredArray(
|
|
718
|
+
requiredObject({
|
|
630
719
|
name: textField(),
|
|
631
720
|
cep: cepSchema,
|
|
632
721
|
cpf: cpfSchema,
|
|
633
722
|
address: textField(),
|
|
634
723
|
birth_date: birthDateSchema,
|
|
635
724
|
number: textField(),
|
|
636
|
-
complement: textField(15)
|
|
725
|
+
complement: optionalField(textField(15)),
|
|
637
726
|
cellphone: phoneBRSchema,
|
|
638
727
|
email: emailSchema,
|
|
639
728
|
district: textField(),
|
|
@@ -646,8 +735,10 @@ var bancoDoBrasilPjObject = zod.z.object({
|
|
|
646
735
|
}).strict()
|
|
647
736
|
)
|
|
648
737
|
});
|
|
649
|
-
var bancoDoBrasilPjSchema = bancoDoBrasilPjObject.strict().
|
|
650
|
-
|
|
738
|
+
var bancoDoBrasilPjSchema = bancoDoBrasilPjObject.strict().check(pjRefinement);
|
|
739
|
+
|
|
740
|
+
// src/domains/financing/formalization/schemas/BtgPFSchema.ts
|
|
741
|
+
var btgPfObject = requiredObject({
|
|
651
742
|
...formalizationExtras,
|
|
652
743
|
name: textField(),
|
|
653
744
|
cep: cepSchema,
|
|
@@ -656,12 +747,12 @@ var btgPfObject = zod.z.object({
|
|
|
656
747
|
birth_date: birthDateSchema,
|
|
657
748
|
number: textField(),
|
|
658
749
|
sex: SexEnum,
|
|
659
|
-
complement: textField(15)
|
|
750
|
+
complement: optionalField(textField(15)),
|
|
660
751
|
mother_name: textField(),
|
|
661
752
|
district: textField(),
|
|
662
753
|
energy_account_in_requester_name: textField(),
|
|
663
754
|
city: textField(),
|
|
664
|
-
energy_bill_owner_document: cpfCnpjSchema
|
|
755
|
+
energy_bill_owner_document: optionalField(cpfCnpjSchema),
|
|
665
756
|
state: UfEnum,
|
|
666
757
|
nationality: NationalityEnum.default(NATIONALITY_BRAZIL),
|
|
667
758
|
cellphone: phoneBRSchema,
|
|
@@ -673,10 +764,12 @@ var btgPfObject = zod.z.object({
|
|
|
673
764
|
issuing_body: textField(6),
|
|
674
765
|
doc_issue_date: issueDateSchema
|
|
675
766
|
});
|
|
676
|
-
var btgPfSchema = btgPfObject.strict().
|
|
677
|
-
|
|
767
|
+
var btgPfSchema = btgPfObject.strict().check(pfRefinement);
|
|
768
|
+
|
|
769
|
+
// src/domains/financing/formalization/schemas/BtgPJSchema.ts
|
|
770
|
+
var btgPjObject = requiredObject({
|
|
678
771
|
...formalizationExtras,
|
|
679
|
-
financing_company:
|
|
772
|
+
financing_company: requiredObject({
|
|
680
773
|
corporate_name: textField(),
|
|
681
774
|
cep: cepSchema,
|
|
682
775
|
address: textField(),
|
|
@@ -684,7 +777,7 @@ var btgPjObject = zod.z.object({
|
|
|
684
777
|
number: textField(),
|
|
685
778
|
cnpj: cnpjSchema,
|
|
686
779
|
email: emailSchema,
|
|
687
|
-
complement: textField(15)
|
|
780
|
+
complement: optionalField(textField(15)),
|
|
688
781
|
phone: phoneBRSchema,
|
|
689
782
|
district: textField(),
|
|
690
783
|
legal_nature: textField(),
|
|
@@ -694,15 +787,15 @@ var btgPjObject = zod.z.object({
|
|
|
694
787
|
economic_activity: textField(),
|
|
695
788
|
monthly_income: currencySchema
|
|
696
789
|
}).strict(),
|
|
697
|
-
financing_company_guarantor:
|
|
698
|
-
|
|
790
|
+
financing_company_guarantor: requiredArray(
|
|
791
|
+
requiredObject({
|
|
699
792
|
name: textField(),
|
|
700
793
|
cep: cepSchema,
|
|
701
794
|
cpf: cpfSchema,
|
|
702
795
|
address: textField(),
|
|
703
796
|
birth_date: birthDateSchema,
|
|
704
797
|
number: textField(),
|
|
705
|
-
complement: textField(15)
|
|
798
|
+
complement: optionalField(textField(15)),
|
|
706
799
|
cellphone: phoneBRSchema,
|
|
707
800
|
phone: phoneBRSchema,
|
|
708
801
|
email: emailSchema,
|
|
@@ -726,8 +819,10 @@ var btgPjObject = zod.z.object({
|
|
|
726
819
|
}).strict()
|
|
727
820
|
)
|
|
728
821
|
});
|
|
729
|
-
var btgPjSchema = btgPjObject.strict().
|
|
730
|
-
|
|
822
|
+
var btgPjSchema = btgPjObject.strict().check(pjRefinement);
|
|
823
|
+
|
|
824
|
+
// src/domains/financing/formalization/schemas/BvPFSchema.ts
|
|
825
|
+
var bvPfObject = requiredObject({
|
|
731
826
|
...formalizationExtras,
|
|
732
827
|
name: textField(),
|
|
733
828
|
cep: cepSchema,
|
|
@@ -738,13 +833,13 @@ var bvPfObject = zod.z.object({
|
|
|
738
833
|
birth_date: birthDateSchema,
|
|
739
834
|
number: textField(),
|
|
740
835
|
sex: SexEnum,
|
|
741
|
-
complement: textField(15)
|
|
836
|
+
complement: optionalField(textField(15)),
|
|
742
837
|
is_installation_at_requester: textField(),
|
|
743
838
|
mother_name: textField(),
|
|
744
839
|
district: textField(),
|
|
745
840
|
energy_account_in_requester_name: textField(),
|
|
746
841
|
city: textField(),
|
|
747
|
-
energy_bill_owner_document: cpfCnpjSchema
|
|
842
|
+
energy_bill_owner_document: optionalField(cpfCnpjSchema),
|
|
748
843
|
civil_status: textField(),
|
|
749
844
|
state: UfEnum,
|
|
750
845
|
nationality: NationalityEnum.default(NATIONALITY_BRAZIL),
|
|
@@ -756,19 +851,21 @@ var bvPfObject = zod.z.object({
|
|
|
756
851
|
profession: textField(),
|
|
757
852
|
nature_of_occupation: textField(),
|
|
758
853
|
company_time: numberField,
|
|
759
|
-
cnpj_proprietary: cnpjSchema
|
|
854
|
+
cnpj_proprietary: optionalField(cnpjSchema),
|
|
760
855
|
equity_value: currencySchema,
|
|
761
856
|
type_doc: DocumentTypeEnum,
|
|
762
857
|
doc: textField(15),
|
|
763
858
|
issuing_body: textField(6),
|
|
764
859
|
emitting_state: UfEnum,
|
|
765
860
|
doc_issue_date: issueDateSchema,
|
|
766
|
-
pep_relationship: textField()
|
|
861
|
+
pep_relationship: optionalField(textField())
|
|
767
862
|
});
|
|
768
|
-
var bvPfSchema = bvPfObject.strict().
|
|
769
|
-
|
|
863
|
+
var bvPfSchema = bvPfObject.strict().check(pfRefinement);
|
|
864
|
+
|
|
865
|
+
// src/domains/financing/formalization/schemas/BvPJSchema.ts
|
|
866
|
+
var bvPjObject = requiredObject({
|
|
770
867
|
...formalizationExtras,
|
|
771
|
-
financing_company:
|
|
868
|
+
financing_company: requiredObject({
|
|
772
869
|
corporate_name: textField(),
|
|
773
870
|
cep: cepSchema,
|
|
774
871
|
residence_situation: textField(),
|
|
@@ -778,7 +875,7 @@ var bvPjObject = zod.z.object({
|
|
|
778
875
|
number: textField(),
|
|
779
876
|
cnpj: cnpjSchema,
|
|
780
877
|
email: emailSchema,
|
|
781
|
-
complement: textField(15)
|
|
878
|
+
complement: optionalField(textField(15)),
|
|
782
879
|
phone: phoneBRSchema,
|
|
783
880
|
district: textField(),
|
|
784
881
|
legal_nature: textField(),
|
|
@@ -789,15 +886,15 @@ var bvPjObject = zod.z.object({
|
|
|
789
886
|
monthly_income: currencySchema,
|
|
790
887
|
capital_social: currencySchema
|
|
791
888
|
}).strict(),
|
|
792
|
-
financing_company_guarantor:
|
|
793
|
-
|
|
889
|
+
financing_company_guarantor: requiredArray(
|
|
890
|
+
requiredObject({
|
|
794
891
|
name: textField(),
|
|
795
892
|
cep: cepSchema,
|
|
796
893
|
cpf: cpfSchema,
|
|
797
894
|
address: textField(),
|
|
798
895
|
birth_date: birthDateSchema,
|
|
799
896
|
number: textField(),
|
|
800
|
-
complement: textField(15)
|
|
897
|
+
complement: optionalField(textField(15)),
|
|
801
898
|
cellphone: phoneBRSchema,
|
|
802
899
|
phone: phoneBRSchema,
|
|
803
900
|
email: emailSchema,
|
|
@@ -825,8 +922,10 @@ var bvPjObject = zod.z.object({
|
|
|
825
922
|
}).strict()
|
|
826
923
|
)
|
|
827
924
|
});
|
|
828
|
-
var bvPjSchema = bvPjObject.strict().
|
|
829
|
-
|
|
925
|
+
var bvPjSchema = bvPjObject.strict().check(pjRefinement);
|
|
926
|
+
|
|
927
|
+
// src/domains/financing/formalization/schemas/CaixaEconomicaFederalPFSchema.ts
|
|
928
|
+
var caixaEconomicaFederalPfObject = requiredObject({
|
|
830
929
|
...formalizationExtras,
|
|
831
930
|
name: textField(),
|
|
832
931
|
cep: cepSchema,
|
|
@@ -835,12 +934,12 @@ var caixaEconomicaFederalPfObject = zod.z.object({
|
|
|
835
934
|
birth_date: birthDateSchema,
|
|
836
935
|
number: textField(),
|
|
837
936
|
sex: SexEnum,
|
|
838
|
-
complement: textField(15)
|
|
937
|
+
complement: optionalField(textField(15)),
|
|
839
938
|
mother_name: textField(),
|
|
840
939
|
district: textField(),
|
|
841
940
|
energy_account_in_requester_name: textField(),
|
|
842
941
|
city: textField(),
|
|
843
|
-
energy_bill_owner_document: cpfCnpjSchema
|
|
942
|
+
energy_bill_owner_document: optionalField(cpfCnpjSchema),
|
|
844
943
|
state: UfEnum,
|
|
845
944
|
nationality: NationalityEnum.default(NATIONALITY_BRAZIL),
|
|
846
945
|
cellphone: phoneBRSchema,
|
|
@@ -852,10 +951,12 @@ var caixaEconomicaFederalPfObject = zod.z.object({
|
|
|
852
951
|
issuing_body: textField(6),
|
|
853
952
|
doc_issue_date: issueDateSchema
|
|
854
953
|
});
|
|
855
|
-
var caixaEconomicaFederalPfSchema = caixaEconomicaFederalPfObject.strict().
|
|
856
|
-
|
|
954
|
+
var caixaEconomicaFederalPfSchema = caixaEconomicaFederalPfObject.strict().check(pfRefinement);
|
|
955
|
+
|
|
956
|
+
// src/domains/financing/formalization/schemas/CaixaEconomicaFederalPJSchema.ts
|
|
957
|
+
var caixaEconomicaFederalPjObject = requiredObject({
|
|
857
958
|
...formalizationExtras,
|
|
858
|
-
financing_company:
|
|
959
|
+
financing_company: requiredObject({
|
|
859
960
|
corporate_name: textField(),
|
|
860
961
|
cep: cepSchema,
|
|
861
962
|
address: textField(),
|
|
@@ -863,7 +964,7 @@ var caixaEconomicaFederalPjObject = zod.z.object({
|
|
|
863
964
|
number: textField(),
|
|
864
965
|
cnpj: cnpjSchema,
|
|
865
966
|
email: emailSchema,
|
|
866
|
-
complement: textField(15)
|
|
967
|
+
complement: optionalField(textField(15)),
|
|
867
968
|
phone: phoneBRSchema,
|
|
868
969
|
district: textField(),
|
|
869
970
|
legal_nature: textField(),
|
|
@@ -873,15 +974,15 @@ var caixaEconomicaFederalPjObject = zod.z.object({
|
|
|
873
974
|
economic_activity: textField(),
|
|
874
975
|
monthly_income: currencySchema
|
|
875
976
|
}).strict(),
|
|
876
|
-
financing_company_guarantor:
|
|
877
|
-
|
|
977
|
+
financing_company_guarantor: requiredArray(
|
|
978
|
+
requiredObject({
|
|
878
979
|
name: textField(),
|
|
879
980
|
cep: cepSchema,
|
|
880
981
|
cpf: cpfSchema,
|
|
881
982
|
address: textField(),
|
|
882
983
|
birth_date: birthDateSchema,
|
|
883
984
|
number: textField(),
|
|
884
|
-
complement: textField(15)
|
|
985
|
+
complement: optionalField(textField(15)),
|
|
885
986
|
cellphone: phoneBRSchema,
|
|
886
987
|
email: emailSchema,
|
|
887
988
|
district: textField(),
|
|
@@ -894,8 +995,10 @@ var caixaEconomicaFederalPjObject = zod.z.object({
|
|
|
894
995
|
}).strict()
|
|
895
996
|
)
|
|
896
997
|
});
|
|
897
|
-
var caixaEconomicaFederalPjSchema = caixaEconomicaFederalPjObject.strict().
|
|
898
|
-
|
|
998
|
+
var caixaEconomicaFederalPjSchema = caixaEconomicaFederalPjObject.strict().check(pjRefinement);
|
|
999
|
+
|
|
1000
|
+
// src/domains/financing/formalization/schemas/CashMePFSchema.ts
|
|
1001
|
+
var cashMePfObject = requiredObject({
|
|
899
1002
|
...formalizationExtras,
|
|
900
1003
|
name: textField(),
|
|
901
1004
|
cep: cepSchema,
|
|
@@ -904,12 +1007,12 @@ var cashMePfObject = zod.z.object({
|
|
|
904
1007
|
birth_date: birthDateSchema,
|
|
905
1008
|
number: textField(),
|
|
906
1009
|
sex: SexEnum,
|
|
907
|
-
complement: textField(15)
|
|
1010
|
+
complement: optionalField(textField(15)),
|
|
908
1011
|
mother_name: textField(),
|
|
909
1012
|
district: textField(),
|
|
910
1013
|
energy_account_in_requester_name: textField(),
|
|
911
1014
|
city: textField(),
|
|
912
|
-
energy_bill_owner_document: cpfCnpjSchema
|
|
1015
|
+
energy_bill_owner_document: optionalField(cpfCnpjSchema),
|
|
913
1016
|
state: UfEnum,
|
|
914
1017
|
nationality: NationalityEnum.default(NATIONALITY_BRAZIL),
|
|
915
1018
|
cellphone: phoneBRSchema,
|
|
@@ -921,10 +1024,12 @@ var cashMePfObject = zod.z.object({
|
|
|
921
1024
|
issuing_body: textField(6),
|
|
922
1025
|
doc_issue_date: issueDateSchema
|
|
923
1026
|
});
|
|
924
|
-
var cashMePfSchema = cashMePfObject.strict().
|
|
925
|
-
|
|
1027
|
+
var cashMePfSchema = cashMePfObject.strict().check(pfRefinement);
|
|
1028
|
+
|
|
1029
|
+
// src/domains/financing/formalization/schemas/CashMePJSchema.ts
|
|
1030
|
+
var cashMePjObject = requiredObject({
|
|
926
1031
|
...formalizationExtras,
|
|
927
|
-
financing_company:
|
|
1032
|
+
financing_company: requiredObject({
|
|
928
1033
|
corporate_name: textField(),
|
|
929
1034
|
cep: cepSchema,
|
|
930
1035
|
address: textField(),
|
|
@@ -932,7 +1037,7 @@ var cashMePjObject = zod.z.object({
|
|
|
932
1037
|
number: textField(),
|
|
933
1038
|
cnpj: cnpjSchema,
|
|
934
1039
|
email: emailSchema,
|
|
935
|
-
complement: textField(15)
|
|
1040
|
+
complement: optionalField(textField(15)),
|
|
936
1041
|
phone: phoneBRSchema,
|
|
937
1042
|
district: textField(),
|
|
938
1043
|
legal_nature: textField(),
|
|
@@ -942,15 +1047,15 @@ var cashMePjObject = zod.z.object({
|
|
|
942
1047
|
economic_activity: textField(),
|
|
943
1048
|
monthly_income: currencySchema
|
|
944
1049
|
}).strict(),
|
|
945
|
-
financing_company_guarantor:
|
|
946
|
-
|
|
1050
|
+
financing_company_guarantor: requiredArray(
|
|
1051
|
+
requiredObject({
|
|
947
1052
|
name: textField(),
|
|
948
1053
|
cep: cepSchema,
|
|
949
1054
|
cpf: cpfSchema,
|
|
950
1055
|
address: textField(),
|
|
951
1056
|
birth_date: birthDateSchema,
|
|
952
1057
|
number: textField(),
|
|
953
|
-
complement: textField(15)
|
|
1058
|
+
complement: optionalField(textField(15)),
|
|
954
1059
|
cellphone: phoneBRSchema,
|
|
955
1060
|
email: emailSchema,
|
|
956
1061
|
district: textField(),
|
|
@@ -963,8 +1068,10 @@ var cashMePjObject = zod.z.object({
|
|
|
963
1068
|
}).strict()
|
|
964
1069
|
)
|
|
965
1070
|
});
|
|
966
|
-
var cashMePjSchema = cashMePjObject.strict().
|
|
967
|
-
|
|
1071
|
+
var cashMePjSchema = cashMePjObject.strict().check(pjRefinement);
|
|
1072
|
+
|
|
1073
|
+
// src/domains/financing/formalization/schemas/Credito77PFSchema.ts
|
|
1074
|
+
var credito77PfObject = requiredObject({
|
|
968
1075
|
...formalizationExtras,
|
|
969
1076
|
name: textField(),
|
|
970
1077
|
cep: cepSchema,
|
|
@@ -973,12 +1080,12 @@ var credito77PfObject = zod.z.object({
|
|
|
973
1080
|
birth_date: birthDateSchema,
|
|
974
1081
|
number: textField(),
|
|
975
1082
|
sex: SexEnum,
|
|
976
|
-
complement: textField(15)
|
|
1083
|
+
complement: optionalField(textField(15)),
|
|
977
1084
|
mother_name: textField(),
|
|
978
1085
|
district: textField(),
|
|
979
1086
|
energy_account_in_requester_name: textField(),
|
|
980
1087
|
city: textField(),
|
|
981
|
-
energy_bill_owner_document: cpfCnpjSchema
|
|
1088
|
+
energy_bill_owner_document: optionalField(cpfCnpjSchema),
|
|
982
1089
|
state: UfEnum,
|
|
983
1090
|
nationality: NationalityEnum.default(NATIONALITY_BRAZIL),
|
|
984
1091
|
cellphone: phoneBRSchema,
|
|
@@ -990,10 +1097,12 @@ var credito77PfObject = zod.z.object({
|
|
|
990
1097
|
issuing_body: textField(6),
|
|
991
1098
|
doc_issue_date: issueDateSchema
|
|
992
1099
|
});
|
|
993
|
-
var credito77PfSchema = credito77PfObject.strict().
|
|
994
|
-
|
|
1100
|
+
var credito77PfSchema = credito77PfObject.strict().check(pfRefinement);
|
|
1101
|
+
|
|
1102
|
+
// src/domains/financing/formalization/schemas/Credito77PJSchema.ts
|
|
1103
|
+
var credito77PjObject = requiredObject({
|
|
995
1104
|
...formalizationExtras,
|
|
996
|
-
financing_company:
|
|
1105
|
+
financing_company: requiredObject({
|
|
997
1106
|
corporate_name: textField(),
|
|
998
1107
|
cep: cepSchema,
|
|
999
1108
|
address: textField(),
|
|
@@ -1001,7 +1110,7 @@ var credito77PjObject = zod.z.object({
|
|
|
1001
1110
|
number: textField(),
|
|
1002
1111
|
cnpj: cnpjSchema,
|
|
1003
1112
|
email: emailSchema,
|
|
1004
|
-
complement: textField(15)
|
|
1113
|
+
complement: optionalField(textField(15)),
|
|
1005
1114
|
phone: phoneBRSchema,
|
|
1006
1115
|
district: textField(),
|
|
1007
1116
|
legal_nature: textField(),
|
|
@@ -1011,15 +1120,15 @@ var credito77PjObject = zod.z.object({
|
|
|
1011
1120
|
economic_activity: textField(),
|
|
1012
1121
|
monthly_income: currencySchema
|
|
1013
1122
|
}).strict(),
|
|
1014
|
-
financing_company_guarantor:
|
|
1015
|
-
|
|
1123
|
+
financing_company_guarantor: requiredArray(
|
|
1124
|
+
requiredObject({
|
|
1016
1125
|
name: textField(),
|
|
1017
1126
|
cep: cepSchema,
|
|
1018
1127
|
cpf: cpfSchema,
|
|
1019
1128
|
address: textField(),
|
|
1020
1129
|
birth_date: birthDateSchema,
|
|
1021
1130
|
number: textField(),
|
|
1022
|
-
complement: textField(15)
|
|
1131
|
+
complement: optionalField(textField(15)),
|
|
1023
1132
|
cellphone: phoneBRSchema,
|
|
1024
1133
|
email: emailSchema,
|
|
1025
1134
|
district: textField(),
|
|
@@ -1032,8 +1141,10 @@ var credito77PjObject = zod.z.object({
|
|
|
1032
1141
|
}).strict()
|
|
1033
1142
|
)
|
|
1034
1143
|
});
|
|
1035
|
-
var credito77PjSchema = credito77PjObject.strict().
|
|
1036
|
-
|
|
1144
|
+
var credito77PjSchema = credito77PjObject.strict().check(pjRefinement);
|
|
1145
|
+
|
|
1146
|
+
// src/domains/financing/formalization/schemas/EosPFSchema.ts
|
|
1147
|
+
var eosPfObject = requiredObject({
|
|
1037
1148
|
...formalizationExtras,
|
|
1038
1149
|
name: textField(),
|
|
1039
1150
|
cep: cepSchema,
|
|
@@ -1042,12 +1153,12 @@ var eosPfObject = zod.z.object({
|
|
|
1042
1153
|
birth_date: birthDateSchema,
|
|
1043
1154
|
number: textField(),
|
|
1044
1155
|
sex: SexEnum,
|
|
1045
|
-
complement: textField(15)
|
|
1156
|
+
complement: optionalField(textField(15)),
|
|
1046
1157
|
mother_name: textField(),
|
|
1047
1158
|
district: textField(),
|
|
1048
1159
|
energy_account_in_requester_name: textField(),
|
|
1049
1160
|
city: textField(),
|
|
1050
|
-
energy_bill_owner_document: cpfCnpjSchema
|
|
1161
|
+
energy_bill_owner_document: optionalField(cpfCnpjSchema),
|
|
1051
1162
|
state: UfEnum,
|
|
1052
1163
|
nationality: NationalityEnum.default(NATIONALITY_BRAZIL),
|
|
1053
1164
|
cellphone: phoneBRSchema,
|
|
@@ -1059,10 +1170,12 @@ var eosPfObject = zod.z.object({
|
|
|
1059
1170
|
issuing_body: textField(6),
|
|
1060
1171
|
doc_issue_date: issueDateSchema
|
|
1061
1172
|
});
|
|
1062
|
-
var eosPfSchema = eosPfObject.strict().
|
|
1063
|
-
|
|
1173
|
+
var eosPfSchema = eosPfObject.strict().check(pfRefinement);
|
|
1174
|
+
|
|
1175
|
+
// src/domains/financing/formalization/schemas/EosPJSchema.ts
|
|
1176
|
+
var eosPjObject = requiredObject({
|
|
1064
1177
|
...formalizationExtras,
|
|
1065
|
-
financing_company:
|
|
1178
|
+
financing_company: requiredObject({
|
|
1066
1179
|
corporate_name: textField(),
|
|
1067
1180
|
cep: cepSchema,
|
|
1068
1181
|
address: textField(),
|
|
@@ -1070,7 +1183,7 @@ var eosPjObject = zod.z.object({
|
|
|
1070
1183
|
number: textField(),
|
|
1071
1184
|
cnpj: cnpjSchema,
|
|
1072
1185
|
email: emailSchema,
|
|
1073
|
-
complement: textField(15)
|
|
1186
|
+
complement: optionalField(textField(15)),
|
|
1074
1187
|
phone: phoneBRSchema,
|
|
1075
1188
|
district: textField(),
|
|
1076
1189
|
legal_nature: textField(),
|
|
@@ -1080,15 +1193,15 @@ var eosPjObject = zod.z.object({
|
|
|
1080
1193
|
economic_activity: textField(),
|
|
1081
1194
|
monthly_income: currencySchema
|
|
1082
1195
|
}).strict(),
|
|
1083
|
-
financing_company_guarantor:
|
|
1084
|
-
|
|
1196
|
+
financing_company_guarantor: requiredArray(
|
|
1197
|
+
requiredObject({
|
|
1085
1198
|
name: textField(),
|
|
1086
1199
|
cep: cepSchema,
|
|
1087
1200
|
cpf: cpfSchema,
|
|
1088
1201
|
address: textField(),
|
|
1089
1202
|
birth_date: birthDateSchema,
|
|
1090
1203
|
number: textField(),
|
|
1091
|
-
complement: textField(15)
|
|
1204
|
+
complement: optionalField(textField(15)),
|
|
1092
1205
|
cellphone: phoneBRSchema,
|
|
1093
1206
|
email: emailSchema,
|
|
1094
1207
|
district: textField(),
|
|
@@ -1101,8 +1214,10 @@ var eosPjObject = zod.z.object({
|
|
|
1101
1214
|
}).strict()
|
|
1102
1215
|
)
|
|
1103
1216
|
});
|
|
1104
|
-
var eosPjSchema = eosPjObject.strict().
|
|
1105
|
-
|
|
1217
|
+
var eosPjSchema = eosPjObject.strict().check(pjRefinement);
|
|
1218
|
+
|
|
1219
|
+
// src/domains/financing/formalization/schemas/HdtEnergyPFSchema.ts
|
|
1220
|
+
var hdtEnergyPfObject = requiredObject({
|
|
1106
1221
|
...formalizationExtras,
|
|
1107
1222
|
name: textField(),
|
|
1108
1223
|
cep: cepSchema,
|
|
@@ -1111,12 +1226,12 @@ var hdtEnergyPfObject = zod.z.object({
|
|
|
1111
1226
|
birth_date: birthDateSchema,
|
|
1112
1227
|
number: textField(),
|
|
1113
1228
|
sex: SexEnum,
|
|
1114
|
-
complement: textField(15)
|
|
1229
|
+
complement: optionalField(textField(15)),
|
|
1115
1230
|
mother_name: textField(),
|
|
1116
1231
|
district: textField(),
|
|
1117
1232
|
energy_account_in_requester_name: textField(),
|
|
1118
1233
|
city: textField(),
|
|
1119
|
-
energy_bill_owner_document: cpfCnpjSchema
|
|
1234
|
+
energy_bill_owner_document: optionalField(cpfCnpjSchema),
|
|
1120
1235
|
state: UfEnum,
|
|
1121
1236
|
nationality: NationalityEnum.default(NATIONALITY_BRAZIL),
|
|
1122
1237
|
cellphone: phoneBRSchema,
|
|
@@ -1128,10 +1243,12 @@ var hdtEnergyPfObject = zod.z.object({
|
|
|
1128
1243
|
issuing_body: textField(6),
|
|
1129
1244
|
doc_issue_date: issueDateSchema
|
|
1130
1245
|
});
|
|
1131
|
-
var hdtEnergyPfSchema = hdtEnergyPfObject.strict().
|
|
1132
|
-
|
|
1246
|
+
var hdtEnergyPfSchema = hdtEnergyPfObject.strict().check(pfRefinement);
|
|
1247
|
+
|
|
1248
|
+
// src/domains/financing/formalization/schemas/HdtEnergyPJSchema.ts
|
|
1249
|
+
var hdtEnergyPjObject = requiredObject({
|
|
1133
1250
|
...formalizationExtras,
|
|
1134
|
-
financing_company:
|
|
1251
|
+
financing_company: requiredObject({
|
|
1135
1252
|
corporate_name: textField(),
|
|
1136
1253
|
cep: cepSchema,
|
|
1137
1254
|
address: textField(),
|
|
@@ -1139,7 +1256,7 @@ var hdtEnergyPjObject = zod.z.object({
|
|
|
1139
1256
|
number: textField(),
|
|
1140
1257
|
cnpj: cnpjSchema,
|
|
1141
1258
|
email: emailSchema,
|
|
1142
|
-
complement: textField(15)
|
|
1259
|
+
complement: optionalField(textField(15)),
|
|
1143
1260
|
phone: phoneBRSchema,
|
|
1144
1261
|
district: textField(),
|
|
1145
1262
|
legal_nature: textField(),
|
|
@@ -1149,15 +1266,15 @@ var hdtEnergyPjObject = zod.z.object({
|
|
|
1149
1266
|
economic_activity: textField(),
|
|
1150
1267
|
monthly_income: currencySchema
|
|
1151
1268
|
}).strict(),
|
|
1152
|
-
financing_company_guarantor:
|
|
1153
|
-
|
|
1269
|
+
financing_company_guarantor: requiredArray(
|
|
1270
|
+
requiredObject({
|
|
1154
1271
|
name: textField(),
|
|
1155
1272
|
cep: cepSchema,
|
|
1156
1273
|
cpf: cpfSchema,
|
|
1157
1274
|
address: textField(),
|
|
1158
1275
|
birth_date: birthDateSchema,
|
|
1159
1276
|
number: textField(),
|
|
1160
|
-
complement: textField(15)
|
|
1277
|
+
complement: optionalField(textField(15)),
|
|
1161
1278
|
cellphone: phoneBRSchema,
|
|
1162
1279
|
email: emailSchema,
|
|
1163
1280
|
district: textField(),
|
|
@@ -1170,8 +1287,10 @@ var hdtEnergyPjObject = zod.z.object({
|
|
|
1170
1287
|
}).strict()
|
|
1171
1288
|
)
|
|
1172
1289
|
});
|
|
1173
|
-
var hdtEnergyPjSchema = hdtEnergyPjObject.strict().
|
|
1174
|
-
|
|
1290
|
+
var hdtEnergyPjSchema = hdtEnergyPjObject.strict().check(pjRefinement);
|
|
1291
|
+
|
|
1292
|
+
// src/domains/financing/formalization/schemas/LosangoPFSchema.ts
|
|
1293
|
+
var losangoPfObject = requiredObject({
|
|
1175
1294
|
...formalizationExtras,
|
|
1176
1295
|
name: textField(),
|
|
1177
1296
|
cep: cepSchema,
|
|
@@ -1180,12 +1299,12 @@ var losangoPfObject = zod.z.object({
|
|
|
1180
1299
|
birth_date: birthDateSchema,
|
|
1181
1300
|
number: textField(),
|
|
1182
1301
|
sex: SexEnum,
|
|
1183
|
-
complement: textField(15)
|
|
1302
|
+
complement: optionalField(textField(15)),
|
|
1184
1303
|
mother_name: textField(),
|
|
1185
1304
|
district: textField(),
|
|
1186
1305
|
energy_account_in_requester_name: textField(),
|
|
1187
1306
|
city: textField(),
|
|
1188
|
-
energy_bill_owner_document: cpfCnpjSchema
|
|
1307
|
+
energy_bill_owner_document: optionalField(cpfCnpjSchema),
|
|
1189
1308
|
state: UfEnum,
|
|
1190
1309
|
nationality: NationalityEnum.default(NATIONALITY_BRAZIL),
|
|
1191
1310
|
cellphone: phoneBRSchema,
|
|
@@ -1197,10 +1316,12 @@ var losangoPfObject = zod.z.object({
|
|
|
1197
1316
|
issuing_body: textField(6),
|
|
1198
1317
|
doc_issue_date: issueDateSchema
|
|
1199
1318
|
});
|
|
1200
|
-
var losangoPfSchema = losangoPfObject.strict().
|
|
1201
|
-
|
|
1319
|
+
var losangoPfSchema = losangoPfObject.strict().check(pfRefinement);
|
|
1320
|
+
|
|
1321
|
+
// src/domains/financing/formalization/schemas/LosangoPJSchema.ts
|
|
1322
|
+
var losangoPjObject = requiredObject({
|
|
1202
1323
|
...formalizationExtras,
|
|
1203
|
-
financing_company:
|
|
1324
|
+
financing_company: requiredObject({
|
|
1204
1325
|
corporate_name: textField(),
|
|
1205
1326
|
cep: cepSchema,
|
|
1206
1327
|
address: textField(),
|
|
@@ -1208,7 +1329,7 @@ var losangoPjObject = zod.z.object({
|
|
|
1208
1329
|
number: textField(),
|
|
1209
1330
|
cnpj: cnpjSchema,
|
|
1210
1331
|
email: emailSchema,
|
|
1211
|
-
complement: textField(15)
|
|
1332
|
+
complement: optionalField(textField(15)),
|
|
1212
1333
|
phone: phoneBRSchema,
|
|
1213
1334
|
district: textField(),
|
|
1214
1335
|
legal_nature: textField(),
|
|
@@ -1218,15 +1339,15 @@ var losangoPjObject = zod.z.object({
|
|
|
1218
1339
|
economic_activity: textField(),
|
|
1219
1340
|
monthly_income: currencySchema
|
|
1220
1341
|
}).strict(),
|
|
1221
|
-
financing_company_guarantor:
|
|
1222
|
-
|
|
1342
|
+
financing_company_guarantor: requiredArray(
|
|
1343
|
+
requiredObject({
|
|
1223
1344
|
name: textField(),
|
|
1224
1345
|
cep: cepSchema,
|
|
1225
1346
|
cpf: cpfSchema,
|
|
1226
1347
|
address: textField(),
|
|
1227
1348
|
birth_date: birthDateSchema,
|
|
1228
1349
|
number: textField(),
|
|
1229
|
-
complement: textField(15)
|
|
1350
|
+
complement: optionalField(textField(15)),
|
|
1230
1351
|
cellphone: phoneBRSchema,
|
|
1231
1352
|
email: emailSchema,
|
|
1232
1353
|
district: textField(),
|
|
@@ -1239,8 +1360,10 @@ var losangoPjObject = zod.z.object({
|
|
|
1239
1360
|
}).strict()
|
|
1240
1361
|
)
|
|
1241
1362
|
});
|
|
1242
|
-
var losangoPjSchema = losangoPjObject.strict().
|
|
1243
|
-
|
|
1363
|
+
var losangoPjSchema = losangoPjObject.strict().check(pjRefinement);
|
|
1364
|
+
|
|
1365
|
+
// src/domains/financing/formalization/schemas/SafraPFSchema.ts
|
|
1366
|
+
var safraPfObject = requiredObject({
|
|
1244
1367
|
...formalizationExtras,
|
|
1245
1368
|
name: textField(),
|
|
1246
1369
|
cep: cepSchema,
|
|
@@ -1249,12 +1372,12 @@ var safraPfObject = zod.z.object({
|
|
|
1249
1372
|
birth_date: birthDateSchema,
|
|
1250
1373
|
number: textField(),
|
|
1251
1374
|
sex: SexEnum,
|
|
1252
|
-
complement: textField(15)
|
|
1375
|
+
complement: optionalField(textField(15)),
|
|
1253
1376
|
mother_name: textField(),
|
|
1254
1377
|
district: textField(),
|
|
1255
1378
|
energy_account_in_requester_name: textField(),
|
|
1256
1379
|
city: textField(),
|
|
1257
|
-
energy_bill_owner_document: cpfCnpjSchema
|
|
1380
|
+
energy_bill_owner_document: optionalField(cpfCnpjSchema),
|
|
1258
1381
|
state: UfEnum,
|
|
1259
1382
|
nationality: NationalityEnum.default(NATIONALITY_BRAZIL),
|
|
1260
1383
|
cellphone: phoneBRSchema,
|
|
@@ -1266,10 +1389,12 @@ var safraPfObject = zod.z.object({
|
|
|
1266
1389
|
issuing_body: textField(6),
|
|
1267
1390
|
doc_issue_date: issueDateSchema
|
|
1268
1391
|
});
|
|
1269
|
-
var safraPfSchema = safraPfObject.strict().
|
|
1270
|
-
|
|
1392
|
+
var safraPfSchema = safraPfObject.strict().check(pfRefinement);
|
|
1393
|
+
|
|
1394
|
+
// src/domains/financing/formalization/schemas/SafraPJSchema.ts
|
|
1395
|
+
var safraPjObject = requiredObject({
|
|
1271
1396
|
...formalizationExtras,
|
|
1272
|
-
financing_company:
|
|
1397
|
+
financing_company: requiredObject({
|
|
1273
1398
|
corporate_name: textField(),
|
|
1274
1399
|
cep: cepSchema,
|
|
1275
1400
|
address: textField(),
|
|
@@ -1277,7 +1402,7 @@ var safraPjObject = zod.z.object({
|
|
|
1277
1402
|
number: textField(),
|
|
1278
1403
|
cnpj: cnpjSchema,
|
|
1279
1404
|
email: emailSchema,
|
|
1280
|
-
complement: textField(15)
|
|
1405
|
+
complement: optionalField(textField(15)),
|
|
1281
1406
|
phone: phoneBRSchema,
|
|
1282
1407
|
district: textField(),
|
|
1283
1408
|
legal_nature: textField(),
|
|
@@ -1287,15 +1412,15 @@ var safraPjObject = zod.z.object({
|
|
|
1287
1412
|
economic_activity: textField(),
|
|
1288
1413
|
monthly_income: currencySchema
|
|
1289
1414
|
}).strict(),
|
|
1290
|
-
financing_company_guarantor:
|
|
1291
|
-
|
|
1415
|
+
financing_company_guarantor: requiredArray(
|
|
1416
|
+
requiredObject({
|
|
1292
1417
|
name: textField(),
|
|
1293
1418
|
cep: cepSchema,
|
|
1294
1419
|
cpf: cpfSchema,
|
|
1295
1420
|
address: textField(),
|
|
1296
1421
|
birth_date: birthDateSchema,
|
|
1297
1422
|
number: textField(),
|
|
1298
|
-
complement: textField(15)
|
|
1423
|
+
complement: optionalField(textField(15)),
|
|
1299
1424
|
cellphone: phoneBRSchema,
|
|
1300
1425
|
email: emailSchema,
|
|
1301
1426
|
district: textField(),
|
|
@@ -1308,8 +1433,10 @@ var safraPjObject = zod.z.object({
|
|
|
1308
1433
|
}).strict()
|
|
1309
1434
|
)
|
|
1310
1435
|
});
|
|
1311
|
-
var safraPjSchema = safraPjObject.strict().
|
|
1312
|
-
|
|
1436
|
+
var safraPjSchema = safraPjObject.strict().check(pjRefinement);
|
|
1437
|
+
|
|
1438
|
+
// src/domains/financing/formalization/schemas/SantanderPFSchema.ts
|
|
1439
|
+
var santanderPfObject = requiredObject({
|
|
1313
1440
|
...formalizationExtras,
|
|
1314
1441
|
name: textField(),
|
|
1315
1442
|
cep: cepSchema,
|
|
@@ -1318,12 +1445,12 @@ var santanderPfObject = zod.z.object({
|
|
|
1318
1445
|
birth_date: birthDateSchema,
|
|
1319
1446
|
number: textField(),
|
|
1320
1447
|
sex: SexEnum,
|
|
1321
|
-
complement: textField(15)
|
|
1448
|
+
complement: optionalField(textField(15)),
|
|
1322
1449
|
mother_name: textField(),
|
|
1323
1450
|
district: textField(),
|
|
1324
1451
|
energy_account_in_requester_name: textField(),
|
|
1325
1452
|
city: textField(),
|
|
1326
|
-
energy_bill_owner_document: cpfCnpjSchema
|
|
1453
|
+
energy_bill_owner_document: optionalField(cpfCnpjSchema),
|
|
1327
1454
|
state: UfEnum,
|
|
1328
1455
|
nationality: NationalityEnum.default(NATIONALITY_BRAZIL),
|
|
1329
1456
|
cellphone: phoneBRSchema,
|
|
@@ -1335,10 +1462,12 @@ var santanderPfObject = zod.z.object({
|
|
|
1335
1462
|
issuing_body: textField(6),
|
|
1336
1463
|
doc_issue_date: issueDateSchema
|
|
1337
1464
|
});
|
|
1338
|
-
var santanderPfSchema = santanderPfObject.strict().
|
|
1339
|
-
|
|
1465
|
+
var santanderPfSchema = santanderPfObject.strict().check(pfRefinement);
|
|
1466
|
+
|
|
1467
|
+
// src/domains/financing/formalization/schemas/SantanderPJSchema.ts
|
|
1468
|
+
var santanderPjObject = requiredObject({
|
|
1340
1469
|
...formalizationExtras,
|
|
1341
|
-
financing_company:
|
|
1470
|
+
financing_company: requiredObject({
|
|
1342
1471
|
corporate_name: textField(),
|
|
1343
1472
|
cep: cepSchema,
|
|
1344
1473
|
address: textField(),
|
|
@@ -1346,7 +1475,7 @@ var santanderPjObject = zod.z.object({
|
|
|
1346
1475
|
number: textField(),
|
|
1347
1476
|
cnpj: cnpjSchema,
|
|
1348
1477
|
email: emailSchema,
|
|
1349
|
-
complement: textField(15)
|
|
1478
|
+
complement: optionalField(textField(15)),
|
|
1350
1479
|
phone: phoneBRSchema,
|
|
1351
1480
|
district: textField(),
|
|
1352
1481
|
legal_nature: textField(),
|
|
@@ -1356,15 +1485,15 @@ var santanderPjObject = zod.z.object({
|
|
|
1356
1485
|
economic_activity: textField(),
|
|
1357
1486
|
monthly_income: currencySchema
|
|
1358
1487
|
}).strict(),
|
|
1359
|
-
financing_company_guarantor:
|
|
1360
|
-
|
|
1488
|
+
financing_company_guarantor: requiredArray(
|
|
1489
|
+
requiredObject({
|
|
1361
1490
|
name: textField(),
|
|
1362
1491
|
cep: cepSchema,
|
|
1363
1492
|
cpf: cpfSchema,
|
|
1364
1493
|
address: textField(),
|
|
1365
1494
|
birth_date: birthDateSchema,
|
|
1366
1495
|
number: textField(),
|
|
1367
|
-
complement: textField(15)
|
|
1496
|
+
complement: optionalField(textField(15)),
|
|
1368
1497
|
cellphone: phoneBRSchema,
|
|
1369
1498
|
email: emailSchema,
|
|
1370
1499
|
district: textField(),
|
|
@@ -1377,8 +1506,10 @@ var santanderPjObject = zod.z.object({
|
|
|
1377
1506
|
}).strict()
|
|
1378
1507
|
)
|
|
1379
1508
|
});
|
|
1380
|
-
var santanderPjSchema = santanderPjObject.strict().
|
|
1381
|
-
|
|
1509
|
+
var santanderPjSchema = santanderPjObject.strict().check(pjRefinement);
|
|
1510
|
+
|
|
1511
|
+
// src/domains/financing/formalization/schemas/SolAgoraPFSchema.ts
|
|
1512
|
+
var solAgoraPfObject = requiredObject({
|
|
1382
1513
|
...formalizationExtras,
|
|
1383
1514
|
name: textField(),
|
|
1384
1515
|
cep: cepSchema,
|
|
@@ -1387,12 +1518,12 @@ var solAgoraPfObject = zod.z.object({
|
|
|
1387
1518
|
birth_date: birthDateSchema,
|
|
1388
1519
|
number: textField(),
|
|
1389
1520
|
sex: SexEnum,
|
|
1390
|
-
complement: textField(15)
|
|
1521
|
+
complement: optionalField(textField(15)),
|
|
1391
1522
|
mother_name: textField(),
|
|
1392
1523
|
district: textField(),
|
|
1393
1524
|
energy_account_in_requester_name: textField(),
|
|
1394
1525
|
city: textField(),
|
|
1395
|
-
energy_bill_owner_document: cpfCnpjSchema
|
|
1526
|
+
energy_bill_owner_document: optionalField(cpfCnpjSchema),
|
|
1396
1527
|
state: UfEnum,
|
|
1397
1528
|
nationality: NationalityEnum.default(NATIONALITY_BRAZIL),
|
|
1398
1529
|
cellphone: phoneBRSchema,
|
|
@@ -1404,10 +1535,12 @@ var solAgoraPfObject = zod.z.object({
|
|
|
1404
1535
|
issuing_body: textField(6),
|
|
1405
1536
|
doc_issue_date: issueDateSchema
|
|
1406
1537
|
});
|
|
1407
|
-
var solAgoraPfSchema = solAgoraPfObject.strict().
|
|
1408
|
-
|
|
1538
|
+
var solAgoraPfSchema = solAgoraPfObject.strict().check(pfRefinement);
|
|
1539
|
+
|
|
1540
|
+
// src/domains/financing/formalization/schemas/SolAgoraPJSchema.ts
|
|
1541
|
+
var solAgoraPjObject = requiredObject({
|
|
1409
1542
|
...formalizationExtras,
|
|
1410
|
-
financing_company:
|
|
1543
|
+
financing_company: requiredObject({
|
|
1411
1544
|
corporate_name: textField(),
|
|
1412
1545
|
cep: cepSchema,
|
|
1413
1546
|
address: textField(),
|
|
@@ -1415,7 +1548,7 @@ var solAgoraPjObject = zod.z.object({
|
|
|
1415
1548
|
number: textField(),
|
|
1416
1549
|
cnpj: cnpjSchema,
|
|
1417
1550
|
email: emailSchema,
|
|
1418
|
-
complement: textField(15)
|
|
1551
|
+
complement: optionalField(textField(15)),
|
|
1419
1552
|
phone: phoneBRSchema,
|
|
1420
1553
|
district: textField(),
|
|
1421
1554
|
legal_nature: textField(),
|
|
@@ -1425,15 +1558,15 @@ var solAgoraPjObject = zod.z.object({
|
|
|
1425
1558
|
economic_activity: textField(),
|
|
1426
1559
|
monthly_income: currencySchema
|
|
1427
1560
|
}).strict(),
|
|
1428
|
-
financing_company_qsa:
|
|
1429
|
-
|
|
1561
|
+
financing_company_qsa: requiredArray(
|
|
1562
|
+
requiredObject({
|
|
1430
1563
|
cep: cepSchema,
|
|
1431
1564
|
name: textField(),
|
|
1432
1565
|
address: textField(),
|
|
1433
1566
|
cpf: cpfSchema,
|
|
1434
1567
|
number: textField(),
|
|
1435
1568
|
entry_date: issueDateSchema,
|
|
1436
|
-
complement: textField(15)
|
|
1569
|
+
complement: optionalField(textField(15)),
|
|
1437
1570
|
phone: phoneBRSchema,
|
|
1438
1571
|
district: textField(),
|
|
1439
1572
|
cellphone: phoneBRSchema,
|
|
@@ -1455,8 +1588,10 @@ var solAgoraPjObject = zod.z.object({
|
|
|
1455
1588
|
}).strict()
|
|
1456
1589
|
)
|
|
1457
1590
|
});
|
|
1458
|
-
var solAgoraPjSchema = solAgoraPjObject.strict().
|
|
1459
|
-
|
|
1591
|
+
var solAgoraPjSchema = solAgoraPjObject.strict().check(pjRefinement);
|
|
1592
|
+
|
|
1593
|
+
// src/domains/financing/formalization/schemas/SolfacilPFSchema.ts
|
|
1594
|
+
var solfacilPfObject = requiredObject({
|
|
1460
1595
|
...formalizationExtras,
|
|
1461
1596
|
name: textField(),
|
|
1462
1597
|
cep: cepSchema,
|
|
@@ -1465,12 +1600,12 @@ var solfacilPfObject = zod.z.object({
|
|
|
1465
1600
|
birth_date: birthDateSchema,
|
|
1466
1601
|
number: textField(),
|
|
1467
1602
|
sex: SexEnum,
|
|
1468
|
-
complement: textField(15)
|
|
1603
|
+
complement: optionalField(textField(15)),
|
|
1469
1604
|
mother_name: textField(),
|
|
1470
1605
|
district: textField(),
|
|
1471
1606
|
energy_account_in_requester_name: textField(),
|
|
1472
1607
|
city: textField(),
|
|
1473
|
-
energy_bill_owner_document: cpfCnpjSchema
|
|
1608
|
+
energy_bill_owner_document: optionalField(cpfCnpjSchema),
|
|
1474
1609
|
state: UfEnum,
|
|
1475
1610
|
nationality: NationalityEnum.default(NATIONALITY_BRAZIL),
|
|
1476
1611
|
cellphone: phoneBRSchema,
|
|
@@ -1482,10 +1617,12 @@ var solfacilPfObject = zod.z.object({
|
|
|
1482
1617
|
issuing_body: textField(6),
|
|
1483
1618
|
doc_issue_date: issueDateSchema
|
|
1484
1619
|
});
|
|
1485
|
-
var solfacilPfSchema = solfacilPfObject.strict().
|
|
1486
|
-
|
|
1620
|
+
var solfacilPfSchema = solfacilPfObject.strict().check(pfRefinement);
|
|
1621
|
+
|
|
1622
|
+
// src/domains/financing/formalization/schemas/SolfacilPJSchema.ts
|
|
1623
|
+
var solfacilPjObject = requiredObject({
|
|
1487
1624
|
...formalizationExtras,
|
|
1488
|
-
financing_company:
|
|
1625
|
+
financing_company: requiredObject({
|
|
1489
1626
|
corporate_name: textField(),
|
|
1490
1627
|
cep: cepSchema,
|
|
1491
1628
|
address: textField(),
|
|
@@ -1493,22 +1630,22 @@ var solfacilPjObject = zod.z.object({
|
|
|
1493
1630
|
number: textField(),
|
|
1494
1631
|
cnpj: cnpjSchema,
|
|
1495
1632
|
email: emailSchema,
|
|
1496
|
-
complement: textField(15)
|
|
1633
|
+
complement: optionalField(textField(15)),
|
|
1497
1634
|
phone: phoneBRSchema,
|
|
1498
1635
|
district: textField(),
|
|
1499
1636
|
legal_nature: textField(),
|
|
1500
1637
|
city: textField(),
|
|
1501
1638
|
state: UfEnum
|
|
1502
1639
|
}).strict(),
|
|
1503
|
-
financing_company_guarantor:
|
|
1504
|
-
|
|
1640
|
+
financing_company_guarantor: requiredArray(
|
|
1641
|
+
requiredObject({
|
|
1505
1642
|
name: textField(),
|
|
1506
1643
|
cep: cepSchema,
|
|
1507
1644
|
cpf: cpfSchema,
|
|
1508
1645
|
address: textField(),
|
|
1509
1646
|
birth_date: birthDateSchema,
|
|
1510
1647
|
number: textField(),
|
|
1511
|
-
complement: textField(15)
|
|
1648
|
+
complement: optionalField(textField(15)),
|
|
1512
1649
|
cellphone: phoneBRSchema,
|
|
1513
1650
|
phone: phoneBRSchema,
|
|
1514
1651
|
email: emailSchema,
|
|
@@ -1529,8 +1666,10 @@ var solfacilPjObject = zod.z.object({
|
|
|
1529
1666
|
}).strict()
|
|
1530
1667
|
)
|
|
1531
1668
|
});
|
|
1532
|
-
var solfacilPjSchema = solfacilPjObject.strict().
|
|
1533
|
-
|
|
1669
|
+
var solfacilPjSchema = solfacilPjObject.strict().check(pjRefinement);
|
|
1670
|
+
|
|
1671
|
+
// src/domains/financing/formalization/schemas/UnifiedPFSchema.ts
|
|
1672
|
+
var unifiedPfObject = requiredObject({
|
|
1534
1673
|
name: textField(),
|
|
1535
1674
|
cep: cepSchema,
|
|
1536
1675
|
cpf: cpfSchema,
|
|
@@ -1538,12 +1677,12 @@ var unifiedPfObject = zod.z.object({
|
|
|
1538
1677
|
birth_date: birthDateSchema,
|
|
1539
1678
|
number: textField(),
|
|
1540
1679
|
sex: SexEnum,
|
|
1541
|
-
complement: textField(15)
|
|
1680
|
+
complement: optionalField(textField(15)),
|
|
1542
1681
|
mother_name: textField(),
|
|
1543
1682
|
district: textField(),
|
|
1544
1683
|
energy_account_in_requester_name: YesOrNoEnum,
|
|
1545
1684
|
city: textField(),
|
|
1546
|
-
energy_bill_owner_document: cpfCnpjSchema
|
|
1685
|
+
energy_bill_owner_document: optionalField(cpfCnpjSchema),
|
|
1547
1686
|
state: UfEnum,
|
|
1548
1687
|
nationality: NationalityEnum.default(NATIONALITY_BRAZIL),
|
|
1549
1688
|
cellphone: phoneBRSchema,
|
|
@@ -1555,60 +1694,62 @@ var unifiedPfObject = zod.z.object({
|
|
|
1555
1694
|
issuing_body: textField(6),
|
|
1556
1695
|
doc_issue_date: issueDateSchema,
|
|
1557
1696
|
residence_situation: ResidenceTypeEnum,
|
|
1558
|
-
months_in_residence: integerField
|
|
1697
|
+
months_in_residence: optionalField(integerField),
|
|
1559
1698
|
civil_status: CivilStatusEnum,
|
|
1560
1699
|
uf_naturalness: UfEnum,
|
|
1561
|
-
naturalness: textField()
|
|
1700
|
+
naturalness: optionalField(textField()),
|
|
1562
1701
|
nature_of_occupation: NatureOfOccupationTypeEnum,
|
|
1563
|
-
company_time: numberField
|
|
1564
|
-
cnpj_proprietary: cnpjSchema
|
|
1565
|
-
equity_value:
|
|
1702
|
+
company_time: optionalField(numberField),
|
|
1703
|
+
cnpj_proprietary: optionalField(cnpjSchema),
|
|
1704
|
+
equity_value: optionalCurrencySchema,
|
|
1566
1705
|
emitting_state: UfEnum,
|
|
1567
1706
|
pep_relationship: YesOrNoEnum,
|
|
1568
|
-
social_name: textField()
|
|
1569
|
-
partner_name: textField()
|
|
1570
|
-
partner_birth: dateDMYSchema
|
|
1571
|
-
partner_type_doc: DocumentTypeEnum
|
|
1572
|
-
partner_doc: textField()
|
|
1573
|
-
partner_cpf: cpfSchema
|
|
1574
|
-
partner_city: textField()
|
|
1575
|
-
communion_regime: CommunionRegimeEnum
|
|
1576
|
-
rural_area: textField(3)
|
|
1707
|
+
social_name: optionalField(textField()),
|
|
1708
|
+
partner_name: optionalField(textField()),
|
|
1709
|
+
partner_birth: optionalField(dateDMYSchema),
|
|
1710
|
+
partner_type_doc: optionalField(DocumentTypeEnum),
|
|
1711
|
+
partner_doc: optionalField(textField()),
|
|
1712
|
+
partner_cpf: optionalField(cpfSchema),
|
|
1713
|
+
partner_city: optionalField(textField()),
|
|
1714
|
+
communion_regime: optionalField(CommunionRegimeEnum),
|
|
1715
|
+
rural_area: optionalField(textField(3)),
|
|
1577
1716
|
...formalizationExtras
|
|
1578
1717
|
});
|
|
1579
|
-
var unifiedPfSchema = unifiedPfObject.strict().
|
|
1580
|
-
|
|
1718
|
+
var unifiedPfSchema = unifiedPfObject.strict().check(pfRefinement);
|
|
1719
|
+
|
|
1720
|
+
// src/domains/financing/formalization/schemas/UnifiedPJSchema.ts
|
|
1721
|
+
var unifiedPjObject = requiredObject({
|
|
1581
1722
|
...formalizationExtras,
|
|
1582
|
-
financing_company:
|
|
1723
|
+
financing_company: requiredObject({
|
|
1583
1724
|
corporate_name: textField(),
|
|
1584
1725
|
cnpj: cnpjSchema,
|
|
1585
1726
|
foundation_date: issueDateSchema,
|
|
1586
1727
|
address: textField(),
|
|
1587
1728
|
number: textField(),
|
|
1588
1729
|
email: emailSchema,
|
|
1589
|
-
complement: textField(15)
|
|
1730
|
+
complement: optionalField(textField(15)),
|
|
1590
1731
|
phone: phoneBRSchema,
|
|
1591
1732
|
district: textField(),
|
|
1592
1733
|
legal_nature: textField(),
|
|
1593
1734
|
city: textField(),
|
|
1594
1735
|
state: UfEnum,
|
|
1595
1736
|
cep: cepSchema,
|
|
1596
|
-
economic_activity: textField()
|
|
1597
|
-
economic_activity_group: textField()
|
|
1598
|
-
monthly_income:
|
|
1599
|
-
residence_situation: textField()
|
|
1600
|
-
months_in_residence: integerField
|
|
1601
|
-
capital_social:
|
|
1737
|
+
economic_activity: optionalField(textField()),
|
|
1738
|
+
economic_activity_group: optionalField(textField()),
|
|
1739
|
+
monthly_income: optionalCurrencySchema,
|
|
1740
|
+
residence_situation: optionalField(textField()),
|
|
1741
|
+
months_in_residence: optionalField(integerField),
|
|
1742
|
+
capital_social: optionalCurrencySchema
|
|
1602
1743
|
}).strict(),
|
|
1603
|
-
financing_company_guarantor:
|
|
1604
|
-
|
|
1744
|
+
financing_company_guarantor: requiredArray(
|
|
1745
|
+
requiredObject({
|
|
1605
1746
|
name: textField(),
|
|
1606
1747
|
cpf: cpfSchema,
|
|
1607
1748
|
birth_date: birthDateSchema,
|
|
1608
1749
|
address: textField(),
|
|
1609
1750
|
number: textField(),
|
|
1610
1751
|
cep: cepSchema,
|
|
1611
|
-
complement: textField(15)
|
|
1752
|
+
complement: optionalField(textField(15)),
|
|
1612
1753
|
cellphone: phoneBRSchema,
|
|
1613
1754
|
email: emailSchema,
|
|
1614
1755
|
district: textField(),
|
|
@@ -1617,35 +1758,35 @@ var unifiedPjObject = zod.z.object({
|
|
|
1617
1758
|
state: UfEnum,
|
|
1618
1759
|
mother_name: textField(),
|
|
1619
1760
|
nationality: NationalityEnum.default(NATIONALITY_BRAZIL),
|
|
1620
|
-
office: textField()
|
|
1621
|
-
phone: phoneBRSchema
|
|
1622
|
-
civil_status: textField()
|
|
1623
|
-
residence_situation: textField()
|
|
1624
|
-
months_in_residence: integerField
|
|
1625
|
-
type_doc: DocumentTypeEnum
|
|
1626
|
-
doc: textField()
|
|
1627
|
-
issuing_body: textField()
|
|
1628
|
-
uf_issuing_body: UfEnum
|
|
1629
|
-
doc_issue_date: issueDateSchema
|
|
1630
|
-
doc_expiration_date: dateDMYSchema
|
|
1631
|
-
monthly_income:
|
|
1632
|
-
patrimony:
|
|
1633
|
-
naturalness: textField()
|
|
1634
|
-
uf_naturalness: UfEnum
|
|
1635
|
-
pep_relationship: textField()
|
|
1636
|
-
entry_date: issueDateSchema
|
|
1637
|
-
doc_issuance_uf: UfEnum
|
|
1761
|
+
office: optionalField(textField()),
|
|
1762
|
+
phone: optionalField(phoneBRSchema),
|
|
1763
|
+
civil_status: optionalField(textField()),
|
|
1764
|
+
residence_situation: optionalField(textField()),
|
|
1765
|
+
months_in_residence: optionalField(integerField),
|
|
1766
|
+
type_doc: optionalField(DocumentTypeEnum),
|
|
1767
|
+
doc: optionalField(textField()),
|
|
1768
|
+
issuing_body: optionalField(textField()),
|
|
1769
|
+
uf_issuing_body: optionalField(UfEnum),
|
|
1770
|
+
doc_issue_date: optionalField(issueDateSchema),
|
|
1771
|
+
doc_expiration_date: optionalField(dateDMYSchema),
|
|
1772
|
+
monthly_income: optionalCurrencySchema,
|
|
1773
|
+
patrimony: optionalCurrencySchema,
|
|
1774
|
+
naturalness: optionalField(textField()),
|
|
1775
|
+
uf_naturalness: optionalField(UfEnum),
|
|
1776
|
+
pep_relationship: optionalField(textField()),
|
|
1777
|
+
entry_date: optionalField(issueDateSchema),
|
|
1778
|
+
doc_issuance_uf: optionalField(UfEnum)
|
|
1638
1779
|
}).strict()
|
|
1639
1780
|
).optional(),
|
|
1640
|
-
financing_company_qsa:
|
|
1641
|
-
|
|
1781
|
+
financing_company_qsa: requiredArray(
|
|
1782
|
+
requiredObject({
|
|
1642
1783
|
name: textField(),
|
|
1643
1784
|
cpf: cpfSchema,
|
|
1644
1785
|
birth_date: birthDateSchema,
|
|
1645
1786
|
address: textField(),
|
|
1646
1787
|
number: textField(),
|
|
1647
1788
|
cep: cepSchema,
|
|
1648
|
-
complement: textField(15)
|
|
1789
|
+
complement: optionalField(textField(15)),
|
|
1649
1790
|
cellphone: phoneBRSchema,
|
|
1650
1791
|
email: emailSchema,
|
|
1651
1792
|
district: textField(),
|
|
@@ -1654,28 +1795,28 @@ var unifiedPjObject = zod.z.object({
|
|
|
1654
1795
|
state: UfEnum,
|
|
1655
1796
|
mother_name: textField(),
|
|
1656
1797
|
nationality: NationalityEnum.default(NATIONALITY_BRAZIL),
|
|
1657
|
-
office: textField()
|
|
1658
|
-
phone: phoneBRSchema
|
|
1659
|
-
civil_status: textField()
|
|
1660
|
-
residence_situation: textField()
|
|
1661
|
-
months_in_residence: integerField
|
|
1662
|
-
type_doc: DocumentTypeEnum
|
|
1663
|
-
doc: textField()
|
|
1664
|
-
issuing_body: textField()
|
|
1665
|
-
uf_issuing_body: UfEnum
|
|
1666
|
-
doc_issue_date: issueDateSchema
|
|
1667
|
-
doc_expiration_date: dateDMYSchema
|
|
1668
|
-
monthly_income:
|
|
1669
|
-
patrimony:
|
|
1670
|
-
naturalness: textField()
|
|
1671
|
-
uf_naturalness: UfEnum
|
|
1672
|
-
pep_relationship: textField()
|
|
1673
|
-
entry_date: issueDateSchema
|
|
1674
|
-
doc_issuance_uf: UfEnum
|
|
1798
|
+
office: optionalField(textField()),
|
|
1799
|
+
phone: optionalField(phoneBRSchema),
|
|
1800
|
+
civil_status: optionalField(textField()),
|
|
1801
|
+
residence_situation: optionalField(textField()),
|
|
1802
|
+
months_in_residence: optionalField(integerField),
|
|
1803
|
+
type_doc: optionalField(DocumentTypeEnum),
|
|
1804
|
+
doc: optionalField(textField()),
|
|
1805
|
+
issuing_body: optionalField(textField()),
|
|
1806
|
+
uf_issuing_body: optionalField(UfEnum),
|
|
1807
|
+
doc_issue_date: optionalField(issueDateSchema),
|
|
1808
|
+
doc_expiration_date: optionalField(dateDMYSchema),
|
|
1809
|
+
monthly_income: optionalCurrencySchema,
|
|
1810
|
+
patrimony: optionalCurrencySchema,
|
|
1811
|
+
naturalness: optionalField(textField()),
|
|
1812
|
+
uf_naturalness: optionalField(UfEnum),
|
|
1813
|
+
pep_relationship: optionalField(textField()),
|
|
1814
|
+
entry_date: optionalField(issueDateSchema),
|
|
1815
|
+
doc_issuance_uf: optionalField(UfEnum)
|
|
1675
1816
|
}).strict()
|
|
1676
1817
|
).optional()
|
|
1677
1818
|
});
|
|
1678
|
-
var unifiedPjSchema = unifiedPjObject.strict().
|
|
1819
|
+
var unifiedPjSchema = unifiedPjObject.strict().check(pjRefinement);
|
|
1679
1820
|
|
|
1680
1821
|
// src/domains/financing/formalization/registry.ts
|
|
1681
1822
|
var UNIFIED_SLUG = "unified";
|
|
@@ -1760,16 +1901,29 @@ var CREDITO77_PRESTAMISTA_FIELDS = {
|
|
|
1760
1901
|
function isCredito77WithoutPrestamista(bank, person, options) {
|
|
1761
1902
|
return bank === "credito77" && person === "pf" && !options.prestamistaIncluso;
|
|
1762
1903
|
}
|
|
1904
|
+
var VALID_BANK_SLUGS = new Set(BANK_SLUGS);
|
|
1905
|
+
function assertValidTarget(bank, person) {
|
|
1906
|
+
if (bank !== UNIFIED_SLUG && !VALID_BANK_SLUGS.has(bank)) {
|
|
1907
|
+
throw new TypeError(
|
|
1908
|
+
`Banco desconhecido: ${JSON.stringify(bank)}. Use '${UNIFIED_SLUG}' ou um de: ${BANK_SLUGS.join(", ")}.`
|
|
1909
|
+
);
|
|
1910
|
+
}
|
|
1911
|
+
if (person !== "pf" && person !== "pj") {
|
|
1912
|
+
throw new TypeError(`Tipo de pessoa desconhecido: ${JSON.stringify(person)}. Use 'pf' ou 'pj'.`);
|
|
1913
|
+
}
|
|
1914
|
+
}
|
|
1763
1915
|
function getFormalizationSchema(bank, person, options = {}) {
|
|
1916
|
+
assertValidTarget(bank, person);
|
|
1764
1917
|
if (bank === UNIFIED_SLUG) {
|
|
1765
1918
|
return unifiedSchemaByPerson[person];
|
|
1766
1919
|
}
|
|
1767
1920
|
if (isCredito77WithoutPrestamista(bank, person, options)) {
|
|
1768
|
-
return credito77PfObject.omit(CREDITO77_PRESTAMISTA_FIELDS).strict().
|
|
1921
|
+
return credito77PfObject.omit(CREDITO77_PRESTAMISTA_FIELDS).strict().check(pfRefinement);
|
|
1769
1922
|
}
|
|
1770
1923
|
return person === "pf" ? pfSchemaRegistry[bank] : pjSchemaRegistry[bank];
|
|
1771
1924
|
}
|
|
1772
1925
|
function getFormalizationBaseSchema(bank, person, options = {}) {
|
|
1926
|
+
assertValidTarget(bank, person);
|
|
1773
1927
|
if (bank === UNIFIED_SLUG) {
|
|
1774
1928
|
return unifiedBaseSchemaByPerson[person];
|
|
1775
1929
|
}
|
|
@@ -1803,6 +1957,24 @@ var FORMALIZATION_FIELD_META = {
|
|
|
1803
1957
|
label: "Documento de v\xEDnculo com o titular",
|
|
1804
1958
|
step: 1
|
|
1805
1959
|
},
|
|
1960
|
+
energy_bill_owner_document: {
|
|
1961
|
+
kind: "cpfCnpj",
|
|
1962
|
+
label: "Documento do titular da conta",
|
|
1963
|
+
step: 1,
|
|
1964
|
+
placeholder: "Digite o CPF ou CNPJ do titular"
|
|
1965
|
+
},
|
|
1966
|
+
// `text`, e não `select`, porque o schema declara textField(): não há
|
|
1967
|
+
// entrada em FORMALIZATION_OPTION_LABELS para renderizar options.
|
|
1968
|
+
is_installation_at_requester: {
|
|
1969
|
+
kind: "text",
|
|
1970
|
+
label: "Instala\xE7\xE3o no endere\xE7o do solicitante",
|
|
1971
|
+
step: 1
|
|
1972
|
+
},
|
|
1973
|
+
rural_area: {
|
|
1974
|
+
kind: "text",
|
|
1975
|
+
label: "\xC1rea rural",
|
|
1976
|
+
step: 1
|
|
1977
|
+
},
|
|
1806
1978
|
type_doc: {
|
|
1807
1979
|
kind: "select",
|
|
1808
1980
|
label: "Tipo de documento",
|
|
@@ -1885,12 +2057,14 @@ var FORMALIZATION_FIELD_META = {
|
|
|
1885
2057
|
step: 3,
|
|
1886
2058
|
placeholder: "Digite o nome da m\xE3e"
|
|
1887
2059
|
},
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
2060
|
+
naturalness: {
|
|
2061
|
+
kind: "text",
|
|
2062
|
+
label: "Naturalidade",
|
|
2063
|
+
step: 3,
|
|
2064
|
+
// O bloco comentado trazia 'Selecione uma opção', que é o placeholder do
|
|
2065
|
+
// uf_naturalness logo abaixo — o campo é textField(), não select.
|
|
2066
|
+
placeholder: "Digite a naturalidade"
|
|
2067
|
+
},
|
|
1894
2068
|
uf_naturalness: {
|
|
1895
2069
|
kind: "select",
|
|
1896
2070
|
label: "UF de naturalidade",
|
|
@@ -1990,6 +2164,42 @@ var FORMALIZATION_FIELD_META = {
|
|
|
1990
2164
|
placeholder: "Digite o tempo de resid\xEAncia em meses"
|
|
1991
2165
|
},
|
|
1992
2166
|
financing_company: { kind: "group", label: "Dados da empresa", step: 4 },
|
|
2167
|
+
// Campos de dentro do grupo `financing_company`, que é step 4. O mapa é
|
|
2168
|
+
// plano por nome de campo, então `phone` e `monthly_income` são
|
|
2169
|
+
// compartilhados com o lado PF.
|
|
2170
|
+
corporate_name: {
|
|
2171
|
+
kind: "text",
|
|
2172
|
+
label: "Raz\xE3o social",
|
|
2173
|
+
step: 4,
|
|
2174
|
+
placeholder: "Digite a raz\xE3o social"
|
|
2175
|
+
},
|
|
2176
|
+
cnpj: { kind: "cnpj", label: "CNPJ", step: 4, placeholder: "Digite o CNPJ" },
|
|
2177
|
+
foundation_date: {
|
|
2178
|
+
kind: "date",
|
|
2179
|
+
label: "Data de funda\xE7\xE3o",
|
|
2180
|
+
step: 4,
|
|
2181
|
+
placeholder: "Digite a data de funda\xE7\xE3o"
|
|
2182
|
+
},
|
|
2183
|
+
legal_nature: {
|
|
2184
|
+
kind: "text",
|
|
2185
|
+
label: "Natureza jur\xEDdica",
|
|
2186
|
+
step: 4,
|
|
2187
|
+
placeholder: "Digite a natureza jur\xEDdica"
|
|
2188
|
+
},
|
|
2189
|
+
economic_activity: {
|
|
2190
|
+
kind: "text",
|
|
2191
|
+
label: "Atividade econ\xF4mica",
|
|
2192
|
+
step: 4,
|
|
2193
|
+
placeholder: "Digite a atividade econ\xF4mica"
|
|
2194
|
+
},
|
|
2195
|
+
economic_activity_group: {
|
|
2196
|
+
kind: "text",
|
|
2197
|
+
label: "Grupo de atividade econ\xF4mica",
|
|
2198
|
+
step: 4,
|
|
2199
|
+
placeholder: "Digite o grupo de atividade econ\xF4mica"
|
|
2200
|
+
},
|
|
2201
|
+
capital_social: { kind: "currency", label: "Capital social", step: 4 },
|
|
2202
|
+
phone: { kind: "phone", label: "Telefone", step: 4, placeholder: "Digite o telefone" },
|
|
1993
2203
|
financing_company_guarantor: { kind: "array", label: "Avalistas", step: 4 },
|
|
1994
2204
|
financing_company_qsa: {
|
|
1995
2205
|
kind: "array",
|
|
@@ -1997,6 +2207,34 @@ var FORMALIZATION_FIELD_META = {
|
|
|
1997
2207
|
step: 4,
|
|
1998
2208
|
placeholder: "Selecione uma op\xE7\xE3o"
|
|
1999
2209
|
},
|
|
2210
|
+
// Campos de dentro de `financing_company_guarantor` / `financing_company_qsa`,
|
|
2211
|
+
// ambos step 4.
|
|
2212
|
+
office: { kind: "text", label: "Cargo", step: 4, placeholder: "Digite o cargo" },
|
|
2213
|
+
patrimony: { kind: "currency", label: "Patrim\xF4nio", step: 4 },
|
|
2214
|
+
uf_issuing_body: {
|
|
2215
|
+
kind: "select",
|
|
2216
|
+
label: "UF do \xF3rg\xE3o emissor",
|
|
2217
|
+
step: 4,
|
|
2218
|
+
placeholder: "Selecione uma op\xE7\xE3o"
|
|
2219
|
+
},
|
|
2220
|
+
doc_issuance_uf: {
|
|
2221
|
+
kind: "select",
|
|
2222
|
+
label: "UF de emiss\xE3o do documento",
|
|
2223
|
+
step: 4,
|
|
2224
|
+
placeholder: "Selecione uma op\xE7\xE3o"
|
|
2225
|
+
},
|
|
2226
|
+
doc_expiration_date: {
|
|
2227
|
+
kind: "date",
|
|
2228
|
+
label: "Data de validade do documento",
|
|
2229
|
+
step: 4,
|
|
2230
|
+
placeholder: "Digite a data de validade do documento"
|
|
2231
|
+
},
|
|
2232
|
+
entry_date: {
|
|
2233
|
+
kind: "date",
|
|
2234
|
+
label: "Data de entrada na sociedade",
|
|
2235
|
+
step: 4,
|
|
2236
|
+
placeholder: "Digite a data de entrada na sociedade"
|
|
2237
|
+
},
|
|
2000
2238
|
social_name: { kind: "text", label: "Nome social", step: 4 },
|
|
2001
2239
|
partner_name: { kind: "text", label: "Nome do c\xF4njuge", step: 4 },
|
|
2002
2240
|
partner_birth: {
|
|
@@ -2053,14 +2291,14 @@ exports.NationalityLabels = NationalityLabels;
|
|
|
2053
2291
|
exports.OCCUPATIONS_REQUIRING_CNPJ = OCCUPATIONS_REQUIRING_CNPJ;
|
|
2054
2292
|
exports.PARTNER_FIELDS = PARTNER_FIELDS;
|
|
2055
2293
|
exports.UNIFIED_SLUG = UNIFIED_SLUG;
|
|
2056
|
-
exports.applyPfRefinements = applyPfRefinements;
|
|
2057
|
-
exports.applyPjRefinements = applyPjRefinements;
|
|
2058
2294
|
exports.getFieldOptions = getFieldOptions;
|
|
2059
2295
|
exports.getFormalizationBaseSchema = getFormalizationBaseSchema;
|
|
2060
2296
|
exports.getFormalizationSchema = getFormalizationSchema;
|
|
2061
2297
|
exports.pfBaseSchemaRegistry = pfBaseSchemaRegistry;
|
|
2298
|
+
exports.pfRefinement = pfRefinement;
|
|
2062
2299
|
exports.pfSchemaRegistry = pfSchemaRegistry;
|
|
2063
2300
|
exports.pjBaseSchemaRegistry = pjBaseSchemaRegistry;
|
|
2301
|
+
exports.pjRefinement = pjRefinement;
|
|
2064
2302
|
exports.pjSchemaRegistry = pjSchemaRegistry;
|
|
2065
2303
|
exports.unifiedPfObject = unifiedPfObject;
|
|
2066
2304
|
exports.unifiedPfSchema = unifiedPfSchema;
|