@77sol-lab/form-schemas 2.0.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-6U3W3WGJ.mjs → chunk-4T4DDJJZ.mjs} +6 -6
- package/{chunk-QGHAWR7N.mjs → chunk-65WB3CQB.mjs} +8 -8
- package/{chunk-AFF2ESHC.mjs → chunk-6AISIJ3O.mjs} +6 -6
- package/{chunk-P5QT636Q.mjs → chunk-7ULQG7YJ.mjs} +8 -8
- package/{chunk-QFCBUDTN.mjs → chunk-7VU2KIBV.mjs} +6 -6
- package/chunk-BXLQYGEB.mjs +105 -0
- package/{chunk-Z6PA77SA.mjs → chunk-CGBX6OCD.mjs} +6 -6
- package/{chunk-DKIUSETH.mjs → chunk-CJSJ3VDW.mjs} +109 -41
- package/{chunk-MKN3T4EC.mjs → chunk-EG5RVHCZ.mjs} +8 -8
- package/{chunk-2JHLFEU7.mjs → chunk-F4RMWUXJ.mjs} +9 -9
- package/{chunk-LXNKU6Q5.mjs → chunk-GBKY6QE3.mjs} +6 -6
- package/{chunk-KIN5ASCQ.mjs → chunk-HF7G6PTH.mjs} +8 -8
- package/{chunk-VGBIJ7LQ.mjs → chunk-HX5UJCA2.mjs} +6 -6
- package/{chunk-DRLPCEVY.mjs → chunk-HXHJSQ2X.mjs} +8 -8
- package/{chunk-ECQBM5TA.mjs → chunk-IVY6IQXZ.mjs} +8 -8
- package/{chunk-TGDPLYN3.mjs → chunk-K3QXEL6M.mjs} +19 -20
- package/{chunk-64RQV46Z.mjs → chunk-LDL7QLPB.mjs} +6 -6
- package/{chunk-DWOFPI2A.mjs → chunk-LRIO6V7H.mjs} +6 -6
- package/{chunk-FGNV6RT5.mjs → chunk-OIGZEDM3.mjs} +6 -6
- package/{chunk-FBL2YW6F.mjs → chunk-OJUTNXHL.mjs} +135 -38
- package/{chunk-E5SPEAZO.mjs → chunk-OKAMQBUN.mjs} +6 -6
- package/{chunk-KOB7CHDM.mjs → chunk-PCTF5JYB.mjs} +8 -8
- package/{chunk-26RFB4ZS.mjs → chunk-PCXYLWDD.mjs} +8 -8
- package/chunk-QEPJ2RLU.mjs +18 -0
- package/{chunk-LCD7MY35.mjs → chunk-QQCSQ3L4.mjs} +9 -9
- package/{chunk-IVT2ZFVR.mjs → chunk-R5TJYTTO.mjs} +8 -8
- package/{chunk-WVQ2LFIN.mjs → chunk-T2FBV7WO.mjs} +9 -9
- package/{chunk-LNPPAYB6.mjs → chunk-TNZ33455.mjs} +6 -6
- package/{chunk-J4BYCQDX.mjs → chunk-TWOBBIQC.mjs} +8 -8
- package/{chunk-NQIIQVGK.mjs → chunk-TZEPVIC4.mjs} +8 -8
- package/{chunk-QSMMXRNI.mjs → chunk-UK62IINL.mjs} +6 -6
- package/{chunk-6EBUH4MK.mjs → chunk-VTTNXB64.mjs} +6 -6
- package/{chunk-DQ6ZS36G.mjs → chunk-VWKF4I2L.mjs} +8 -8
- package/financing/formalization/index.d.cts +710 -708
- package/financing/formalization/index.d.ts +710 -708
- package/financing/formalization/index.js +454 -226
- package/financing/formalization/index.mjs +33 -33
- package/financing/formalization/schemas/AlfaPFSchema.d.cts +16 -16
- package/financing/formalization/schemas/AlfaPFSchema.d.ts +16 -16
- package/financing/formalization/schemas/AlfaPFSchema.js +94 -27
- package/financing/formalization/schemas/AlfaPFSchema.mjs +3 -3
- package/financing/formalization/schemas/AlfaPJSchema.d.cts +16 -16
- package/financing/formalization/schemas/AlfaPJSchema.d.ts +16 -16
- package/financing/formalization/schemas/AlfaPJSchema.js +97 -29
- package/financing/formalization/schemas/AlfaPJSchema.mjs +2 -2
- package/financing/formalization/schemas/BancoDoBrasilPFSchema.d.cts +16 -16
- package/financing/formalization/schemas/BancoDoBrasilPFSchema.d.ts +16 -16
- package/financing/formalization/schemas/BancoDoBrasilPFSchema.js +94 -27
- package/financing/formalization/schemas/BancoDoBrasilPFSchema.mjs +3 -3
- package/financing/formalization/schemas/BancoDoBrasilPJSchema.d.cts +16 -16
- package/financing/formalization/schemas/BancoDoBrasilPJSchema.d.ts +16 -16
- package/financing/formalization/schemas/BancoDoBrasilPJSchema.js +97 -29
- package/financing/formalization/schemas/BancoDoBrasilPJSchema.mjs +2 -2
- package/financing/formalization/schemas/BtgPFSchema.d.cts +16 -16
- package/financing/formalization/schemas/BtgPFSchema.d.ts +16 -16
- package/financing/formalization/schemas/BtgPFSchema.js +94 -27
- package/financing/formalization/schemas/BtgPFSchema.mjs +3 -3
- package/financing/formalization/schemas/BtgPJSchema.d.cts +16 -16
- package/financing/formalization/schemas/BtgPJSchema.d.ts +16 -16
- package/financing/formalization/schemas/BtgPJSchema.js +102 -30
- package/financing/formalization/schemas/BtgPJSchema.mjs +3 -3
- package/financing/formalization/schemas/BvPFSchema.d.cts +20 -20
- package/financing/formalization/schemas/BvPFSchema.d.ts +20 -20
- package/financing/formalization/schemas/BvPFSchema.js +96 -29
- package/financing/formalization/schemas/BvPFSchema.mjs +3 -3
- package/financing/formalization/schemas/BvPJSchema.d.cts +16 -16
- package/financing/formalization/schemas/BvPJSchema.d.ts +16 -16
- package/financing/formalization/schemas/BvPJSchema.js +102 -30
- package/financing/formalization/schemas/BvPJSchema.mjs +3 -3
- package/financing/formalization/schemas/CaixaEconomicaFederalPFSchema.d.cts +16 -16
- package/financing/formalization/schemas/CaixaEconomicaFederalPFSchema.d.ts +16 -16
- package/financing/formalization/schemas/CaixaEconomicaFederalPFSchema.js +94 -27
- package/financing/formalization/schemas/CaixaEconomicaFederalPFSchema.mjs +3 -3
- package/financing/formalization/schemas/CaixaEconomicaFederalPJSchema.d.cts +16 -16
- package/financing/formalization/schemas/CaixaEconomicaFederalPJSchema.d.ts +16 -16
- package/financing/formalization/schemas/CaixaEconomicaFederalPJSchema.js +97 -29
- package/financing/formalization/schemas/CaixaEconomicaFederalPJSchema.mjs +2 -2
- package/financing/formalization/schemas/CashMePFSchema.d.cts +16 -16
- package/financing/formalization/schemas/CashMePFSchema.d.ts +16 -16
- package/financing/formalization/schemas/CashMePFSchema.js +94 -27
- package/financing/formalization/schemas/CashMePFSchema.mjs +3 -3
- package/financing/formalization/schemas/CashMePJSchema.d.cts +16 -16
- package/financing/formalization/schemas/CashMePJSchema.d.ts +16 -16
- package/financing/formalization/schemas/CashMePJSchema.js +97 -29
- package/financing/formalization/schemas/CashMePJSchema.mjs +2 -2
- package/financing/formalization/schemas/Credito77PFSchema.d.cts +16 -16
- package/financing/formalization/schemas/Credito77PFSchema.d.ts +16 -16
- package/financing/formalization/schemas/Credito77PFSchema.js +94 -27
- package/financing/formalization/schemas/Credito77PFSchema.mjs +3 -3
- package/financing/formalization/schemas/Credito77PJSchema.d.cts +16 -16
- package/financing/formalization/schemas/Credito77PJSchema.d.ts +16 -16
- package/financing/formalization/schemas/Credito77PJSchema.js +97 -29
- package/financing/formalization/schemas/Credito77PJSchema.mjs +2 -2
- package/financing/formalization/schemas/EosPFSchema.d.cts +16 -16
- package/financing/formalization/schemas/EosPFSchema.d.ts +16 -16
- package/financing/formalization/schemas/EosPFSchema.js +94 -27
- package/financing/formalization/schemas/EosPFSchema.mjs +3 -3
- package/financing/formalization/schemas/EosPJSchema.d.cts +16 -16
- package/financing/formalization/schemas/EosPJSchema.d.ts +16 -16
- package/financing/formalization/schemas/EosPJSchema.js +97 -29
- package/financing/formalization/schemas/EosPJSchema.mjs +2 -2
- package/financing/formalization/schemas/HdtEnergyPFSchema.d.cts +16 -16
- package/financing/formalization/schemas/HdtEnergyPFSchema.d.ts +16 -16
- package/financing/formalization/schemas/HdtEnergyPFSchema.js +94 -27
- package/financing/formalization/schemas/HdtEnergyPFSchema.mjs +3 -3
- package/financing/formalization/schemas/HdtEnergyPJSchema.d.cts +16 -16
- package/financing/formalization/schemas/HdtEnergyPJSchema.d.ts +16 -16
- package/financing/formalization/schemas/HdtEnergyPJSchema.js +97 -29
- package/financing/formalization/schemas/HdtEnergyPJSchema.mjs +2 -2
- package/financing/formalization/schemas/LosangoPFSchema.d.cts +16 -16
- package/financing/formalization/schemas/LosangoPFSchema.d.ts +16 -16
- package/financing/formalization/schemas/LosangoPFSchema.js +94 -27
- package/financing/formalization/schemas/LosangoPFSchema.mjs +3 -3
- package/financing/formalization/schemas/LosangoPJSchema.d.cts +16 -16
- package/financing/formalization/schemas/LosangoPJSchema.d.ts +16 -16
- package/financing/formalization/schemas/LosangoPJSchema.js +97 -29
- package/financing/formalization/schemas/LosangoPJSchema.mjs +2 -2
- package/financing/formalization/schemas/SafraPFSchema.d.cts +16 -16
- package/financing/formalization/schemas/SafraPFSchema.d.ts +16 -16
- package/financing/formalization/schemas/SafraPFSchema.js +94 -27
- package/financing/formalization/schemas/SafraPFSchema.mjs +3 -3
- package/financing/formalization/schemas/SafraPJSchema.d.cts +16 -16
- package/financing/formalization/schemas/SafraPJSchema.d.ts +16 -16
- package/financing/formalization/schemas/SafraPJSchema.js +97 -29
- package/financing/formalization/schemas/SafraPJSchema.mjs +2 -2
- package/financing/formalization/schemas/SantanderPFSchema.d.cts +16 -16
- package/financing/formalization/schemas/SantanderPFSchema.d.ts +16 -16
- package/financing/formalization/schemas/SantanderPFSchema.js +94 -27
- package/financing/formalization/schemas/SantanderPFSchema.mjs +3 -3
- package/financing/formalization/schemas/SantanderPJSchema.d.cts +16 -16
- package/financing/formalization/schemas/SantanderPJSchema.d.ts +16 -16
- package/financing/formalization/schemas/SantanderPJSchema.js +97 -29
- package/financing/formalization/schemas/SantanderPJSchema.mjs +2 -2
- package/financing/formalization/schemas/SolAgoraPFSchema.d.cts +16 -16
- package/financing/formalization/schemas/SolAgoraPFSchema.d.ts +16 -16
- package/financing/formalization/schemas/SolAgoraPFSchema.js +94 -27
- package/financing/formalization/schemas/SolAgoraPFSchema.mjs +3 -3
- package/financing/formalization/schemas/SolAgoraPJSchema.d.cts +16 -16
- package/financing/formalization/schemas/SolAgoraPJSchema.d.ts +16 -16
- package/financing/formalization/schemas/SolAgoraPJSchema.js +102 -30
- package/financing/formalization/schemas/SolAgoraPJSchema.mjs +3 -3
- package/financing/formalization/schemas/SolfacilPFSchema.d.cts +16 -16
- package/financing/formalization/schemas/SolfacilPFSchema.d.ts +16 -16
- package/financing/formalization/schemas/SolfacilPFSchema.js +94 -27
- package/financing/formalization/schemas/SolfacilPFSchema.mjs +3 -3
- package/financing/formalization/schemas/SolfacilPJSchema.d.cts +16 -16
- package/financing/formalization/schemas/SolfacilPJSchema.d.ts +16 -16
- package/financing/formalization/schemas/SolfacilPJSchema.js +97 -29
- package/financing/formalization/schemas/SolfacilPJSchema.mjs +2 -2
- package/financing/formalization/schemas/UnifiedPFSchema.d.cts +48 -48
- package/financing/formalization/schemas/UnifiedPFSchema.d.ts +48 -48
- package/financing/formalization/schemas/UnifiedPFSchema.js +108 -41
- package/financing/formalization/schemas/UnifiedPFSchema.mjs +3 -3
- package/financing/formalization/schemas/UnifiedPJSchema.d.cts +118 -118
- package/financing/formalization/schemas/UnifiedPJSchema.d.ts +118 -118
- package/financing/formalization/schemas/UnifiedPJSchema.js +147 -75
- package/financing/formalization/schemas/UnifiedPJSchema.mjs +3 -3
- package/index.js +454 -226
- package/index.mjs +33 -33
- package/package.json +1 -1
- package/chunk-ARSY3NB7.mjs +0 -13
- package/chunk-QZ2BTLCH.mjs +0 -105
|
@@ -2,15 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
var zod = require('zod');
|
|
4
4
|
|
|
5
|
-
// src/
|
|
5
|
+
// src/shared/fields/primitives.ts
|
|
6
6
|
var REQUIRED_MESSAGE = "Campo obrigat\xF3rio";
|
|
7
|
-
var REQUIRED_STRING_PARAMS = { error: REQUIRED_MESSAGE };
|
|
8
7
|
function requiredString() {
|
|
9
|
-
return zod.z.string(
|
|
8
|
+
return zod.z.string({ error: REQUIRED_MESSAGE });
|
|
10
9
|
}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
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`);
|
|
14
13
|
}
|
|
15
14
|
function requiredNumber(invalidTypeMessage) {
|
|
16
15
|
return zod.z.number({
|
|
@@ -21,6 +20,34 @@ requiredNumber("Valor num\xE9rico inv\xE1lido").nonnegative(
|
|
|
21
20
|
"Valor n\xE3o pode ser negativo"
|
|
22
21
|
);
|
|
23
22
|
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);
|
|
41
|
+
}
|
|
42
|
+
return void 0;
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
function requiredArray(element) {
|
|
47
|
+
return zod.z.array(element, {
|
|
48
|
+
error: (issue) => issue.code === "invalid_type" ? REQUIRED_MESSAGE : void 0
|
|
49
|
+
});
|
|
50
|
+
}
|
|
24
51
|
function enumField(values) {
|
|
25
52
|
return zod.z.enum(values, {
|
|
26
53
|
// No zod 4 todo input fora da lista (inclusive undefined/null) gera um único
|
|
@@ -32,19 +59,28 @@ function enumField(values) {
|
|
|
32
59
|
}
|
|
33
60
|
var MAX_UPLOAD_BYTES = 5 * 1024 * 1024;
|
|
34
61
|
var ACCEPTED_UPLOAD_MIME = ["image/jpeg", "image/png", "application/pdf"];
|
|
35
|
-
var
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
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
|
+
});
|
|
43
75
|
|
|
44
76
|
// src/shared/enums/document-type.ts
|
|
45
77
|
var DocumentTypeEnum = enumField([
|
|
46
78
|
"documento_de_identidade",
|
|
47
|
-
"carteira_nacional_de_habilita\xE7\xE3o"
|
|
79
|
+
"carteira_nacional_de_habilita\xE7\xE3o",
|
|
80
|
+
// Exigido pela RN-015 para nacionalidade estrangeira. Sem este membro a
|
|
81
|
+
// regra seria insatisfazível: todo schema é .strict() com type_doc
|
|
82
|
+
// restrito a este enum.
|
|
83
|
+
"registro_de_estrangeiro"
|
|
48
84
|
]);
|
|
49
85
|
|
|
50
86
|
// src/shared/enums/nationality.ts
|
|
@@ -118,7 +154,10 @@ var PATTERNS = {
|
|
|
118
154
|
cep: /^\d{8}$/,
|
|
119
155
|
phoneBR: /^\d{11}$/,
|
|
120
156
|
email: /^[^\s@]+@[^\s@]+\.[^\s@]+$/,
|
|
121
|
-
dateDMY: /^\d{2}\/\d{2}\/\d{4}
|
|
157
|
+
dateDMY: /^\d{2}\/\d{2}\/\d{4}$/,
|
|
158
|
+
// Formato do RNE, exigido pela RN-015 para nacionalidade estrangeira.
|
|
159
|
+
rneNumber: /^[A-Za-z0-9]+$/
|
|
160
|
+
};
|
|
122
161
|
|
|
123
162
|
// src/shared/regex/validators.ts
|
|
124
163
|
function onlyDigits(value) {
|
|
@@ -235,22 +274,22 @@ function parseBRLCurrency(value) {
|
|
|
235
274
|
if (typeof value !== "string") {
|
|
236
275
|
return value;
|
|
237
276
|
}
|
|
238
|
-
const
|
|
239
|
-
if (
|
|
277
|
+
const normalized = value.replace(/R\$/gi, "").replace(/\s/g, "").replace(/\./g, "").replace(",", ".");
|
|
278
|
+
if (normalized === "") {
|
|
240
279
|
return void 0;
|
|
241
280
|
}
|
|
242
|
-
const normalized = trimmed.replace(/R\$/gi, "").replace(/\s/g, "").replace(/\./g, "").replace(",", ".");
|
|
243
281
|
const parsed = Number(normalized);
|
|
244
282
|
return Number.isNaN(parsed) ? value : parsed;
|
|
245
283
|
}
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
);
|
|
284
|
+
function brlAmount() {
|
|
285
|
+
return requiredNumber("Valor monet\xE1rio inv\xE1lido").positive("Valor deve ser positivo");
|
|
286
|
+
}
|
|
287
|
+
var currencySchema = zod.z.preprocess(parseBRLCurrency, brlAmount());
|
|
288
|
+
zod.z.preprocess(parseBRLCurrency, brlAmount().optional());
|
|
250
289
|
requiredNumber("Valor num\xE9rico inv\xE1lido").int("Deve ser um n\xFAmero inteiro").min(1, "M\xEDnimo 1").max(28, "M\xE1ximo 28");
|
|
251
290
|
var formalizationExtras = {
|
|
252
291
|
voucher_local_installation_address: fileUploadField,
|
|
253
|
-
proof_kinship_type: ProofKinshipTypeEnum
|
|
292
|
+
proof_kinship_type: optionalField(ProofKinshipTypeEnum),
|
|
254
293
|
proof_kinship: fileUploadField.optional(),
|
|
255
294
|
document_front_upload: fileUploadField,
|
|
256
295
|
document_back_upload: fileUploadField,
|
|
@@ -312,7 +351,36 @@ function applyCommonRefinements(data, ctx) {
|
|
|
312
351
|
});
|
|
313
352
|
}
|
|
314
353
|
}
|
|
354
|
+
var FOREIGN_DOCUMENT_TYPE = "registro_de_estrangeiro";
|
|
355
|
+
function applyForeignDocumentRefinement(data, ctx) {
|
|
356
|
+
const nationality = data.nationality;
|
|
357
|
+
const isForeign = typeof nationality === "string" && nationality.toLowerCase() !== NATIONALITY_BRAZIL;
|
|
358
|
+
if (!isForeign || !("type_doc" in data)) {
|
|
359
|
+
return;
|
|
360
|
+
}
|
|
361
|
+
if (data.type_doc !== FOREIGN_DOCUMENT_TYPE) {
|
|
362
|
+
ctx.addIssue({
|
|
363
|
+
code: "custom",
|
|
364
|
+
path: ["type_doc"],
|
|
365
|
+
message: "Para nacionalidade estrangeira, o documento deve ser Registro de Estrangeiro (RNE)"
|
|
366
|
+
});
|
|
367
|
+
return;
|
|
368
|
+
}
|
|
369
|
+
if (typeof data.doc === "string" && !PATTERNS.rneNumber.test(data.doc)) {
|
|
370
|
+
ctx.addIssue({
|
|
371
|
+
code: "custom",
|
|
372
|
+
path: ["doc"],
|
|
373
|
+
message: "RNE deve conter apenas letras e n\xFAmeros"
|
|
374
|
+
});
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
function isRecord(data) {
|
|
378
|
+
return typeof data === "object" && data !== null;
|
|
379
|
+
}
|
|
315
380
|
function applyPfRefinements(data, ctx) {
|
|
381
|
+
if (!isRecord(data)) {
|
|
382
|
+
return;
|
|
383
|
+
}
|
|
316
384
|
applyCommonRefinements(data, ctx);
|
|
317
385
|
applyPartnerRefinement(data, ctx);
|
|
318
386
|
if ("nature_of_occupation" in data && typeof data.nature_of_occupation === "string" && OCCUPATIONS_REQUIRING_CNPJ.includes(data.nature_of_occupation) && !data.cnpj_proprietary) {
|
|
@@ -332,8 +400,12 @@ function applyPfRefinements(data, ctx) {
|
|
|
332
400
|
});
|
|
333
401
|
}
|
|
334
402
|
}
|
|
403
|
+
applyForeignDocumentRefinement(data, ctx);
|
|
335
404
|
}
|
|
336
405
|
function applyPjRefinements(data, ctx) {
|
|
406
|
+
if (!isRecord(data)) {
|
|
407
|
+
return;
|
|
408
|
+
}
|
|
337
409
|
applyCommonRefinements(data, ctx);
|
|
338
410
|
}
|
|
339
411
|
function onlyUnknownKeysAborted(payload) {
|
|
@@ -347,9 +419,9 @@ var pjRefinement = zod.z.superRefine(applyPjRefinements, {
|
|
|
347
419
|
});
|
|
348
420
|
|
|
349
421
|
// src/domains/financing/formalization/schemas/BtgPJSchema.ts
|
|
350
|
-
var btgPjObject =
|
|
422
|
+
var btgPjObject = requiredObject({
|
|
351
423
|
...formalizationExtras,
|
|
352
|
-
financing_company:
|
|
424
|
+
financing_company: requiredObject({
|
|
353
425
|
corporate_name: textField(),
|
|
354
426
|
cep: cepSchema,
|
|
355
427
|
address: textField(),
|
|
@@ -357,7 +429,7 @@ var btgPjObject = zod.z.object({
|
|
|
357
429
|
number: textField(),
|
|
358
430
|
cnpj: cnpjSchema,
|
|
359
431
|
email: emailSchema,
|
|
360
|
-
complement: textField(15)
|
|
432
|
+
complement: optionalField(textField(15)),
|
|
361
433
|
phone: phoneBRSchema,
|
|
362
434
|
district: textField(),
|
|
363
435
|
legal_nature: textField(),
|
|
@@ -367,15 +439,15 @@ var btgPjObject = zod.z.object({
|
|
|
367
439
|
economic_activity: textField(),
|
|
368
440
|
monthly_income: currencySchema
|
|
369
441
|
}).strict(),
|
|
370
|
-
financing_company_guarantor:
|
|
371
|
-
|
|
442
|
+
financing_company_guarantor: requiredArray(
|
|
443
|
+
requiredObject({
|
|
372
444
|
name: textField(),
|
|
373
445
|
cep: cepSchema,
|
|
374
446
|
cpf: cpfSchema,
|
|
375
447
|
address: textField(),
|
|
376
448
|
birth_date: birthDateSchema,
|
|
377
449
|
number: textField(),
|
|
378
|
-
complement: textField(15)
|
|
450
|
+
complement: optionalField(textField(15)),
|
|
379
451
|
cellphone: phoneBRSchema,
|
|
380
452
|
phone: phoneBRSchema,
|
|
381
453
|
email: emailSchema,
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { btgPjObject, btgPjSchema } from '../../../chunk-
|
|
2
|
-
import '../../../chunk-
|
|
3
|
-
import '../../../chunk-
|
|
1
|
+
export { btgPjObject, btgPjSchema } from '../../../chunk-T2FBV7WO.mjs';
|
|
2
|
+
import '../../../chunk-QEPJ2RLU.mjs';
|
|
3
|
+
import '../../../chunk-CJSJ3VDW.mjs';
|
|
@@ -12,13 +12,13 @@ declare const bvPfObject: z.ZodObject<{
|
|
|
12
12
|
sex: z.ZodEnum<{
|
|
13
13
|
[x: string]: string;
|
|
14
14
|
}>;
|
|
15
|
-
complement: z.ZodOptional<z.ZodString
|
|
15
|
+
complement: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
|
|
16
16
|
is_installation_at_requester: z.ZodString;
|
|
17
17
|
mother_name: z.ZodString;
|
|
18
18
|
district: z.ZodString;
|
|
19
19
|
energy_account_in_requester_name: z.ZodString;
|
|
20
20
|
city: z.ZodString;
|
|
21
|
-
energy_bill_owner_document: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string
|
|
21
|
+
energy_bill_owner_document: z.ZodPreprocess<z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>>;
|
|
22
22
|
civil_status: z.ZodString;
|
|
23
23
|
state: z.ZodEnum<{
|
|
24
24
|
[x: string]: string;
|
|
@@ -36,7 +36,7 @@ declare const bvPfObject: z.ZodObject<{
|
|
|
36
36
|
profession: z.ZodString;
|
|
37
37
|
nature_of_occupation: z.ZodString;
|
|
38
38
|
company_time: z.ZodNumber;
|
|
39
|
-
cnpj_proprietary: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string
|
|
39
|
+
cnpj_proprietary: z.ZodPreprocess<z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>>;
|
|
40
40
|
equity_value: z.ZodPreprocess<z.ZodNumber>;
|
|
41
41
|
type_doc: z.ZodEnum<{
|
|
42
42
|
[x: string]: string;
|
|
@@ -47,9 +47,9 @@ declare const bvPfObject: z.ZodObject<{
|
|
|
47
47
|
[x: string]: string;
|
|
48
48
|
}>;
|
|
49
49
|
doc_issue_date: z.ZodString;
|
|
50
|
-
pep_relationship: z.ZodOptional<z.ZodString
|
|
50
|
+
pep_relationship: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
|
|
51
51
|
voucher_local_installation_address: z.ZodObject<{
|
|
52
|
-
url: z.ZodOptional<z.ZodURL
|
|
52
|
+
url: z.ZodPreprocess<z.ZodOptional<z.ZodURL>>;
|
|
53
53
|
mime: z.ZodEnum<{
|
|
54
54
|
"image/jpeg": "image/jpeg";
|
|
55
55
|
"image/png": "image/png";
|
|
@@ -57,11 +57,11 @@ declare const bvPfObject: z.ZodObject<{
|
|
|
57
57
|
}>;
|
|
58
58
|
sizeBytes: z.ZodNumber;
|
|
59
59
|
}, z.core.$strip>;
|
|
60
|
-
proof_kinship_type: z.ZodOptional<z.ZodEnum<{
|
|
60
|
+
proof_kinship_type: z.ZodPreprocess<z.ZodOptional<z.ZodEnum<{
|
|
61
61
|
[x: string]: string;
|
|
62
|
-
}
|
|
62
|
+
}>>>;
|
|
63
63
|
proof_kinship: z.ZodOptional<z.ZodObject<{
|
|
64
|
-
url: z.ZodOptional<z.ZodURL
|
|
64
|
+
url: z.ZodPreprocess<z.ZodOptional<z.ZodURL>>;
|
|
65
65
|
mime: z.ZodEnum<{
|
|
66
66
|
"image/jpeg": "image/jpeg";
|
|
67
67
|
"image/png": "image/png";
|
|
@@ -70,7 +70,7 @@ declare const bvPfObject: z.ZodObject<{
|
|
|
70
70
|
sizeBytes: z.ZodNumber;
|
|
71
71
|
}, z.core.$strip>>;
|
|
72
72
|
document_front_upload: z.ZodObject<{
|
|
73
|
-
url: z.ZodOptional<z.ZodURL
|
|
73
|
+
url: z.ZodPreprocess<z.ZodOptional<z.ZodURL>>;
|
|
74
74
|
mime: z.ZodEnum<{
|
|
75
75
|
"image/jpeg": "image/jpeg";
|
|
76
76
|
"image/png": "image/png";
|
|
@@ -79,7 +79,7 @@ declare const bvPfObject: z.ZodObject<{
|
|
|
79
79
|
sizeBytes: z.ZodNumber;
|
|
80
80
|
}, z.core.$strip>;
|
|
81
81
|
document_back_upload: z.ZodObject<{
|
|
82
|
-
url: z.ZodOptional<z.ZodURL
|
|
82
|
+
url: z.ZodPreprocess<z.ZodOptional<z.ZodURL>>;
|
|
83
83
|
mime: z.ZodEnum<{
|
|
84
84
|
"image/jpeg": "image/jpeg";
|
|
85
85
|
"image/png": "image/png";
|
|
@@ -101,13 +101,13 @@ declare const bvPfSchema: z.ZodObject<{
|
|
|
101
101
|
sex: z.ZodEnum<{
|
|
102
102
|
[x: string]: string;
|
|
103
103
|
}>;
|
|
104
|
-
complement: z.ZodOptional<z.ZodString
|
|
104
|
+
complement: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
|
|
105
105
|
is_installation_at_requester: z.ZodString;
|
|
106
106
|
mother_name: z.ZodString;
|
|
107
107
|
district: z.ZodString;
|
|
108
108
|
energy_account_in_requester_name: z.ZodString;
|
|
109
109
|
city: z.ZodString;
|
|
110
|
-
energy_bill_owner_document: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string
|
|
110
|
+
energy_bill_owner_document: z.ZodPreprocess<z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>>;
|
|
111
111
|
civil_status: z.ZodString;
|
|
112
112
|
state: z.ZodEnum<{
|
|
113
113
|
[x: string]: string;
|
|
@@ -125,7 +125,7 @@ declare const bvPfSchema: z.ZodObject<{
|
|
|
125
125
|
profession: z.ZodString;
|
|
126
126
|
nature_of_occupation: z.ZodString;
|
|
127
127
|
company_time: z.ZodNumber;
|
|
128
|
-
cnpj_proprietary: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string
|
|
128
|
+
cnpj_proprietary: z.ZodPreprocess<z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>>;
|
|
129
129
|
equity_value: z.ZodPreprocess<z.ZodNumber>;
|
|
130
130
|
type_doc: z.ZodEnum<{
|
|
131
131
|
[x: string]: string;
|
|
@@ -136,9 +136,9 @@ declare const bvPfSchema: z.ZodObject<{
|
|
|
136
136
|
[x: string]: string;
|
|
137
137
|
}>;
|
|
138
138
|
doc_issue_date: z.ZodString;
|
|
139
|
-
pep_relationship: z.ZodOptional<z.ZodString
|
|
139
|
+
pep_relationship: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
|
|
140
140
|
voucher_local_installation_address: z.ZodObject<{
|
|
141
|
-
url: z.ZodOptional<z.ZodURL
|
|
141
|
+
url: z.ZodPreprocess<z.ZodOptional<z.ZodURL>>;
|
|
142
142
|
mime: z.ZodEnum<{
|
|
143
143
|
"image/jpeg": "image/jpeg";
|
|
144
144
|
"image/png": "image/png";
|
|
@@ -146,11 +146,11 @@ declare const bvPfSchema: z.ZodObject<{
|
|
|
146
146
|
}>;
|
|
147
147
|
sizeBytes: z.ZodNumber;
|
|
148
148
|
}, z.core.$strip>;
|
|
149
|
-
proof_kinship_type: z.ZodOptional<z.ZodEnum<{
|
|
149
|
+
proof_kinship_type: z.ZodPreprocess<z.ZodOptional<z.ZodEnum<{
|
|
150
150
|
[x: string]: string;
|
|
151
|
-
}
|
|
151
|
+
}>>>;
|
|
152
152
|
proof_kinship: z.ZodOptional<z.ZodObject<{
|
|
153
|
-
url: z.ZodOptional<z.ZodURL
|
|
153
|
+
url: z.ZodPreprocess<z.ZodOptional<z.ZodURL>>;
|
|
154
154
|
mime: z.ZodEnum<{
|
|
155
155
|
"image/jpeg": "image/jpeg";
|
|
156
156
|
"image/png": "image/png";
|
|
@@ -159,7 +159,7 @@ declare const bvPfSchema: z.ZodObject<{
|
|
|
159
159
|
sizeBytes: z.ZodNumber;
|
|
160
160
|
}, z.core.$strip>>;
|
|
161
161
|
document_front_upload: z.ZodObject<{
|
|
162
|
-
url: z.ZodOptional<z.ZodURL
|
|
162
|
+
url: z.ZodPreprocess<z.ZodOptional<z.ZodURL>>;
|
|
163
163
|
mime: z.ZodEnum<{
|
|
164
164
|
"image/jpeg": "image/jpeg";
|
|
165
165
|
"image/png": "image/png";
|
|
@@ -168,7 +168,7 @@ declare const bvPfSchema: z.ZodObject<{
|
|
|
168
168
|
sizeBytes: z.ZodNumber;
|
|
169
169
|
}, z.core.$strip>;
|
|
170
170
|
document_back_upload: z.ZodObject<{
|
|
171
|
-
url: z.ZodOptional<z.ZodURL
|
|
171
|
+
url: z.ZodPreprocess<z.ZodOptional<z.ZodURL>>;
|
|
172
172
|
mime: z.ZodEnum<{
|
|
173
173
|
"image/jpeg": "image/jpeg";
|
|
174
174
|
"image/png": "image/png";
|
|
@@ -12,13 +12,13 @@ declare const bvPfObject: z.ZodObject<{
|
|
|
12
12
|
sex: z.ZodEnum<{
|
|
13
13
|
[x: string]: string;
|
|
14
14
|
}>;
|
|
15
|
-
complement: z.ZodOptional<z.ZodString
|
|
15
|
+
complement: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
|
|
16
16
|
is_installation_at_requester: z.ZodString;
|
|
17
17
|
mother_name: z.ZodString;
|
|
18
18
|
district: z.ZodString;
|
|
19
19
|
energy_account_in_requester_name: z.ZodString;
|
|
20
20
|
city: z.ZodString;
|
|
21
|
-
energy_bill_owner_document: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string
|
|
21
|
+
energy_bill_owner_document: z.ZodPreprocess<z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>>;
|
|
22
22
|
civil_status: z.ZodString;
|
|
23
23
|
state: z.ZodEnum<{
|
|
24
24
|
[x: string]: string;
|
|
@@ -36,7 +36,7 @@ declare const bvPfObject: z.ZodObject<{
|
|
|
36
36
|
profession: z.ZodString;
|
|
37
37
|
nature_of_occupation: z.ZodString;
|
|
38
38
|
company_time: z.ZodNumber;
|
|
39
|
-
cnpj_proprietary: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string
|
|
39
|
+
cnpj_proprietary: z.ZodPreprocess<z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>>;
|
|
40
40
|
equity_value: z.ZodPreprocess<z.ZodNumber>;
|
|
41
41
|
type_doc: z.ZodEnum<{
|
|
42
42
|
[x: string]: string;
|
|
@@ -47,9 +47,9 @@ declare const bvPfObject: z.ZodObject<{
|
|
|
47
47
|
[x: string]: string;
|
|
48
48
|
}>;
|
|
49
49
|
doc_issue_date: z.ZodString;
|
|
50
|
-
pep_relationship: z.ZodOptional<z.ZodString
|
|
50
|
+
pep_relationship: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
|
|
51
51
|
voucher_local_installation_address: z.ZodObject<{
|
|
52
|
-
url: z.ZodOptional<z.ZodURL
|
|
52
|
+
url: z.ZodPreprocess<z.ZodOptional<z.ZodURL>>;
|
|
53
53
|
mime: z.ZodEnum<{
|
|
54
54
|
"image/jpeg": "image/jpeg";
|
|
55
55
|
"image/png": "image/png";
|
|
@@ -57,11 +57,11 @@ declare const bvPfObject: z.ZodObject<{
|
|
|
57
57
|
}>;
|
|
58
58
|
sizeBytes: z.ZodNumber;
|
|
59
59
|
}, z.core.$strip>;
|
|
60
|
-
proof_kinship_type: z.ZodOptional<z.ZodEnum<{
|
|
60
|
+
proof_kinship_type: z.ZodPreprocess<z.ZodOptional<z.ZodEnum<{
|
|
61
61
|
[x: string]: string;
|
|
62
|
-
}
|
|
62
|
+
}>>>;
|
|
63
63
|
proof_kinship: z.ZodOptional<z.ZodObject<{
|
|
64
|
-
url: z.ZodOptional<z.ZodURL
|
|
64
|
+
url: z.ZodPreprocess<z.ZodOptional<z.ZodURL>>;
|
|
65
65
|
mime: z.ZodEnum<{
|
|
66
66
|
"image/jpeg": "image/jpeg";
|
|
67
67
|
"image/png": "image/png";
|
|
@@ -70,7 +70,7 @@ declare const bvPfObject: z.ZodObject<{
|
|
|
70
70
|
sizeBytes: z.ZodNumber;
|
|
71
71
|
}, z.core.$strip>>;
|
|
72
72
|
document_front_upload: z.ZodObject<{
|
|
73
|
-
url: z.ZodOptional<z.ZodURL
|
|
73
|
+
url: z.ZodPreprocess<z.ZodOptional<z.ZodURL>>;
|
|
74
74
|
mime: z.ZodEnum<{
|
|
75
75
|
"image/jpeg": "image/jpeg";
|
|
76
76
|
"image/png": "image/png";
|
|
@@ -79,7 +79,7 @@ declare const bvPfObject: z.ZodObject<{
|
|
|
79
79
|
sizeBytes: z.ZodNumber;
|
|
80
80
|
}, z.core.$strip>;
|
|
81
81
|
document_back_upload: z.ZodObject<{
|
|
82
|
-
url: z.ZodOptional<z.ZodURL
|
|
82
|
+
url: z.ZodPreprocess<z.ZodOptional<z.ZodURL>>;
|
|
83
83
|
mime: z.ZodEnum<{
|
|
84
84
|
"image/jpeg": "image/jpeg";
|
|
85
85
|
"image/png": "image/png";
|
|
@@ -101,13 +101,13 @@ declare const bvPfSchema: z.ZodObject<{
|
|
|
101
101
|
sex: z.ZodEnum<{
|
|
102
102
|
[x: string]: string;
|
|
103
103
|
}>;
|
|
104
|
-
complement: z.ZodOptional<z.ZodString
|
|
104
|
+
complement: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
|
|
105
105
|
is_installation_at_requester: z.ZodString;
|
|
106
106
|
mother_name: z.ZodString;
|
|
107
107
|
district: z.ZodString;
|
|
108
108
|
energy_account_in_requester_name: z.ZodString;
|
|
109
109
|
city: z.ZodString;
|
|
110
|
-
energy_bill_owner_document: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string
|
|
110
|
+
energy_bill_owner_document: z.ZodPreprocess<z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>>;
|
|
111
111
|
civil_status: z.ZodString;
|
|
112
112
|
state: z.ZodEnum<{
|
|
113
113
|
[x: string]: string;
|
|
@@ -125,7 +125,7 @@ declare const bvPfSchema: z.ZodObject<{
|
|
|
125
125
|
profession: z.ZodString;
|
|
126
126
|
nature_of_occupation: z.ZodString;
|
|
127
127
|
company_time: z.ZodNumber;
|
|
128
|
-
cnpj_proprietary: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string
|
|
128
|
+
cnpj_proprietary: z.ZodPreprocess<z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>>;
|
|
129
129
|
equity_value: z.ZodPreprocess<z.ZodNumber>;
|
|
130
130
|
type_doc: z.ZodEnum<{
|
|
131
131
|
[x: string]: string;
|
|
@@ -136,9 +136,9 @@ declare const bvPfSchema: z.ZodObject<{
|
|
|
136
136
|
[x: string]: string;
|
|
137
137
|
}>;
|
|
138
138
|
doc_issue_date: z.ZodString;
|
|
139
|
-
pep_relationship: z.ZodOptional<z.ZodString
|
|
139
|
+
pep_relationship: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
|
|
140
140
|
voucher_local_installation_address: z.ZodObject<{
|
|
141
|
-
url: z.ZodOptional<z.ZodURL
|
|
141
|
+
url: z.ZodPreprocess<z.ZodOptional<z.ZodURL>>;
|
|
142
142
|
mime: z.ZodEnum<{
|
|
143
143
|
"image/jpeg": "image/jpeg";
|
|
144
144
|
"image/png": "image/png";
|
|
@@ -146,11 +146,11 @@ declare const bvPfSchema: z.ZodObject<{
|
|
|
146
146
|
}>;
|
|
147
147
|
sizeBytes: z.ZodNumber;
|
|
148
148
|
}, z.core.$strip>;
|
|
149
|
-
proof_kinship_type: z.ZodOptional<z.ZodEnum<{
|
|
149
|
+
proof_kinship_type: z.ZodPreprocess<z.ZodOptional<z.ZodEnum<{
|
|
150
150
|
[x: string]: string;
|
|
151
|
-
}
|
|
151
|
+
}>>>;
|
|
152
152
|
proof_kinship: z.ZodOptional<z.ZodObject<{
|
|
153
|
-
url: z.ZodOptional<z.ZodURL
|
|
153
|
+
url: z.ZodPreprocess<z.ZodOptional<z.ZodURL>>;
|
|
154
154
|
mime: z.ZodEnum<{
|
|
155
155
|
"image/jpeg": "image/jpeg";
|
|
156
156
|
"image/png": "image/png";
|
|
@@ -159,7 +159,7 @@ declare const bvPfSchema: z.ZodObject<{
|
|
|
159
159
|
sizeBytes: z.ZodNumber;
|
|
160
160
|
}, z.core.$strip>>;
|
|
161
161
|
document_front_upload: z.ZodObject<{
|
|
162
|
-
url: z.ZodOptional<z.ZodURL
|
|
162
|
+
url: z.ZodPreprocess<z.ZodOptional<z.ZodURL>>;
|
|
163
163
|
mime: z.ZodEnum<{
|
|
164
164
|
"image/jpeg": "image/jpeg";
|
|
165
165
|
"image/png": "image/png";
|
|
@@ -168,7 +168,7 @@ declare const bvPfSchema: z.ZodObject<{
|
|
|
168
168
|
sizeBytes: z.ZodNumber;
|
|
169
169
|
}, z.core.$strip>;
|
|
170
170
|
document_back_upload: z.ZodObject<{
|
|
171
|
-
url: z.ZodOptional<z.ZodURL
|
|
171
|
+
url: z.ZodPreprocess<z.ZodOptional<z.ZodURL>>;
|
|
172
172
|
mime: z.ZodEnum<{
|
|
173
173
|
"image/jpeg": "image/jpeg";
|
|
174
174
|
"image/png": "image/png";
|