@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.
Files changed (162) hide show
  1. package/{chunk-6U3W3WGJ.mjs → chunk-4T4DDJJZ.mjs} +6 -6
  2. package/{chunk-QGHAWR7N.mjs → chunk-65WB3CQB.mjs} +8 -8
  3. package/{chunk-AFF2ESHC.mjs → chunk-6AISIJ3O.mjs} +6 -6
  4. package/{chunk-P5QT636Q.mjs → chunk-7ULQG7YJ.mjs} +8 -8
  5. package/{chunk-QFCBUDTN.mjs → chunk-7VU2KIBV.mjs} +6 -6
  6. package/chunk-BXLQYGEB.mjs +105 -0
  7. package/{chunk-Z6PA77SA.mjs → chunk-CGBX6OCD.mjs} +6 -6
  8. package/{chunk-DKIUSETH.mjs → chunk-CJSJ3VDW.mjs} +109 -41
  9. package/{chunk-MKN3T4EC.mjs → chunk-EG5RVHCZ.mjs} +8 -8
  10. package/{chunk-2JHLFEU7.mjs → chunk-F4RMWUXJ.mjs} +9 -9
  11. package/{chunk-LXNKU6Q5.mjs → chunk-GBKY6QE3.mjs} +6 -6
  12. package/{chunk-KIN5ASCQ.mjs → chunk-HF7G6PTH.mjs} +8 -8
  13. package/{chunk-VGBIJ7LQ.mjs → chunk-HX5UJCA2.mjs} +6 -6
  14. package/{chunk-DRLPCEVY.mjs → chunk-HXHJSQ2X.mjs} +8 -8
  15. package/{chunk-ECQBM5TA.mjs → chunk-IVY6IQXZ.mjs} +8 -8
  16. package/{chunk-TGDPLYN3.mjs → chunk-K3QXEL6M.mjs} +19 -20
  17. package/{chunk-64RQV46Z.mjs → chunk-LDL7QLPB.mjs} +6 -6
  18. package/{chunk-DWOFPI2A.mjs → chunk-LRIO6V7H.mjs} +6 -6
  19. package/{chunk-FGNV6RT5.mjs → chunk-OIGZEDM3.mjs} +6 -6
  20. package/{chunk-FBL2YW6F.mjs → chunk-OJUTNXHL.mjs} +135 -38
  21. package/{chunk-E5SPEAZO.mjs → chunk-OKAMQBUN.mjs} +6 -6
  22. package/{chunk-KOB7CHDM.mjs → chunk-PCTF5JYB.mjs} +8 -8
  23. package/{chunk-26RFB4ZS.mjs → chunk-PCXYLWDD.mjs} +8 -8
  24. package/chunk-QEPJ2RLU.mjs +18 -0
  25. package/{chunk-LCD7MY35.mjs → chunk-QQCSQ3L4.mjs} +9 -9
  26. package/{chunk-IVT2ZFVR.mjs → chunk-R5TJYTTO.mjs} +8 -8
  27. package/{chunk-WVQ2LFIN.mjs → chunk-T2FBV7WO.mjs} +9 -9
  28. package/{chunk-LNPPAYB6.mjs → chunk-TNZ33455.mjs} +6 -6
  29. package/{chunk-J4BYCQDX.mjs → chunk-TWOBBIQC.mjs} +8 -8
  30. package/{chunk-NQIIQVGK.mjs → chunk-TZEPVIC4.mjs} +8 -8
  31. package/{chunk-QSMMXRNI.mjs → chunk-UK62IINL.mjs} +6 -6
  32. package/{chunk-6EBUH4MK.mjs → chunk-VTTNXB64.mjs} +6 -6
  33. package/{chunk-DQ6ZS36G.mjs → chunk-VWKF4I2L.mjs} +8 -8
  34. package/financing/formalization/index.d.cts +710 -708
  35. package/financing/formalization/index.d.ts +710 -708
  36. package/financing/formalization/index.js +454 -226
  37. package/financing/formalization/index.mjs +33 -33
  38. package/financing/formalization/schemas/AlfaPFSchema.d.cts +16 -16
  39. package/financing/formalization/schemas/AlfaPFSchema.d.ts +16 -16
  40. package/financing/formalization/schemas/AlfaPFSchema.js +94 -27
  41. package/financing/formalization/schemas/AlfaPFSchema.mjs +3 -3
  42. package/financing/formalization/schemas/AlfaPJSchema.d.cts +16 -16
  43. package/financing/formalization/schemas/AlfaPJSchema.d.ts +16 -16
  44. package/financing/formalization/schemas/AlfaPJSchema.js +97 -29
  45. package/financing/formalization/schemas/AlfaPJSchema.mjs +2 -2
  46. package/financing/formalization/schemas/BancoDoBrasilPFSchema.d.cts +16 -16
  47. package/financing/formalization/schemas/BancoDoBrasilPFSchema.d.ts +16 -16
  48. package/financing/formalization/schemas/BancoDoBrasilPFSchema.js +94 -27
  49. package/financing/formalization/schemas/BancoDoBrasilPFSchema.mjs +3 -3
  50. package/financing/formalization/schemas/BancoDoBrasilPJSchema.d.cts +16 -16
  51. package/financing/formalization/schemas/BancoDoBrasilPJSchema.d.ts +16 -16
  52. package/financing/formalization/schemas/BancoDoBrasilPJSchema.js +97 -29
  53. package/financing/formalization/schemas/BancoDoBrasilPJSchema.mjs +2 -2
  54. package/financing/formalization/schemas/BtgPFSchema.d.cts +16 -16
  55. package/financing/formalization/schemas/BtgPFSchema.d.ts +16 -16
  56. package/financing/formalization/schemas/BtgPFSchema.js +94 -27
  57. package/financing/formalization/schemas/BtgPFSchema.mjs +3 -3
  58. package/financing/formalization/schemas/BtgPJSchema.d.cts +16 -16
  59. package/financing/formalization/schemas/BtgPJSchema.d.ts +16 -16
  60. package/financing/formalization/schemas/BtgPJSchema.js +102 -30
  61. package/financing/formalization/schemas/BtgPJSchema.mjs +3 -3
  62. package/financing/formalization/schemas/BvPFSchema.d.cts +20 -20
  63. package/financing/formalization/schemas/BvPFSchema.d.ts +20 -20
  64. package/financing/formalization/schemas/BvPFSchema.js +96 -29
  65. package/financing/formalization/schemas/BvPFSchema.mjs +3 -3
  66. package/financing/formalization/schemas/BvPJSchema.d.cts +16 -16
  67. package/financing/formalization/schemas/BvPJSchema.d.ts +16 -16
  68. package/financing/formalization/schemas/BvPJSchema.js +102 -30
  69. package/financing/formalization/schemas/BvPJSchema.mjs +3 -3
  70. package/financing/formalization/schemas/CaixaEconomicaFederalPFSchema.d.cts +16 -16
  71. package/financing/formalization/schemas/CaixaEconomicaFederalPFSchema.d.ts +16 -16
  72. package/financing/formalization/schemas/CaixaEconomicaFederalPFSchema.js +94 -27
  73. package/financing/formalization/schemas/CaixaEconomicaFederalPFSchema.mjs +3 -3
  74. package/financing/formalization/schemas/CaixaEconomicaFederalPJSchema.d.cts +16 -16
  75. package/financing/formalization/schemas/CaixaEconomicaFederalPJSchema.d.ts +16 -16
  76. package/financing/formalization/schemas/CaixaEconomicaFederalPJSchema.js +97 -29
  77. package/financing/formalization/schemas/CaixaEconomicaFederalPJSchema.mjs +2 -2
  78. package/financing/formalization/schemas/CashMePFSchema.d.cts +16 -16
  79. package/financing/formalization/schemas/CashMePFSchema.d.ts +16 -16
  80. package/financing/formalization/schemas/CashMePFSchema.js +94 -27
  81. package/financing/formalization/schemas/CashMePFSchema.mjs +3 -3
  82. package/financing/formalization/schemas/CashMePJSchema.d.cts +16 -16
  83. package/financing/formalization/schemas/CashMePJSchema.d.ts +16 -16
  84. package/financing/formalization/schemas/CashMePJSchema.js +97 -29
  85. package/financing/formalization/schemas/CashMePJSchema.mjs +2 -2
  86. package/financing/formalization/schemas/Credito77PFSchema.d.cts +16 -16
  87. package/financing/formalization/schemas/Credito77PFSchema.d.ts +16 -16
  88. package/financing/formalization/schemas/Credito77PFSchema.js +94 -27
  89. package/financing/formalization/schemas/Credito77PFSchema.mjs +3 -3
  90. package/financing/formalization/schemas/Credito77PJSchema.d.cts +16 -16
  91. package/financing/formalization/schemas/Credito77PJSchema.d.ts +16 -16
  92. package/financing/formalization/schemas/Credito77PJSchema.js +97 -29
  93. package/financing/formalization/schemas/Credito77PJSchema.mjs +2 -2
  94. package/financing/formalization/schemas/EosPFSchema.d.cts +16 -16
  95. package/financing/formalization/schemas/EosPFSchema.d.ts +16 -16
  96. package/financing/formalization/schemas/EosPFSchema.js +94 -27
  97. package/financing/formalization/schemas/EosPFSchema.mjs +3 -3
  98. package/financing/formalization/schemas/EosPJSchema.d.cts +16 -16
  99. package/financing/formalization/schemas/EosPJSchema.d.ts +16 -16
  100. package/financing/formalization/schemas/EosPJSchema.js +97 -29
  101. package/financing/formalization/schemas/EosPJSchema.mjs +2 -2
  102. package/financing/formalization/schemas/HdtEnergyPFSchema.d.cts +16 -16
  103. package/financing/formalization/schemas/HdtEnergyPFSchema.d.ts +16 -16
  104. package/financing/formalization/schemas/HdtEnergyPFSchema.js +94 -27
  105. package/financing/formalization/schemas/HdtEnergyPFSchema.mjs +3 -3
  106. package/financing/formalization/schemas/HdtEnergyPJSchema.d.cts +16 -16
  107. package/financing/formalization/schemas/HdtEnergyPJSchema.d.ts +16 -16
  108. package/financing/formalization/schemas/HdtEnergyPJSchema.js +97 -29
  109. package/financing/formalization/schemas/HdtEnergyPJSchema.mjs +2 -2
  110. package/financing/formalization/schemas/LosangoPFSchema.d.cts +16 -16
  111. package/financing/formalization/schemas/LosangoPFSchema.d.ts +16 -16
  112. package/financing/formalization/schemas/LosangoPFSchema.js +94 -27
  113. package/financing/formalization/schemas/LosangoPFSchema.mjs +3 -3
  114. package/financing/formalization/schemas/LosangoPJSchema.d.cts +16 -16
  115. package/financing/formalization/schemas/LosangoPJSchema.d.ts +16 -16
  116. package/financing/formalization/schemas/LosangoPJSchema.js +97 -29
  117. package/financing/formalization/schemas/LosangoPJSchema.mjs +2 -2
  118. package/financing/formalization/schemas/SafraPFSchema.d.cts +16 -16
  119. package/financing/formalization/schemas/SafraPFSchema.d.ts +16 -16
  120. package/financing/formalization/schemas/SafraPFSchema.js +94 -27
  121. package/financing/formalization/schemas/SafraPFSchema.mjs +3 -3
  122. package/financing/formalization/schemas/SafraPJSchema.d.cts +16 -16
  123. package/financing/formalization/schemas/SafraPJSchema.d.ts +16 -16
  124. package/financing/formalization/schemas/SafraPJSchema.js +97 -29
  125. package/financing/formalization/schemas/SafraPJSchema.mjs +2 -2
  126. package/financing/formalization/schemas/SantanderPFSchema.d.cts +16 -16
  127. package/financing/formalization/schemas/SantanderPFSchema.d.ts +16 -16
  128. package/financing/formalization/schemas/SantanderPFSchema.js +94 -27
  129. package/financing/formalization/schemas/SantanderPFSchema.mjs +3 -3
  130. package/financing/formalization/schemas/SantanderPJSchema.d.cts +16 -16
  131. package/financing/formalization/schemas/SantanderPJSchema.d.ts +16 -16
  132. package/financing/formalization/schemas/SantanderPJSchema.js +97 -29
  133. package/financing/formalization/schemas/SantanderPJSchema.mjs +2 -2
  134. package/financing/formalization/schemas/SolAgoraPFSchema.d.cts +16 -16
  135. package/financing/formalization/schemas/SolAgoraPFSchema.d.ts +16 -16
  136. package/financing/formalization/schemas/SolAgoraPFSchema.js +94 -27
  137. package/financing/formalization/schemas/SolAgoraPFSchema.mjs +3 -3
  138. package/financing/formalization/schemas/SolAgoraPJSchema.d.cts +16 -16
  139. package/financing/formalization/schemas/SolAgoraPJSchema.d.ts +16 -16
  140. package/financing/formalization/schemas/SolAgoraPJSchema.js +102 -30
  141. package/financing/formalization/schemas/SolAgoraPJSchema.mjs +3 -3
  142. package/financing/formalization/schemas/SolfacilPFSchema.d.cts +16 -16
  143. package/financing/formalization/schemas/SolfacilPFSchema.d.ts +16 -16
  144. package/financing/formalization/schemas/SolfacilPFSchema.js +94 -27
  145. package/financing/formalization/schemas/SolfacilPFSchema.mjs +3 -3
  146. package/financing/formalization/schemas/SolfacilPJSchema.d.cts +16 -16
  147. package/financing/formalization/schemas/SolfacilPJSchema.d.ts +16 -16
  148. package/financing/formalization/schemas/SolfacilPJSchema.js +97 -29
  149. package/financing/formalization/schemas/SolfacilPJSchema.mjs +2 -2
  150. package/financing/formalization/schemas/UnifiedPFSchema.d.cts +48 -48
  151. package/financing/formalization/schemas/UnifiedPFSchema.d.ts +48 -48
  152. package/financing/formalization/schemas/UnifiedPFSchema.js +108 -41
  153. package/financing/formalization/schemas/UnifiedPFSchema.mjs +3 -3
  154. package/financing/formalization/schemas/UnifiedPJSchema.d.cts +118 -118
  155. package/financing/formalization/schemas/UnifiedPJSchema.d.ts +118 -118
  156. package/financing/formalization/schemas/UnifiedPJSchema.js +147 -75
  157. package/financing/formalization/schemas/UnifiedPJSchema.mjs +3 -3
  158. package/index.js +454 -226
  159. package/index.mjs +33 -33
  160. package/package.json +1 -1
  161. package/chunk-ARSY3NB7.mjs +0 -13
  162. package/chunk-QZ2BTLCH.mjs +0 -105
@@ -4,13 +4,12 @@ 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 = { error: REQUIRED_MESSAGE };
8
7
  function requiredString() {
9
- return zod.z.string(REQUIRED_STRING_PARAMS);
8
+ return zod.z.string({ error: REQUIRED_MESSAGE });
10
9
  }
11
- function textField(maxLength) {
12
- const base = requiredString().trim().min(1, REQUIRED_MESSAGE);
13
- return maxLength === void 0 ? base : base.max(maxLength, `M\xE1ximo ${maxLength} caracteres`);
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 @@ var numberField = requiredNumber("Valor num\xE9rico inv\xE1lido").nonnegative(
21
20
  "Valor n\xE3o pode ser negativo"
22
21
  );
23
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);
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,14 +59,19 @@ 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 fileUploadField = zod.z.object(
36
- {
37
- url: zod.z.url().optional(),
38
- mime: zod.z.enum(ACCEPTED_UPLOAD_MIME, { error: "Formato deve ser JPEG, PNG ou PDF" }),
39
- sizeBytes: zod.z.number().max(MAX_UPLOAD_BYTES, "Arquivo deve ter no m\xE1ximo 5MB")
40
- },
41
- REQUIRED_STRING_PARAMS
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/civil-status.ts
45
77
  var CivilStatusEnum = enumField([
@@ -76,11 +108,16 @@ var CommunionRegimeLabels = {
76
108
  // src/shared/enums/document-type.ts
77
109
  var DocumentTypeEnum = enumField([
78
110
  "documento_de_identidade",
79
- "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"
80
116
  ]);
81
117
  var DocumentTypeLabels = {
82
118
  documento_de_identidade: "Documento de identidade (RG)",
83
- 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)"
84
121
  };
85
122
 
86
123
  // src/shared/enums/nationality.ts
@@ -305,7 +342,10 @@ var PATTERNS = {
305
342
  cep: /^\d{8}$/,
306
343
  phoneBR: /^\d{11}$/,
307
344
  email: /^[^\s@]+@[^\s@]+\.[^\s@]+$/,
308
- 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
+ };
309
349
 
310
350
  // src/shared/regex/validators.ts
311
351
  function onlyDigits(value) {
@@ -422,18 +462,18 @@ function parseBRLCurrency(value) {
422
462
  if (typeof value !== "string") {
423
463
  return value;
424
464
  }
425
- const trimmed = value.trim();
426
- if (trimmed === "") {
465
+ const normalized = value.replace(/R\$/gi, "").replace(/\s/g, "").replace(/\./g, "").replace(",", ".");
466
+ if (normalized === "") {
427
467
  return void 0;
428
468
  }
429
- const normalized = trimmed.replace(/R\$/gi, "").replace(/\s/g, "").replace(/\./g, "").replace(",", ".");
430
469
  const parsed = Number(normalized);
431
470
  return Number.isNaN(parsed) ? value : parsed;
432
471
  }
433
- var currencySchema = zod.z.preprocess(
434
- parseBRLCurrency,
435
- requiredNumber("Valor monet\xE1rio inv\xE1lido").positive("Valor deve ser positivo")
436
- );
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());
437
477
  requiredNumber("Valor num\xE9rico inv\xE1lido").int("Deve ser um n\xFAmero inteiro").min(1, "M\xEDnimo 1").max(28, "M\xE1ximo 28");
438
478
 
439
479
  // src/domains/financing/formalization/refinements.ts
@@ -476,7 +516,36 @@ function applyCommonRefinements(data, ctx) {
476
516
  });
477
517
  }
478
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
+ }
479
545
  function applyPfRefinements(data, ctx) {
546
+ if (!isRecord(data)) {
547
+ return;
548
+ }
480
549
  applyCommonRefinements(data, ctx);
481
550
  applyPartnerRefinement(data, ctx);
482
551
  if ("nature_of_occupation" in data && typeof data.nature_of_occupation === "string" && OCCUPATIONS_REQUIRING_CNPJ.includes(data.nature_of_occupation) && !data.cnpj_proprietary) {
@@ -496,8 +565,12 @@ function applyPfRefinements(data, ctx) {
496
565
  });
497
566
  }
498
567
  }
568
+ applyForeignDocumentRefinement(data, ctx);
499
569
  }
500
570
  function applyPjRefinements(data, ctx) {
571
+ if (!isRecord(data)) {
572
+ return;
573
+ }
501
574
  applyCommonRefinements(data, ctx);
502
575
  }
503
576
  function onlyUnknownKeysAborted(payload) {
@@ -511,7 +584,7 @@ var pjRefinement = zod.z.superRefine(applyPjRefinements, {
511
584
  });
512
585
  var formalizationExtras = {
513
586
  voucher_local_installation_address: fileUploadField,
514
- proof_kinship_type: ProofKinshipTypeEnum.optional(),
587
+ proof_kinship_type: optionalField(ProofKinshipTypeEnum),
515
588
  proof_kinship: fileUploadField.optional(),
516
589
  document_front_upload: fileUploadField,
517
590
  document_back_upload: fileUploadField,
@@ -519,7 +592,7 @@ var formalizationExtras = {
519
592
  };
520
593
 
521
594
  // src/domains/financing/formalization/schemas/AlfaPFSchema.ts
522
- var alfaPfObject = zod.z.object({
595
+ var alfaPfObject = requiredObject({
523
596
  ...formalizationExtras,
524
597
  name: textField(),
525
598
  cep: cepSchema,
@@ -528,12 +601,12 @@ var alfaPfObject = zod.z.object({
528
601
  birth_date: birthDateSchema,
529
602
  number: textField(),
530
603
  sex: SexEnum,
531
- complement: textField(15).optional(),
604
+ complement: optionalField(textField(15)),
532
605
  mother_name: textField(),
533
606
  district: textField(),
534
607
  energy_account_in_requester_name: textField(),
535
608
  city: textField(),
536
- energy_bill_owner_document: cpfCnpjSchema.optional(),
609
+ energy_bill_owner_document: optionalField(cpfCnpjSchema),
537
610
  state: UfEnum,
538
611
  nationality: NationalityEnum.default(NATIONALITY_BRAZIL),
539
612
  cellphone: phoneBRSchema,
@@ -546,9 +619,11 @@ var alfaPfObject = zod.z.object({
546
619
  doc_issue_date: issueDateSchema
547
620
  });
548
621
  var alfaPfSchema = alfaPfObject.strict().check(pfRefinement);
549
- var alfaPjObject = zod.z.object({
622
+
623
+ // src/domains/financing/formalization/schemas/AlfaPJSchema.ts
624
+ var alfaPjObject = requiredObject({
550
625
  ...formalizationExtras,
551
- financing_company: zod.z.object({
626
+ financing_company: requiredObject({
552
627
  corporate_name: textField(),
553
628
  cep: cepSchema,
554
629
  address: textField(),
@@ -556,7 +631,7 @@ var alfaPjObject = zod.z.object({
556
631
  number: textField(),
557
632
  cnpj: cnpjSchema,
558
633
  email: emailSchema,
559
- complement: textField(15).optional(),
634
+ complement: optionalField(textField(15)),
560
635
  phone: phoneBRSchema,
561
636
  district: textField(),
562
637
  legal_nature: textField(),
@@ -566,15 +641,15 @@ var alfaPjObject = zod.z.object({
566
641
  economic_activity: textField(),
567
642
  monthly_income: currencySchema
568
643
  }).strict(),
569
- financing_company_guarantor: zod.z.array(
570
- zod.z.object({
644
+ financing_company_guarantor: requiredArray(
645
+ requiredObject({
571
646
  name: textField(),
572
647
  cep: cepSchema,
573
648
  cpf: cpfSchema,
574
649
  address: textField(),
575
650
  birth_date: birthDateSchema,
576
651
  number: textField(),
577
- complement: textField(15).optional(),
652
+ complement: optionalField(textField(15)),
578
653
  cellphone: phoneBRSchema,
579
654
  email: emailSchema,
580
655
  district: textField(),
@@ -588,7 +663,9 @@ var alfaPjObject = zod.z.object({
588
663
  )
589
664
  });
590
665
  var alfaPjSchema = alfaPjObject.strict().check(pjRefinement);
591
- var bancoDoBrasilPfObject = zod.z.object({
666
+
667
+ // src/domains/financing/formalization/schemas/BancoDoBrasilPFSchema.ts
668
+ var bancoDoBrasilPfObject = requiredObject({
592
669
  ...formalizationExtras,
593
670
  name: textField(),
594
671
  cep: cepSchema,
@@ -597,12 +674,12 @@ var bancoDoBrasilPfObject = zod.z.object({
597
674
  birth_date: birthDateSchema,
598
675
  number: textField(),
599
676
  sex: SexEnum,
600
- complement: textField(15).optional(),
677
+ complement: optionalField(textField(15)),
601
678
  mother_name: textField(),
602
679
  district: textField(),
603
680
  energy_account_in_requester_name: textField(),
604
681
  city: textField(),
605
- energy_bill_owner_document: cpfCnpjSchema.optional(),
682
+ energy_bill_owner_document: optionalField(cpfCnpjSchema),
606
683
  state: UfEnum,
607
684
  nationality: NationalityEnum.default(NATIONALITY_BRAZIL),
608
685
  cellphone: phoneBRSchema,
@@ -615,9 +692,11 @@ var bancoDoBrasilPfObject = zod.z.object({
615
692
  doc_issue_date: issueDateSchema
616
693
  });
617
694
  var bancoDoBrasilPfSchema = bancoDoBrasilPfObject.strict().check(pfRefinement);
618
- var bancoDoBrasilPjObject = zod.z.object({
695
+
696
+ // src/domains/financing/formalization/schemas/BancoDoBrasilPJSchema.ts
697
+ var bancoDoBrasilPjObject = requiredObject({
619
698
  ...formalizationExtras,
620
- financing_company: zod.z.object({
699
+ financing_company: requiredObject({
621
700
  corporate_name: textField(),
622
701
  cep: cepSchema,
623
702
  address: textField(),
@@ -625,7 +704,7 @@ var bancoDoBrasilPjObject = zod.z.object({
625
704
  number: textField(),
626
705
  cnpj: cnpjSchema,
627
706
  email: emailSchema,
628
- complement: textField(15).optional(),
707
+ complement: optionalField(textField(15)),
629
708
  phone: phoneBRSchema,
630
709
  district: textField(),
631
710
  legal_nature: textField(),
@@ -635,15 +714,15 @@ var bancoDoBrasilPjObject = zod.z.object({
635
714
  economic_activity: textField(),
636
715
  monthly_income: currencySchema
637
716
  }).strict(),
638
- financing_company_guarantor: zod.z.array(
639
- zod.z.object({
717
+ financing_company_guarantor: requiredArray(
718
+ requiredObject({
640
719
  name: textField(),
641
720
  cep: cepSchema,
642
721
  cpf: cpfSchema,
643
722
  address: textField(),
644
723
  birth_date: birthDateSchema,
645
724
  number: textField(),
646
- complement: textField(15).optional(),
725
+ complement: optionalField(textField(15)),
647
726
  cellphone: phoneBRSchema,
648
727
  email: emailSchema,
649
728
  district: textField(),
@@ -657,7 +736,9 @@ var bancoDoBrasilPjObject = zod.z.object({
657
736
  )
658
737
  });
659
738
  var bancoDoBrasilPjSchema = bancoDoBrasilPjObject.strict().check(pjRefinement);
660
- var btgPfObject = zod.z.object({
739
+
740
+ // src/domains/financing/formalization/schemas/BtgPFSchema.ts
741
+ var btgPfObject = requiredObject({
661
742
  ...formalizationExtras,
662
743
  name: textField(),
663
744
  cep: cepSchema,
@@ -666,12 +747,12 @@ var btgPfObject = zod.z.object({
666
747
  birth_date: birthDateSchema,
667
748
  number: textField(),
668
749
  sex: SexEnum,
669
- complement: textField(15).optional(),
750
+ complement: optionalField(textField(15)),
670
751
  mother_name: textField(),
671
752
  district: textField(),
672
753
  energy_account_in_requester_name: textField(),
673
754
  city: textField(),
674
- energy_bill_owner_document: cpfCnpjSchema.optional(),
755
+ energy_bill_owner_document: optionalField(cpfCnpjSchema),
675
756
  state: UfEnum,
676
757
  nationality: NationalityEnum.default(NATIONALITY_BRAZIL),
677
758
  cellphone: phoneBRSchema,
@@ -684,9 +765,11 @@ var btgPfObject = zod.z.object({
684
765
  doc_issue_date: issueDateSchema
685
766
  });
686
767
  var btgPfSchema = btgPfObject.strict().check(pfRefinement);
687
- var btgPjObject = zod.z.object({
768
+
769
+ // src/domains/financing/formalization/schemas/BtgPJSchema.ts
770
+ var btgPjObject = requiredObject({
688
771
  ...formalizationExtras,
689
- financing_company: zod.z.object({
772
+ financing_company: requiredObject({
690
773
  corporate_name: textField(),
691
774
  cep: cepSchema,
692
775
  address: textField(),
@@ -694,7 +777,7 @@ var btgPjObject = zod.z.object({
694
777
  number: textField(),
695
778
  cnpj: cnpjSchema,
696
779
  email: emailSchema,
697
- complement: textField(15).optional(),
780
+ complement: optionalField(textField(15)),
698
781
  phone: phoneBRSchema,
699
782
  district: textField(),
700
783
  legal_nature: textField(),
@@ -704,15 +787,15 @@ var btgPjObject = zod.z.object({
704
787
  economic_activity: textField(),
705
788
  monthly_income: currencySchema
706
789
  }).strict(),
707
- financing_company_guarantor: zod.z.array(
708
- zod.z.object({
790
+ financing_company_guarantor: requiredArray(
791
+ requiredObject({
709
792
  name: textField(),
710
793
  cep: cepSchema,
711
794
  cpf: cpfSchema,
712
795
  address: textField(),
713
796
  birth_date: birthDateSchema,
714
797
  number: textField(),
715
- complement: textField(15).optional(),
798
+ complement: optionalField(textField(15)),
716
799
  cellphone: phoneBRSchema,
717
800
  phone: phoneBRSchema,
718
801
  email: emailSchema,
@@ -737,7 +820,9 @@ var btgPjObject = zod.z.object({
737
820
  )
738
821
  });
739
822
  var btgPjSchema = btgPjObject.strict().check(pjRefinement);
740
- var bvPfObject = zod.z.object({
823
+
824
+ // src/domains/financing/formalization/schemas/BvPFSchema.ts
825
+ var bvPfObject = requiredObject({
741
826
  ...formalizationExtras,
742
827
  name: textField(),
743
828
  cep: cepSchema,
@@ -748,13 +833,13 @@ var bvPfObject = zod.z.object({
748
833
  birth_date: birthDateSchema,
749
834
  number: textField(),
750
835
  sex: SexEnum,
751
- complement: textField(15).optional(),
836
+ complement: optionalField(textField(15)),
752
837
  is_installation_at_requester: textField(),
753
838
  mother_name: textField(),
754
839
  district: textField(),
755
840
  energy_account_in_requester_name: textField(),
756
841
  city: textField(),
757
- energy_bill_owner_document: cpfCnpjSchema.optional(),
842
+ energy_bill_owner_document: optionalField(cpfCnpjSchema),
758
843
  civil_status: textField(),
759
844
  state: UfEnum,
760
845
  nationality: NationalityEnum.default(NATIONALITY_BRAZIL),
@@ -766,19 +851,21 @@ var bvPfObject = zod.z.object({
766
851
  profession: textField(),
767
852
  nature_of_occupation: textField(),
768
853
  company_time: numberField,
769
- cnpj_proprietary: cnpjSchema.optional(),
854
+ cnpj_proprietary: optionalField(cnpjSchema),
770
855
  equity_value: currencySchema,
771
856
  type_doc: DocumentTypeEnum,
772
857
  doc: textField(15),
773
858
  issuing_body: textField(6),
774
859
  emitting_state: UfEnum,
775
860
  doc_issue_date: issueDateSchema,
776
- pep_relationship: textField().optional()
861
+ pep_relationship: optionalField(textField())
777
862
  });
778
863
  var bvPfSchema = bvPfObject.strict().check(pfRefinement);
779
- var bvPjObject = zod.z.object({
864
+
865
+ // src/domains/financing/formalization/schemas/BvPJSchema.ts
866
+ var bvPjObject = requiredObject({
780
867
  ...formalizationExtras,
781
- financing_company: zod.z.object({
868
+ financing_company: requiredObject({
782
869
  corporate_name: textField(),
783
870
  cep: cepSchema,
784
871
  residence_situation: textField(),
@@ -788,7 +875,7 @@ var bvPjObject = zod.z.object({
788
875
  number: textField(),
789
876
  cnpj: cnpjSchema,
790
877
  email: emailSchema,
791
- complement: textField(15).optional(),
878
+ complement: optionalField(textField(15)),
792
879
  phone: phoneBRSchema,
793
880
  district: textField(),
794
881
  legal_nature: textField(),
@@ -799,15 +886,15 @@ var bvPjObject = zod.z.object({
799
886
  monthly_income: currencySchema,
800
887
  capital_social: currencySchema
801
888
  }).strict(),
802
- financing_company_guarantor: zod.z.array(
803
- zod.z.object({
889
+ financing_company_guarantor: requiredArray(
890
+ requiredObject({
804
891
  name: textField(),
805
892
  cep: cepSchema,
806
893
  cpf: cpfSchema,
807
894
  address: textField(),
808
895
  birth_date: birthDateSchema,
809
896
  number: textField(),
810
- complement: textField(15).optional(),
897
+ complement: optionalField(textField(15)),
811
898
  cellphone: phoneBRSchema,
812
899
  phone: phoneBRSchema,
813
900
  email: emailSchema,
@@ -836,7 +923,9 @@ var bvPjObject = zod.z.object({
836
923
  )
837
924
  });
838
925
  var bvPjSchema = bvPjObject.strict().check(pjRefinement);
839
- var caixaEconomicaFederalPfObject = zod.z.object({
926
+
927
+ // src/domains/financing/formalization/schemas/CaixaEconomicaFederalPFSchema.ts
928
+ var caixaEconomicaFederalPfObject = requiredObject({
840
929
  ...formalizationExtras,
841
930
  name: textField(),
842
931
  cep: cepSchema,
@@ -845,12 +934,12 @@ var caixaEconomicaFederalPfObject = zod.z.object({
845
934
  birth_date: birthDateSchema,
846
935
  number: textField(),
847
936
  sex: SexEnum,
848
- complement: textField(15).optional(),
937
+ complement: optionalField(textField(15)),
849
938
  mother_name: textField(),
850
939
  district: textField(),
851
940
  energy_account_in_requester_name: textField(),
852
941
  city: textField(),
853
- energy_bill_owner_document: cpfCnpjSchema.optional(),
942
+ energy_bill_owner_document: optionalField(cpfCnpjSchema),
854
943
  state: UfEnum,
855
944
  nationality: NationalityEnum.default(NATIONALITY_BRAZIL),
856
945
  cellphone: phoneBRSchema,
@@ -863,9 +952,11 @@ var caixaEconomicaFederalPfObject = zod.z.object({
863
952
  doc_issue_date: issueDateSchema
864
953
  });
865
954
  var caixaEconomicaFederalPfSchema = caixaEconomicaFederalPfObject.strict().check(pfRefinement);
866
- var caixaEconomicaFederalPjObject = zod.z.object({
955
+
956
+ // src/domains/financing/formalization/schemas/CaixaEconomicaFederalPJSchema.ts
957
+ var caixaEconomicaFederalPjObject = requiredObject({
867
958
  ...formalizationExtras,
868
- financing_company: zod.z.object({
959
+ financing_company: requiredObject({
869
960
  corporate_name: textField(),
870
961
  cep: cepSchema,
871
962
  address: textField(),
@@ -873,7 +964,7 @@ var caixaEconomicaFederalPjObject = zod.z.object({
873
964
  number: textField(),
874
965
  cnpj: cnpjSchema,
875
966
  email: emailSchema,
876
- complement: textField(15).optional(),
967
+ complement: optionalField(textField(15)),
877
968
  phone: phoneBRSchema,
878
969
  district: textField(),
879
970
  legal_nature: textField(),
@@ -883,15 +974,15 @@ var caixaEconomicaFederalPjObject = zod.z.object({
883
974
  economic_activity: textField(),
884
975
  monthly_income: currencySchema
885
976
  }).strict(),
886
- financing_company_guarantor: zod.z.array(
887
- zod.z.object({
977
+ financing_company_guarantor: requiredArray(
978
+ requiredObject({
888
979
  name: textField(),
889
980
  cep: cepSchema,
890
981
  cpf: cpfSchema,
891
982
  address: textField(),
892
983
  birth_date: birthDateSchema,
893
984
  number: textField(),
894
- complement: textField(15).optional(),
985
+ complement: optionalField(textField(15)),
895
986
  cellphone: phoneBRSchema,
896
987
  email: emailSchema,
897
988
  district: textField(),
@@ -905,7 +996,9 @@ var caixaEconomicaFederalPjObject = zod.z.object({
905
996
  )
906
997
  });
907
998
  var caixaEconomicaFederalPjSchema = caixaEconomicaFederalPjObject.strict().check(pjRefinement);
908
- var cashMePfObject = zod.z.object({
999
+
1000
+ // src/domains/financing/formalization/schemas/CashMePFSchema.ts
1001
+ var cashMePfObject = requiredObject({
909
1002
  ...formalizationExtras,
910
1003
  name: textField(),
911
1004
  cep: cepSchema,
@@ -914,12 +1007,12 @@ var cashMePfObject = zod.z.object({
914
1007
  birth_date: birthDateSchema,
915
1008
  number: textField(),
916
1009
  sex: SexEnum,
917
- complement: textField(15).optional(),
1010
+ complement: optionalField(textField(15)),
918
1011
  mother_name: textField(),
919
1012
  district: textField(),
920
1013
  energy_account_in_requester_name: textField(),
921
1014
  city: textField(),
922
- energy_bill_owner_document: cpfCnpjSchema.optional(),
1015
+ energy_bill_owner_document: optionalField(cpfCnpjSchema),
923
1016
  state: UfEnum,
924
1017
  nationality: NationalityEnum.default(NATIONALITY_BRAZIL),
925
1018
  cellphone: phoneBRSchema,
@@ -932,9 +1025,11 @@ var cashMePfObject = zod.z.object({
932
1025
  doc_issue_date: issueDateSchema
933
1026
  });
934
1027
  var cashMePfSchema = cashMePfObject.strict().check(pfRefinement);
935
- var cashMePjObject = zod.z.object({
1028
+
1029
+ // src/domains/financing/formalization/schemas/CashMePJSchema.ts
1030
+ var cashMePjObject = requiredObject({
936
1031
  ...formalizationExtras,
937
- financing_company: zod.z.object({
1032
+ financing_company: requiredObject({
938
1033
  corporate_name: textField(),
939
1034
  cep: cepSchema,
940
1035
  address: textField(),
@@ -942,7 +1037,7 @@ var cashMePjObject = zod.z.object({
942
1037
  number: textField(),
943
1038
  cnpj: cnpjSchema,
944
1039
  email: emailSchema,
945
- complement: textField(15).optional(),
1040
+ complement: optionalField(textField(15)),
946
1041
  phone: phoneBRSchema,
947
1042
  district: textField(),
948
1043
  legal_nature: textField(),
@@ -952,15 +1047,15 @@ var cashMePjObject = zod.z.object({
952
1047
  economic_activity: textField(),
953
1048
  monthly_income: currencySchema
954
1049
  }).strict(),
955
- financing_company_guarantor: zod.z.array(
956
- zod.z.object({
1050
+ financing_company_guarantor: requiredArray(
1051
+ requiredObject({
957
1052
  name: textField(),
958
1053
  cep: cepSchema,
959
1054
  cpf: cpfSchema,
960
1055
  address: textField(),
961
1056
  birth_date: birthDateSchema,
962
1057
  number: textField(),
963
- complement: textField(15).optional(),
1058
+ complement: optionalField(textField(15)),
964
1059
  cellphone: phoneBRSchema,
965
1060
  email: emailSchema,
966
1061
  district: textField(),
@@ -974,7 +1069,9 @@ var cashMePjObject = zod.z.object({
974
1069
  )
975
1070
  });
976
1071
  var cashMePjSchema = cashMePjObject.strict().check(pjRefinement);
977
- var credito77PfObject = zod.z.object({
1072
+
1073
+ // src/domains/financing/formalization/schemas/Credito77PFSchema.ts
1074
+ var credito77PfObject = requiredObject({
978
1075
  ...formalizationExtras,
979
1076
  name: textField(),
980
1077
  cep: cepSchema,
@@ -983,12 +1080,12 @@ var credito77PfObject = zod.z.object({
983
1080
  birth_date: birthDateSchema,
984
1081
  number: textField(),
985
1082
  sex: SexEnum,
986
- complement: textField(15).optional(),
1083
+ complement: optionalField(textField(15)),
987
1084
  mother_name: textField(),
988
1085
  district: textField(),
989
1086
  energy_account_in_requester_name: textField(),
990
1087
  city: textField(),
991
- energy_bill_owner_document: cpfCnpjSchema.optional(),
1088
+ energy_bill_owner_document: optionalField(cpfCnpjSchema),
992
1089
  state: UfEnum,
993
1090
  nationality: NationalityEnum.default(NATIONALITY_BRAZIL),
994
1091
  cellphone: phoneBRSchema,
@@ -1001,9 +1098,11 @@ var credito77PfObject = zod.z.object({
1001
1098
  doc_issue_date: issueDateSchema
1002
1099
  });
1003
1100
  var credito77PfSchema = credito77PfObject.strict().check(pfRefinement);
1004
- var credito77PjObject = zod.z.object({
1101
+
1102
+ // src/domains/financing/formalization/schemas/Credito77PJSchema.ts
1103
+ var credito77PjObject = requiredObject({
1005
1104
  ...formalizationExtras,
1006
- financing_company: zod.z.object({
1105
+ financing_company: requiredObject({
1007
1106
  corporate_name: textField(),
1008
1107
  cep: cepSchema,
1009
1108
  address: textField(),
@@ -1011,7 +1110,7 @@ var credito77PjObject = zod.z.object({
1011
1110
  number: textField(),
1012
1111
  cnpj: cnpjSchema,
1013
1112
  email: emailSchema,
1014
- complement: textField(15).optional(),
1113
+ complement: optionalField(textField(15)),
1015
1114
  phone: phoneBRSchema,
1016
1115
  district: textField(),
1017
1116
  legal_nature: textField(),
@@ -1021,15 +1120,15 @@ var credito77PjObject = zod.z.object({
1021
1120
  economic_activity: textField(),
1022
1121
  monthly_income: currencySchema
1023
1122
  }).strict(),
1024
- financing_company_guarantor: zod.z.array(
1025
- zod.z.object({
1123
+ financing_company_guarantor: requiredArray(
1124
+ requiredObject({
1026
1125
  name: textField(),
1027
1126
  cep: cepSchema,
1028
1127
  cpf: cpfSchema,
1029
1128
  address: textField(),
1030
1129
  birth_date: birthDateSchema,
1031
1130
  number: textField(),
1032
- complement: textField(15).optional(),
1131
+ complement: optionalField(textField(15)),
1033
1132
  cellphone: phoneBRSchema,
1034
1133
  email: emailSchema,
1035
1134
  district: textField(),
@@ -1043,7 +1142,9 @@ var credito77PjObject = zod.z.object({
1043
1142
  )
1044
1143
  });
1045
1144
  var credito77PjSchema = credito77PjObject.strict().check(pjRefinement);
1046
- var eosPfObject = zod.z.object({
1145
+
1146
+ // src/domains/financing/formalization/schemas/EosPFSchema.ts
1147
+ var eosPfObject = requiredObject({
1047
1148
  ...formalizationExtras,
1048
1149
  name: textField(),
1049
1150
  cep: cepSchema,
@@ -1052,12 +1153,12 @@ var eosPfObject = zod.z.object({
1052
1153
  birth_date: birthDateSchema,
1053
1154
  number: textField(),
1054
1155
  sex: SexEnum,
1055
- complement: textField(15).optional(),
1156
+ complement: optionalField(textField(15)),
1056
1157
  mother_name: textField(),
1057
1158
  district: textField(),
1058
1159
  energy_account_in_requester_name: textField(),
1059
1160
  city: textField(),
1060
- energy_bill_owner_document: cpfCnpjSchema.optional(),
1161
+ energy_bill_owner_document: optionalField(cpfCnpjSchema),
1061
1162
  state: UfEnum,
1062
1163
  nationality: NationalityEnum.default(NATIONALITY_BRAZIL),
1063
1164
  cellphone: phoneBRSchema,
@@ -1070,9 +1171,11 @@ var eosPfObject = zod.z.object({
1070
1171
  doc_issue_date: issueDateSchema
1071
1172
  });
1072
1173
  var eosPfSchema = eosPfObject.strict().check(pfRefinement);
1073
- var eosPjObject = zod.z.object({
1174
+
1175
+ // src/domains/financing/formalization/schemas/EosPJSchema.ts
1176
+ var eosPjObject = requiredObject({
1074
1177
  ...formalizationExtras,
1075
- financing_company: zod.z.object({
1178
+ financing_company: requiredObject({
1076
1179
  corporate_name: textField(),
1077
1180
  cep: cepSchema,
1078
1181
  address: textField(),
@@ -1080,7 +1183,7 @@ var eosPjObject = zod.z.object({
1080
1183
  number: textField(),
1081
1184
  cnpj: cnpjSchema,
1082
1185
  email: emailSchema,
1083
- complement: textField(15).optional(),
1186
+ complement: optionalField(textField(15)),
1084
1187
  phone: phoneBRSchema,
1085
1188
  district: textField(),
1086
1189
  legal_nature: textField(),
@@ -1090,15 +1193,15 @@ var eosPjObject = zod.z.object({
1090
1193
  economic_activity: textField(),
1091
1194
  monthly_income: currencySchema
1092
1195
  }).strict(),
1093
- financing_company_guarantor: zod.z.array(
1094
- zod.z.object({
1196
+ financing_company_guarantor: requiredArray(
1197
+ requiredObject({
1095
1198
  name: textField(),
1096
1199
  cep: cepSchema,
1097
1200
  cpf: cpfSchema,
1098
1201
  address: textField(),
1099
1202
  birth_date: birthDateSchema,
1100
1203
  number: textField(),
1101
- complement: textField(15).optional(),
1204
+ complement: optionalField(textField(15)),
1102
1205
  cellphone: phoneBRSchema,
1103
1206
  email: emailSchema,
1104
1207
  district: textField(),
@@ -1112,7 +1215,9 @@ var eosPjObject = zod.z.object({
1112
1215
  )
1113
1216
  });
1114
1217
  var eosPjSchema = eosPjObject.strict().check(pjRefinement);
1115
- var hdtEnergyPfObject = zod.z.object({
1218
+
1219
+ // src/domains/financing/formalization/schemas/HdtEnergyPFSchema.ts
1220
+ var hdtEnergyPfObject = requiredObject({
1116
1221
  ...formalizationExtras,
1117
1222
  name: textField(),
1118
1223
  cep: cepSchema,
@@ -1121,12 +1226,12 @@ var hdtEnergyPfObject = zod.z.object({
1121
1226
  birth_date: birthDateSchema,
1122
1227
  number: textField(),
1123
1228
  sex: SexEnum,
1124
- complement: textField(15).optional(),
1229
+ complement: optionalField(textField(15)),
1125
1230
  mother_name: textField(),
1126
1231
  district: textField(),
1127
1232
  energy_account_in_requester_name: textField(),
1128
1233
  city: textField(),
1129
- energy_bill_owner_document: cpfCnpjSchema.optional(),
1234
+ energy_bill_owner_document: optionalField(cpfCnpjSchema),
1130
1235
  state: UfEnum,
1131
1236
  nationality: NationalityEnum.default(NATIONALITY_BRAZIL),
1132
1237
  cellphone: phoneBRSchema,
@@ -1139,9 +1244,11 @@ var hdtEnergyPfObject = zod.z.object({
1139
1244
  doc_issue_date: issueDateSchema
1140
1245
  });
1141
1246
  var hdtEnergyPfSchema = hdtEnergyPfObject.strict().check(pfRefinement);
1142
- var hdtEnergyPjObject = zod.z.object({
1247
+
1248
+ // src/domains/financing/formalization/schemas/HdtEnergyPJSchema.ts
1249
+ var hdtEnergyPjObject = requiredObject({
1143
1250
  ...formalizationExtras,
1144
- financing_company: zod.z.object({
1251
+ financing_company: requiredObject({
1145
1252
  corporate_name: textField(),
1146
1253
  cep: cepSchema,
1147
1254
  address: textField(),
@@ -1149,7 +1256,7 @@ var hdtEnergyPjObject = zod.z.object({
1149
1256
  number: textField(),
1150
1257
  cnpj: cnpjSchema,
1151
1258
  email: emailSchema,
1152
- complement: textField(15).optional(),
1259
+ complement: optionalField(textField(15)),
1153
1260
  phone: phoneBRSchema,
1154
1261
  district: textField(),
1155
1262
  legal_nature: textField(),
@@ -1159,15 +1266,15 @@ var hdtEnergyPjObject = zod.z.object({
1159
1266
  economic_activity: textField(),
1160
1267
  monthly_income: currencySchema
1161
1268
  }).strict(),
1162
- financing_company_guarantor: zod.z.array(
1163
- zod.z.object({
1269
+ financing_company_guarantor: requiredArray(
1270
+ requiredObject({
1164
1271
  name: textField(),
1165
1272
  cep: cepSchema,
1166
1273
  cpf: cpfSchema,
1167
1274
  address: textField(),
1168
1275
  birth_date: birthDateSchema,
1169
1276
  number: textField(),
1170
- complement: textField(15).optional(),
1277
+ complement: optionalField(textField(15)),
1171
1278
  cellphone: phoneBRSchema,
1172
1279
  email: emailSchema,
1173
1280
  district: textField(),
@@ -1181,7 +1288,9 @@ var hdtEnergyPjObject = zod.z.object({
1181
1288
  )
1182
1289
  });
1183
1290
  var hdtEnergyPjSchema = hdtEnergyPjObject.strict().check(pjRefinement);
1184
- var losangoPfObject = zod.z.object({
1291
+
1292
+ // src/domains/financing/formalization/schemas/LosangoPFSchema.ts
1293
+ var losangoPfObject = requiredObject({
1185
1294
  ...formalizationExtras,
1186
1295
  name: textField(),
1187
1296
  cep: cepSchema,
@@ -1190,12 +1299,12 @@ var losangoPfObject = zod.z.object({
1190
1299
  birth_date: birthDateSchema,
1191
1300
  number: textField(),
1192
1301
  sex: SexEnum,
1193
- complement: textField(15).optional(),
1302
+ complement: optionalField(textField(15)),
1194
1303
  mother_name: textField(),
1195
1304
  district: textField(),
1196
1305
  energy_account_in_requester_name: textField(),
1197
1306
  city: textField(),
1198
- energy_bill_owner_document: cpfCnpjSchema.optional(),
1307
+ energy_bill_owner_document: optionalField(cpfCnpjSchema),
1199
1308
  state: UfEnum,
1200
1309
  nationality: NationalityEnum.default(NATIONALITY_BRAZIL),
1201
1310
  cellphone: phoneBRSchema,
@@ -1208,9 +1317,11 @@ var losangoPfObject = zod.z.object({
1208
1317
  doc_issue_date: issueDateSchema
1209
1318
  });
1210
1319
  var losangoPfSchema = losangoPfObject.strict().check(pfRefinement);
1211
- var losangoPjObject = zod.z.object({
1320
+
1321
+ // src/domains/financing/formalization/schemas/LosangoPJSchema.ts
1322
+ var losangoPjObject = requiredObject({
1212
1323
  ...formalizationExtras,
1213
- financing_company: zod.z.object({
1324
+ financing_company: requiredObject({
1214
1325
  corporate_name: textField(),
1215
1326
  cep: cepSchema,
1216
1327
  address: textField(),
@@ -1218,7 +1329,7 @@ var losangoPjObject = zod.z.object({
1218
1329
  number: textField(),
1219
1330
  cnpj: cnpjSchema,
1220
1331
  email: emailSchema,
1221
- complement: textField(15).optional(),
1332
+ complement: optionalField(textField(15)),
1222
1333
  phone: phoneBRSchema,
1223
1334
  district: textField(),
1224
1335
  legal_nature: textField(),
@@ -1228,15 +1339,15 @@ var losangoPjObject = zod.z.object({
1228
1339
  economic_activity: textField(),
1229
1340
  monthly_income: currencySchema
1230
1341
  }).strict(),
1231
- financing_company_guarantor: zod.z.array(
1232
- zod.z.object({
1342
+ financing_company_guarantor: requiredArray(
1343
+ requiredObject({
1233
1344
  name: textField(),
1234
1345
  cep: cepSchema,
1235
1346
  cpf: cpfSchema,
1236
1347
  address: textField(),
1237
1348
  birth_date: birthDateSchema,
1238
1349
  number: textField(),
1239
- complement: textField(15).optional(),
1350
+ complement: optionalField(textField(15)),
1240
1351
  cellphone: phoneBRSchema,
1241
1352
  email: emailSchema,
1242
1353
  district: textField(),
@@ -1250,7 +1361,9 @@ var losangoPjObject = zod.z.object({
1250
1361
  )
1251
1362
  });
1252
1363
  var losangoPjSchema = losangoPjObject.strict().check(pjRefinement);
1253
- var safraPfObject = zod.z.object({
1364
+
1365
+ // src/domains/financing/formalization/schemas/SafraPFSchema.ts
1366
+ var safraPfObject = requiredObject({
1254
1367
  ...formalizationExtras,
1255
1368
  name: textField(),
1256
1369
  cep: cepSchema,
@@ -1259,12 +1372,12 @@ var safraPfObject = zod.z.object({
1259
1372
  birth_date: birthDateSchema,
1260
1373
  number: textField(),
1261
1374
  sex: SexEnum,
1262
- complement: textField(15).optional(),
1375
+ complement: optionalField(textField(15)),
1263
1376
  mother_name: textField(),
1264
1377
  district: textField(),
1265
1378
  energy_account_in_requester_name: textField(),
1266
1379
  city: textField(),
1267
- energy_bill_owner_document: cpfCnpjSchema.optional(),
1380
+ energy_bill_owner_document: optionalField(cpfCnpjSchema),
1268
1381
  state: UfEnum,
1269
1382
  nationality: NationalityEnum.default(NATIONALITY_BRAZIL),
1270
1383
  cellphone: phoneBRSchema,
@@ -1277,9 +1390,11 @@ var safraPfObject = zod.z.object({
1277
1390
  doc_issue_date: issueDateSchema
1278
1391
  });
1279
1392
  var safraPfSchema = safraPfObject.strict().check(pfRefinement);
1280
- var safraPjObject = zod.z.object({
1393
+
1394
+ // src/domains/financing/formalization/schemas/SafraPJSchema.ts
1395
+ var safraPjObject = requiredObject({
1281
1396
  ...formalizationExtras,
1282
- financing_company: zod.z.object({
1397
+ financing_company: requiredObject({
1283
1398
  corporate_name: textField(),
1284
1399
  cep: cepSchema,
1285
1400
  address: textField(),
@@ -1287,7 +1402,7 @@ var safraPjObject = zod.z.object({
1287
1402
  number: textField(),
1288
1403
  cnpj: cnpjSchema,
1289
1404
  email: emailSchema,
1290
- complement: textField(15).optional(),
1405
+ complement: optionalField(textField(15)),
1291
1406
  phone: phoneBRSchema,
1292
1407
  district: textField(),
1293
1408
  legal_nature: textField(),
@@ -1297,15 +1412,15 @@ var safraPjObject = zod.z.object({
1297
1412
  economic_activity: textField(),
1298
1413
  monthly_income: currencySchema
1299
1414
  }).strict(),
1300
- financing_company_guarantor: zod.z.array(
1301
- zod.z.object({
1415
+ financing_company_guarantor: requiredArray(
1416
+ requiredObject({
1302
1417
  name: textField(),
1303
1418
  cep: cepSchema,
1304
1419
  cpf: cpfSchema,
1305
1420
  address: textField(),
1306
1421
  birth_date: birthDateSchema,
1307
1422
  number: textField(),
1308
- complement: textField(15).optional(),
1423
+ complement: optionalField(textField(15)),
1309
1424
  cellphone: phoneBRSchema,
1310
1425
  email: emailSchema,
1311
1426
  district: textField(),
@@ -1319,7 +1434,9 @@ var safraPjObject = zod.z.object({
1319
1434
  )
1320
1435
  });
1321
1436
  var safraPjSchema = safraPjObject.strict().check(pjRefinement);
1322
- var santanderPfObject = zod.z.object({
1437
+
1438
+ // src/domains/financing/formalization/schemas/SantanderPFSchema.ts
1439
+ var santanderPfObject = requiredObject({
1323
1440
  ...formalizationExtras,
1324
1441
  name: textField(),
1325
1442
  cep: cepSchema,
@@ -1328,12 +1445,12 @@ var santanderPfObject = zod.z.object({
1328
1445
  birth_date: birthDateSchema,
1329
1446
  number: textField(),
1330
1447
  sex: SexEnum,
1331
- complement: textField(15).optional(),
1448
+ complement: optionalField(textField(15)),
1332
1449
  mother_name: textField(),
1333
1450
  district: textField(),
1334
1451
  energy_account_in_requester_name: textField(),
1335
1452
  city: textField(),
1336
- energy_bill_owner_document: cpfCnpjSchema.optional(),
1453
+ energy_bill_owner_document: optionalField(cpfCnpjSchema),
1337
1454
  state: UfEnum,
1338
1455
  nationality: NationalityEnum.default(NATIONALITY_BRAZIL),
1339
1456
  cellphone: phoneBRSchema,
@@ -1346,9 +1463,11 @@ var santanderPfObject = zod.z.object({
1346
1463
  doc_issue_date: issueDateSchema
1347
1464
  });
1348
1465
  var santanderPfSchema = santanderPfObject.strict().check(pfRefinement);
1349
- var santanderPjObject = zod.z.object({
1466
+
1467
+ // src/domains/financing/formalization/schemas/SantanderPJSchema.ts
1468
+ var santanderPjObject = requiredObject({
1350
1469
  ...formalizationExtras,
1351
- financing_company: zod.z.object({
1470
+ financing_company: requiredObject({
1352
1471
  corporate_name: textField(),
1353
1472
  cep: cepSchema,
1354
1473
  address: textField(),
@@ -1356,7 +1475,7 @@ var santanderPjObject = zod.z.object({
1356
1475
  number: textField(),
1357
1476
  cnpj: cnpjSchema,
1358
1477
  email: emailSchema,
1359
- complement: textField(15).optional(),
1478
+ complement: optionalField(textField(15)),
1360
1479
  phone: phoneBRSchema,
1361
1480
  district: textField(),
1362
1481
  legal_nature: textField(),
@@ -1366,15 +1485,15 @@ var santanderPjObject = zod.z.object({
1366
1485
  economic_activity: textField(),
1367
1486
  monthly_income: currencySchema
1368
1487
  }).strict(),
1369
- financing_company_guarantor: zod.z.array(
1370
- zod.z.object({
1488
+ financing_company_guarantor: requiredArray(
1489
+ requiredObject({
1371
1490
  name: textField(),
1372
1491
  cep: cepSchema,
1373
1492
  cpf: cpfSchema,
1374
1493
  address: textField(),
1375
1494
  birth_date: birthDateSchema,
1376
1495
  number: textField(),
1377
- complement: textField(15).optional(),
1496
+ complement: optionalField(textField(15)),
1378
1497
  cellphone: phoneBRSchema,
1379
1498
  email: emailSchema,
1380
1499
  district: textField(),
@@ -1388,7 +1507,9 @@ var santanderPjObject = zod.z.object({
1388
1507
  )
1389
1508
  });
1390
1509
  var santanderPjSchema = santanderPjObject.strict().check(pjRefinement);
1391
- var solAgoraPfObject = zod.z.object({
1510
+
1511
+ // src/domains/financing/formalization/schemas/SolAgoraPFSchema.ts
1512
+ var solAgoraPfObject = requiredObject({
1392
1513
  ...formalizationExtras,
1393
1514
  name: textField(),
1394
1515
  cep: cepSchema,
@@ -1397,12 +1518,12 @@ var solAgoraPfObject = zod.z.object({
1397
1518
  birth_date: birthDateSchema,
1398
1519
  number: textField(),
1399
1520
  sex: SexEnum,
1400
- complement: textField(15).optional(),
1521
+ complement: optionalField(textField(15)),
1401
1522
  mother_name: textField(),
1402
1523
  district: textField(),
1403
1524
  energy_account_in_requester_name: textField(),
1404
1525
  city: textField(),
1405
- energy_bill_owner_document: cpfCnpjSchema.optional(),
1526
+ energy_bill_owner_document: optionalField(cpfCnpjSchema),
1406
1527
  state: UfEnum,
1407
1528
  nationality: NationalityEnum.default(NATIONALITY_BRAZIL),
1408
1529
  cellphone: phoneBRSchema,
@@ -1415,9 +1536,11 @@ var solAgoraPfObject = zod.z.object({
1415
1536
  doc_issue_date: issueDateSchema
1416
1537
  });
1417
1538
  var solAgoraPfSchema = solAgoraPfObject.strict().check(pfRefinement);
1418
- var solAgoraPjObject = zod.z.object({
1539
+
1540
+ // src/domains/financing/formalization/schemas/SolAgoraPJSchema.ts
1541
+ var solAgoraPjObject = requiredObject({
1419
1542
  ...formalizationExtras,
1420
- financing_company: zod.z.object({
1543
+ financing_company: requiredObject({
1421
1544
  corporate_name: textField(),
1422
1545
  cep: cepSchema,
1423
1546
  address: textField(),
@@ -1425,7 +1548,7 @@ var solAgoraPjObject = zod.z.object({
1425
1548
  number: textField(),
1426
1549
  cnpj: cnpjSchema,
1427
1550
  email: emailSchema,
1428
- complement: textField(15).optional(),
1551
+ complement: optionalField(textField(15)),
1429
1552
  phone: phoneBRSchema,
1430
1553
  district: textField(),
1431
1554
  legal_nature: textField(),
@@ -1435,15 +1558,15 @@ var solAgoraPjObject = zod.z.object({
1435
1558
  economic_activity: textField(),
1436
1559
  monthly_income: currencySchema
1437
1560
  }).strict(),
1438
- financing_company_qsa: zod.z.array(
1439
- zod.z.object({
1561
+ financing_company_qsa: requiredArray(
1562
+ requiredObject({
1440
1563
  cep: cepSchema,
1441
1564
  name: textField(),
1442
1565
  address: textField(),
1443
1566
  cpf: cpfSchema,
1444
1567
  number: textField(),
1445
1568
  entry_date: issueDateSchema,
1446
- complement: textField(15).optional(),
1569
+ complement: optionalField(textField(15)),
1447
1570
  phone: phoneBRSchema,
1448
1571
  district: textField(),
1449
1572
  cellphone: phoneBRSchema,
@@ -1466,7 +1589,9 @@ var solAgoraPjObject = zod.z.object({
1466
1589
  )
1467
1590
  });
1468
1591
  var solAgoraPjSchema = solAgoraPjObject.strict().check(pjRefinement);
1469
- var solfacilPfObject = zod.z.object({
1592
+
1593
+ // src/domains/financing/formalization/schemas/SolfacilPFSchema.ts
1594
+ var solfacilPfObject = requiredObject({
1470
1595
  ...formalizationExtras,
1471
1596
  name: textField(),
1472
1597
  cep: cepSchema,
@@ -1475,12 +1600,12 @@ var solfacilPfObject = zod.z.object({
1475
1600
  birth_date: birthDateSchema,
1476
1601
  number: textField(),
1477
1602
  sex: SexEnum,
1478
- complement: textField(15).optional(),
1603
+ complement: optionalField(textField(15)),
1479
1604
  mother_name: textField(),
1480
1605
  district: textField(),
1481
1606
  energy_account_in_requester_name: textField(),
1482
1607
  city: textField(),
1483
- energy_bill_owner_document: cpfCnpjSchema.optional(),
1608
+ energy_bill_owner_document: optionalField(cpfCnpjSchema),
1484
1609
  state: UfEnum,
1485
1610
  nationality: NationalityEnum.default(NATIONALITY_BRAZIL),
1486
1611
  cellphone: phoneBRSchema,
@@ -1493,9 +1618,11 @@ var solfacilPfObject = zod.z.object({
1493
1618
  doc_issue_date: issueDateSchema
1494
1619
  });
1495
1620
  var solfacilPfSchema = solfacilPfObject.strict().check(pfRefinement);
1496
- var solfacilPjObject = zod.z.object({
1621
+
1622
+ // src/domains/financing/formalization/schemas/SolfacilPJSchema.ts
1623
+ var solfacilPjObject = requiredObject({
1497
1624
  ...formalizationExtras,
1498
- financing_company: zod.z.object({
1625
+ financing_company: requiredObject({
1499
1626
  corporate_name: textField(),
1500
1627
  cep: cepSchema,
1501
1628
  address: textField(),
@@ -1503,22 +1630,22 @@ var solfacilPjObject = zod.z.object({
1503
1630
  number: textField(),
1504
1631
  cnpj: cnpjSchema,
1505
1632
  email: emailSchema,
1506
- complement: textField(15).optional(),
1633
+ complement: optionalField(textField(15)),
1507
1634
  phone: phoneBRSchema,
1508
1635
  district: textField(),
1509
1636
  legal_nature: textField(),
1510
1637
  city: textField(),
1511
1638
  state: UfEnum
1512
1639
  }).strict(),
1513
- financing_company_guarantor: zod.z.array(
1514
- zod.z.object({
1640
+ financing_company_guarantor: requiredArray(
1641
+ requiredObject({
1515
1642
  name: textField(),
1516
1643
  cep: cepSchema,
1517
1644
  cpf: cpfSchema,
1518
1645
  address: textField(),
1519
1646
  birth_date: birthDateSchema,
1520
1647
  number: textField(),
1521
- complement: textField(15).optional(),
1648
+ complement: optionalField(textField(15)),
1522
1649
  cellphone: phoneBRSchema,
1523
1650
  phone: phoneBRSchema,
1524
1651
  email: emailSchema,
@@ -1540,7 +1667,9 @@ var solfacilPjObject = zod.z.object({
1540
1667
  )
1541
1668
  });
1542
1669
  var solfacilPjSchema = solfacilPjObject.strict().check(pjRefinement);
1543
- var unifiedPfObject = zod.z.object({
1670
+
1671
+ // src/domains/financing/formalization/schemas/UnifiedPFSchema.ts
1672
+ var unifiedPfObject = requiredObject({
1544
1673
  name: textField(),
1545
1674
  cep: cepSchema,
1546
1675
  cpf: cpfSchema,
@@ -1548,12 +1677,12 @@ var unifiedPfObject = zod.z.object({
1548
1677
  birth_date: birthDateSchema,
1549
1678
  number: textField(),
1550
1679
  sex: SexEnum,
1551
- complement: textField(15).optional(),
1680
+ complement: optionalField(textField(15)),
1552
1681
  mother_name: textField(),
1553
1682
  district: textField(),
1554
1683
  energy_account_in_requester_name: YesOrNoEnum,
1555
1684
  city: textField(),
1556
- energy_bill_owner_document: cpfCnpjSchema.optional(),
1685
+ energy_bill_owner_document: optionalField(cpfCnpjSchema),
1557
1686
  state: UfEnum,
1558
1687
  nationality: NationalityEnum.default(NATIONALITY_BRAZIL),
1559
1688
  cellphone: phoneBRSchema,
@@ -1565,60 +1694,62 @@ var unifiedPfObject = zod.z.object({
1565
1694
  issuing_body: textField(6),
1566
1695
  doc_issue_date: issueDateSchema,
1567
1696
  residence_situation: ResidenceTypeEnum,
1568
- months_in_residence: integerField.optional(),
1697
+ months_in_residence: optionalField(integerField),
1569
1698
  civil_status: CivilStatusEnum,
1570
1699
  uf_naturalness: UfEnum,
1571
- naturalness: textField().optional(),
1700
+ naturalness: optionalField(textField()),
1572
1701
  nature_of_occupation: NatureOfOccupationTypeEnum,
1573
- company_time: numberField.optional(),
1574
- cnpj_proprietary: cnpjSchema.optional(),
1575
- equity_value: currencySchema.optional(),
1702
+ company_time: optionalField(numberField),
1703
+ cnpj_proprietary: optionalField(cnpjSchema),
1704
+ equity_value: optionalCurrencySchema,
1576
1705
  emitting_state: UfEnum,
1577
1706
  pep_relationship: YesOrNoEnum,
1578
- social_name: textField().optional(),
1579
- partner_name: textField().optional(),
1580
- partner_birth: dateDMYSchema.optional(),
1581
- partner_type_doc: DocumentTypeEnum.optional(),
1582
- partner_doc: textField().optional(),
1583
- partner_cpf: cpfSchema.optional(),
1584
- partner_city: textField().optional(),
1585
- communion_regime: CommunionRegimeEnum.optional(),
1586
- rural_area: textField(3).optional(),
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)),
1587
1716
  ...formalizationExtras
1588
1717
  });
1589
1718
  var unifiedPfSchema = unifiedPfObject.strict().check(pfRefinement);
1590
- var unifiedPjObject = zod.z.object({
1719
+
1720
+ // src/domains/financing/formalization/schemas/UnifiedPJSchema.ts
1721
+ var unifiedPjObject = requiredObject({
1591
1722
  ...formalizationExtras,
1592
- financing_company: zod.z.object({
1723
+ financing_company: requiredObject({
1593
1724
  corporate_name: textField(),
1594
1725
  cnpj: cnpjSchema,
1595
1726
  foundation_date: issueDateSchema,
1596
1727
  address: textField(),
1597
1728
  number: textField(),
1598
1729
  email: emailSchema,
1599
- complement: textField(15).optional(),
1730
+ complement: optionalField(textField(15)),
1600
1731
  phone: phoneBRSchema,
1601
1732
  district: textField(),
1602
1733
  legal_nature: textField(),
1603
1734
  city: textField(),
1604
1735
  state: UfEnum,
1605
1736
  cep: cepSchema,
1606
- economic_activity: textField().optional(),
1607
- economic_activity_group: textField().optional(),
1608
- monthly_income: currencySchema.optional(),
1609
- residence_situation: textField().optional(),
1610
- months_in_residence: integerField.optional(),
1611
- capital_social: currencySchema.optional()
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
1612
1743
  }).strict(),
1613
- financing_company_guarantor: zod.z.array(
1614
- zod.z.object({
1744
+ financing_company_guarantor: requiredArray(
1745
+ requiredObject({
1615
1746
  name: textField(),
1616
1747
  cpf: cpfSchema,
1617
1748
  birth_date: birthDateSchema,
1618
1749
  address: textField(),
1619
1750
  number: textField(),
1620
1751
  cep: cepSchema,
1621
- complement: textField(15).optional(),
1752
+ complement: optionalField(textField(15)),
1622
1753
  cellphone: phoneBRSchema,
1623
1754
  email: emailSchema,
1624
1755
  district: textField(),
@@ -1627,35 +1758,35 @@ var unifiedPjObject = zod.z.object({
1627
1758
  state: UfEnum,
1628
1759
  mother_name: textField(),
1629
1760
  nationality: NationalityEnum.default(NATIONALITY_BRAZIL),
1630
- office: textField().optional(),
1631
- phone: phoneBRSchema.optional(),
1632
- civil_status: textField().optional(),
1633
- residence_situation: textField().optional(),
1634
- months_in_residence: integerField.optional(),
1635
- type_doc: DocumentTypeEnum.optional(),
1636
- doc: textField().optional(),
1637
- issuing_body: textField().optional(),
1638
- uf_issuing_body: UfEnum.optional(),
1639
- doc_issue_date: issueDateSchema.optional(),
1640
- doc_expiration_date: dateDMYSchema.optional(),
1641
- monthly_income: currencySchema.optional(),
1642
- patrimony: currencySchema.optional(),
1643
- naturalness: textField().optional(),
1644
- uf_naturalness: UfEnum.optional(),
1645
- pep_relationship: textField().optional(),
1646
- entry_date: issueDateSchema.optional(),
1647
- doc_issuance_uf: UfEnum.optional()
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)
1648
1779
  }).strict()
1649
1780
  ).optional(),
1650
- financing_company_qsa: zod.z.array(
1651
- zod.z.object({
1781
+ financing_company_qsa: requiredArray(
1782
+ requiredObject({
1652
1783
  name: textField(),
1653
1784
  cpf: cpfSchema,
1654
1785
  birth_date: birthDateSchema,
1655
1786
  address: textField(),
1656
1787
  number: textField(),
1657
1788
  cep: cepSchema,
1658
- complement: textField(15).optional(),
1789
+ complement: optionalField(textField(15)),
1659
1790
  cellphone: phoneBRSchema,
1660
1791
  email: emailSchema,
1661
1792
  district: textField(),
@@ -1664,24 +1795,24 @@ var unifiedPjObject = zod.z.object({
1664
1795
  state: UfEnum,
1665
1796
  mother_name: textField(),
1666
1797
  nationality: NationalityEnum.default(NATIONALITY_BRAZIL),
1667
- office: textField().optional(),
1668
- phone: phoneBRSchema.optional(),
1669
- civil_status: textField().optional(),
1670
- residence_situation: textField().optional(),
1671
- months_in_residence: integerField.optional(),
1672
- type_doc: DocumentTypeEnum.optional(),
1673
- doc: textField().optional(),
1674
- issuing_body: textField().optional(),
1675
- uf_issuing_body: UfEnum.optional(),
1676
- doc_issue_date: issueDateSchema.optional(),
1677
- doc_expiration_date: dateDMYSchema.optional(),
1678
- monthly_income: currencySchema.optional(),
1679
- patrimony: currencySchema.optional(),
1680
- naturalness: textField().optional(),
1681
- uf_naturalness: UfEnum.optional(),
1682
- pep_relationship: textField().optional(),
1683
- entry_date: issueDateSchema.optional(),
1684
- doc_issuance_uf: UfEnum.optional()
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)
1685
1816
  }).strict()
1686
1817
  ).optional()
1687
1818
  });
@@ -1770,7 +1901,19 @@ var CREDITO77_PRESTAMISTA_FIELDS = {
1770
1901
  function isCredito77WithoutPrestamista(bank, person, options) {
1771
1902
  return bank === "credito77" && person === "pf" && !options.prestamistaIncluso;
1772
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
+ }
1773
1915
  function getFormalizationSchema(bank, person, options = {}) {
1916
+ assertValidTarget(bank, person);
1774
1917
  if (bank === UNIFIED_SLUG) {
1775
1918
  return unifiedSchemaByPerson[person];
1776
1919
  }
@@ -1780,6 +1923,7 @@ function getFormalizationSchema(bank, person, options = {}) {
1780
1923
  return person === "pf" ? pfSchemaRegistry[bank] : pjSchemaRegistry[bank];
1781
1924
  }
1782
1925
  function getFormalizationBaseSchema(bank, person, options = {}) {
1926
+ assertValidTarget(bank, person);
1783
1927
  if (bank === UNIFIED_SLUG) {
1784
1928
  return unifiedBaseSchemaByPerson[person];
1785
1929
  }
@@ -1813,6 +1957,24 @@ var FORMALIZATION_FIELD_META = {
1813
1957
  label: "Documento de v\xEDnculo com o titular",
1814
1958
  step: 1
1815
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
+ },
1816
1978
  type_doc: {
1817
1979
  kind: "select",
1818
1980
  label: "Tipo de documento",
@@ -1895,12 +2057,14 @@ var FORMALIZATION_FIELD_META = {
1895
2057
  step: 3,
1896
2058
  placeholder: "Digite o nome da m\xE3e"
1897
2059
  },
1898
- // naturalness: {
1899
- // kind: 'text',
1900
- // label: 'Naturalidade',
1901
- // step: 3,
1902
- // placeholder: 'Selecione uma opção',
1903
- // },
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
+ },
1904
2068
  uf_naturalness: {
1905
2069
  kind: "select",
1906
2070
  label: "UF de naturalidade",
@@ -2000,6 +2164,42 @@ var FORMALIZATION_FIELD_META = {
2000
2164
  placeholder: "Digite o tempo de resid\xEAncia em meses"
2001
2165
  },
2002
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" },
2003
2203
  financing_company_guarantor: { kind: "array", label: "Avalistas", step: 4 },
2004
2204
  financing_company_qsa: {
2005
2205
  kind: "array",
@@ -2007,6 +2207,34 @@ var FORMALIZATION_FIELD_META = {
2007
2207
  step: 4,
2008
2208
  placeholder: "Selecione uma op\xE7\xE3o"
2009
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
+ },
2010
2238
  social_name: { kind: "text", label: "Nome social", step: 4 },
2011
2239
  partner_name: { kind: "text", label: "Nome do c\xF4njuge", step: 4 },
2012
2240
  partner_birth: {