@77sol-lab/form-schemas 1.3.0 → 1.5.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 (165) hide show
  1. package/{chunk-TEL6EWAJ.mjs → chunk-2END6TYT.mjs} +3 -3
  2. package/{chunk-WHVCW22E.mjs → chunk-3OIG2FI5.mjs} +3 -3
  3. package/{chunk-FISPUQLP.mjs → chunk-4XJZIRLT.mjs} +6 -6
  4. package/{chunk-SBOQWT53.mjs → chunk-53GXILC6.mjs} +3 -3
  5. package/{chunk-CY2EXD6C.mjs → chunk-5C4YMHXV.mjs} +5 -5
  6. package/{chunk-TUYULPDF.mjs → chunk-6PH42V5T.mjs} +3 -3
  7. package/chunk-6YS5KBXS.mjs +438 -0
  8. package/chunk-7I2LXGA2.mjs +13 -0
  9. package/{chunk-2TGZGHS3.mjs → chunk-7MWUETLP.mjs} +3 -3
  10. package/{chunk-W3CNJVMM.mjs → chunk-7ZF45QUN.mjs} +3 -3
  11. package/chunk-D2ZUTYWA.mjs +109 -0
  12. package/{chunk-KXEEZLMR.mjs → chunk-F27U6CXB.mjs} +3 -3
  13. package/{chunk-TE64VI3I.mjs → chunk-FPJKWVVF.mjs} +3 -3
  14. package/{chunk-G3T562PC.mjs → chunk-FRMGP3C3.mjs} +3 -3
  15. package/{chunk-UHMVAJYK.mjs → chunk-G5SKXDYM.mjs} +3 -3
  16. package/{chunk-NL4VK2TF.mjs → chunk-GQ5G2YX4.mjs} +3 -3
  17. package/{chunk-RMWCQ6YU.mjs → chunk-H54QBCSW.mjs} +3 -3
  18. package/{chunk-NDJRJOFE.mjs → chunk-HBTFOSJU.mjs} +105 -33
  19. package/{chunk-FVIOZ4Q5.mjs → chunk-IWSDOFBY.mjs} +6 -6
  20. package/{chunk-HKY6D6J5.mjs → chunk-L4EWOROT.mjs} +3 -3
  21. package/{chunk-7LHQ27CS.mjs → chunk-N2IX5TRK.mjs} +3 -3
  22. package/{chunk-XNACW46V.mjs → chunk-NCTEG6EL.mjs} +11 -11
  23. package/{chunk-TCPW5MUT.mjs → chunk-OARPUXXM.mjs} +3 -3
  24. package/{chunk-ORO6OVTB.mjs → chunk-OVANLPKX.mjs} +3 -3
  25. package/{chunk-B7RDVG4R.mjs → chunk-R6CEKWRQ.mjs} +6 -6
  26. package/{chunk-MWPQSGDD.mjs → chunk-RYJSCFSY.mjs} +3 -3
  27. package/{chunk-36GQASLI.mjs → chunk-UMP5UF3U.mjs} +3 -3
  28. package/{chunk-GCYI6OFG.mjs → chunk-UU3MRKTH.mjs} +3 -3
  29. package/{chunk-TTHE6D3Y.mjs → chunk-UUWULEKH.mjs} +3 -3
  30. package/{chunk-6BD6V7EB.mjs → chunk-VO573WIK.mjs} +3 -3
  31. package/{chunk-22ZUS7K3.mjs → chunk-WTHEEPBE.mjs} +3 -3
  32. package/{chunk-EFLW2FHX.mjs → chunk-YIUJVGT4.mjs} +3 -3
  33. package/{chunk-XUMC3TQU.mjs → chunk-Z2TTZ3JJ.mjs} +4 -4
  34. package/financing/formalization/index.d.cts +2518 -2581
  35. package/financing/formalization/index.d.ts +2518 -2581
  36. package/financing/formalization/index.js +485 -154
  37. package/financing/formalization/index.mjs +33 -33
  38. package/financing/formalization/schemas/AlfaPFSchema.d.cts +50 -58
  39. package/financing/formalization/schemas/AlfaPFSchema.d.ts +50 -58
  40. package/financing/formalization/schemas/AlfaPFSchema.js +75 -35
  41. package/financing/formalization/schemas/AlfaPFSchema.mjs +3 -3
  42. package/financing/formalization/schemas/AlfaPJSchema.d.cts +60 -68
  43. package/financing/formalization/schemas/AlfaPJSchema.d.ts +60 -68
  44. package/financing/formalization/schemas/AlfaPJSchema.js +40 -24
  45. package/financing/formalization/schemas/AlfaPJSchema.mjs +2 -2
  46. package/financing/formalization/schemas/BancoDoBrasilPFSchema.d.cts +50 -58
  47. package/financing/formalization/schemas/BancoDoBrasilPFSchema.d.ts +50 -58
  48. package/financing/formalization/schemas/BancoDoBrasilPFSchema.js +75 -35
  49. package/financing/formalization/schemas/BancoDoBrasilPFSchema.mjs +3 -3
  50. package/financing/formalization/schemas/BancoDoBrasilPJSchema.d.cts +60 -68
  51. package/financing/formalization/schemas/BancoDoBrasilPJSchema.d.ts +60 -68
  52. package/financing/formalization/schemas/BancoDoBrasilPJSchema.js +40 -24
  53. package/financing/formalization/schemas/BancoDoBrasilPJSchema.mjs +2 -2
  54. package/financing/formalization/schemas/BtgPFSchema.d.cts +50 -58
  55. package/financing/formalization/schemas/BtgPFSchema.d.ts +50 -58
  56. package/financing/formalization/schemas/BtgPFSchema.js +75 -35
  57. package/financing/formalization/schemas/BtgPFSchema.mjs +3 -3
  58. package/financing/formalization/schemas/BtgPJSchema.d.cts +106 -114
  59. package/financing/formalization/schemas/BtgPJSchema.d.ts +106 -114
  60. package/financing/formalization/schemas/BtgPJSchema.js +46 -27
  61. package/financing/formalization/schemas/BtgPJSchema.mjs +3 -3
  62. package/financing/formalization/schemas/BvPFSchema.d.cts +84 -92
  63. package/financing/formalization/schemas/BvPFSchema.d.ts +84 -92
  64. package/financing/formalization/schemas/BvPFSchema.js +77 -37
  65. package/financing/formalization/schemas/BvPFSchema.mjs +3 -3
  66. package/financing/formalization/schemas/BvPJSchema.d.cts +136 -144
  67. package/financing/formalization/schemas/BvPJSchema.d.ts +136 -144
  68. package/financing/formalization/schemas/BvPJSchema.js +46 -27
  69. package/financing/formalization/schemas/BvPJSchema.mjs +3 -3
  70. package/financing/formalization/schemas/CaixaEconomicaFederalPFSchema.d.cts +50 -58
  71. package/financing/formalization/schemas/CaixaEconomicaFederalPFSchema.d.ts +50 -58
  72. package/financing/formalization/schemas/CaixaEconomicaFederalPFSchema.js +75 -35
  73. package/financing/formalization/schemas/CaixaEconomicaFederalPFSchema.mjs +3 -3
  74. package/financing/formalization/schemas/CaixaEconomicaFederalPJSchema.d.cts +60 -68
  75. package/financing/formalization/schemas/CaixaEconomicaFederalPJSchema.d.ts +60 -68
  76. package/financing/formalization/schemas/CaixaEconomicaFederalPJSchema.js +40 -24
  77. package/financing/formalization/schemas/CaixaEconomicaFederalPJSchema.mjs +2 -2
  78. package/financing/formalization/schemas/CashMePFSchema.d.cts +50 -58
  79. package/financing/formalization/schemas/CashMePFSchema.d.ts +50 -58
  80. package/financing/formalization/schemas/CashMePFSchema.js +75 -35
  81. package/financing/formalization/schemas/CashMePFSchema.mjs +3 -3
  82. package/financing/formalization/schemas/CashMePJSchema.d.cts +60 -68
  83. package/financing/formalization/schemas/CashMePJSchema.d.ts +60 -68
  84. package/financing/formalization/schemas/CashMePJSchema.js +40 -24
  85. package/financing/formalization/schemas/CashMePJSchema.mjs +2 -2
  86. package/financing/formalization/schemas/Credito77PFSchema.d.cts +50 -58
  87. package/financing/formalization/schemas/Credito77PFSchema.d.ts +50 -58
  88. package/financing/formalization/schemas/Credito77PFSchema.js +75 -35
  89. package/financing/formalization/schemas/Credito77PFSchema.mjs +3 -3
  90. package/financing/formalization/schemas/Credito77PJSchema.d.cts +60 -68
  91. package/financing/formalization/schemas/Credito77PJSchema.d.ts +60 -68
  92. package/financing/formalization/schemas/Credito77PJSchema.js +40 -24
  93. package/financing/formalization/schemas/Credito77PJSchema.mjs +2 -2
  94. package/financing/formalization/schemas/EosPFSchema.d.cts +50 -58
  95. package/financing/formalization/schemas/EosPFSchema.d.ts +50 -58
  96. package/financing/formalization/schemas/EosPFSchema.js +75 -35
  97. package/financing/formalization/schemas/EosPFSchema.mjs +3 -3
  98. package/financing/formalization/schemas/EosPJSchema.d.cts +60 -68
  99. package/financing/formalization/schemas/EosPJSchema.d.ts +60 -68
  100. package/financing/formalization/schemas/EosPJSchema.js +40 -24
  101. package/financing/formalization/schemas/EosPJSchema.mjs +2 -2
  102. package/financing/formalization/schemas/HdtEnergyPFSchema.d.cts +50 -58
  103. package/financing/formalization/schemas/HdtEnergyPFSchema.d.ts +50 -58
  104. package/financing/formalization/schemas/HdtEnergyPFSchema.js +75 -35
  105. package/financing/formalization/schemas/HdtEnergyPFSchema.mjs +3 -3
  106. package/financing/formalization/schemas/HdtEnergyPJSchema.d.cts +60 -68
  107. package/financing/formalization/schemas/HdtEnergyPJSchema.d.ts +60 -68
  108. package/financing/formalization/schemas/HdtEnergyPJSchema.js +40 -24
  109. package/financing/formalization/schemas/HdtEnergyPJSchema.mjs +2 -2
  110. package/financing/formalization/schemas/LosangoPFSchema.d.cts +50 -58
  111. package/financing/formalization/schemas/LosangoPFSchema.d.ts +50 -58
  112. package/financing/formalization/schemas/LosangoPFSchema.js +75 -35
  113. package/financing/formalization/schemas/LosangoPFSchema.mjs +3 -3
  114. package/financing/formalization/schemas/LosangoPJSchema.d.cts +60 -68
  115. package/financing/formalization/schemas/LosangoPJSchema.d.ts +60 -68
  116. package/financing/formalization/schemas/LosangoPJSchema.js +40 -24
  117. package/financing/formalization/schemas/LosangoPJSchema.mjs +2 -2
  118. package/financing/formalization/schemas/SafraPFSchema.d.cts +50 -58
  119. package/financing/formalization/schemas/SafraPFSchema.d.ts +50 -58
  120. package/financing/formalization/schemas/SafraPFSchema.js +75 -35
  121. package/financing/formalization/schemas/SafraPFSchema.mjs +3 -3
  122. package/financing/formalization/schemas/SafraPJSchema.d.cts +60 -68
  123. package/financing/formalization/schemas/SafraPJSchema.d.ts +60 -68
  124. package/financing/formalization/schemas/SafraPJSchema.js +40 -24
  125. package/financing/formalization/schemas/SafraPJSchema.mjs +2 -2
  126. package/financing/formalization/schemas/SantanderPFSchema.d.cts +50 -58
  127. package/financing/formalization/schemas/SantanderPFSchema.d.ts +50 -58
  128. package/financing/formalization/schemas/SantanderPFSchema.js +75 -35
  129. package/financing/formalization/schemas/SantanderPFSchema.mjs +3 -3
  130. package/financing/formalization/schemas/SantanderPJSchema.d.cts +60 -68
  131. package/financing/formalization/schemas/SantanderPJSchema.d.ts +60 -68
  132. package/financing/formalization/schemas/SantanderPJSchema.js +40 -24
  133. package/financing/formalization/schemas/SantanderPJSchema.mjs +2 -2
  134. package/financing/formalization/schemas/SolAgoraPFSchema.d.cts +50 -58
  135. package/financing/formalization/schemas/SolAgoraPFSchema.d.ts +50 -58
  136. package/financing/formalization/schemas/SolAgoraPFSchema.js +75 -35
  137. package/financing/formalization/schemas/SolAgoraPFSchema.mjs +3 -3
  138. package/financing/formalization/schemas/SolAgoraPJSchema.d.cts +106 -114
  139. package/financing/formalization/schemas/SolAgoraPJSchema.d.ts +106 -114
  140. package/financing/formalization/schemas/SolAgoraPJSchema.js +46 -27
  141. package/financing/formalization/schemas/SolAgoraPJSchema.mjs +3 -3
  142. package/financing/formalization/schemas/SolfacilPFSchema.d.cts +50 -58
  143. package/financing/formalization/schemas/SolfacilPFSchema.d.ts +50 -58
  144. package/financing/formalization/schemas/SolfacilPFSchema.js +75 -35
  145. package/financing/formalization/schemas/SolfacilPFSchema.mjs +3 -3
  146. package/financing/formalization/schemas/SolfacilPJSchema.d.cts +82 -90
  147. package/financing/formalization/schemas/SolfacilPJSchema.d.ts +82 -90
  148. package/financing/formalization/schemas/SolfacilPJSchema.js +41 -25
  149. package/financing/formalization/schemas/SolfacilPJSchema.mjs +2 -2
  150. package/financing/formalization/schemas/UnifiedPFSchema.d.cts +222 -166
  151. package/financing/formalization/schemas/UnifiedPFSchema.d.ts +222 -166
  152. package/financing/formalization/schemas/UnifiedPFSchema.js +114 -43
  153. package/financing/formalization/schemas/UnifiedPFSchema.mjs +3 -3
  154. package/financing/formalization/schemas/UnifiedPJSchema.d.cts +258 -266
  155. package/financing/formalization/schemas/UnifiedPJSchema.d.ts +258 -266
  156. package/financing/formalization/schemas/UnifiedPJSchema.js +51 -32
  157. package/financing/formalization/schemas/UnifiedPJSchema.mjs +3 -3
  158. package/index.d.cts +1 -1
  159. package/index.d.ts +1 -1
  160. package/index.js +485 -154
  161. package/index.mjs +33 -33
  162. package/package.json +1 -1
  163. package/chunk-52KJIJBF.mjs +0 -45
  164. package/chunk-A2TV7TRP.mjs +0 -6
  165. package/chunk-KKGV43J4.mjs +0 -250
@@ -2,12 +2,135 @@
2
2
 
3
3
  var zod = require('zod');
4
4
 
5
- // src/shared/enums/document-type.ts
6
- var DocumentTypeEnum = zod.z.enum(["rg", "cnh", "rne"]);
5
+ // src/shared/enums/civil-status.ts
6
+ var CivilStatusEnum = zod.z.enum([
7
+ "solteiro",
8
+ "casado",
9
+ "divorciado",
10
+ "viuvo",
11
+ "separado_judicialmente",
12
+ "companheiro"
13
+ ]);
14
+ var CivilStatusLabels = {
15
+ solteiro: "Solteiro(a)",
16
+ casado: "Casado(a)",
17
+ divorciado: "Divorciado(a)",
18
+ viuvo: "Vi\xFAvo(a)",
19
+ separado_judicialmente: "Separado(a) judicialmente",
20
+ companheiro: "Companheiro(a)"
21
+ };
22
+ var CommunionRegimeEnum = zod.z.enum([
23
+ "comunhao_parcial",
24
+ "comunhao_universal",
25
+ "separacao_total",
26
+ "participacao_final_aquestos"
27
+ ]);
28
+ var CommunionRegimeLabels = {
29
+ comunhao_parcial: "Comunh\xE3o parcial de bens",
30
+ comunhao_universal: "Comunh\xE3o universal de bens",
31
+ separacao_total: "Separa\xE7\xE3o total de bens",
32
+ participacao_final_aquestos: "Participa\xE7\xE3o final nos aquestos"
33
+ };
34
+ var DocumentTypeEnum = zod.z.enum([
35
+ "documento_de_identidade",
36
+ "carteira_nacional_de_habilita\xE7\xE3o"
37
+ ]);
38
+ var DocumentTypeLabels = {
39
+ documento_de_identidade: "Documento de identidade (RG)",
40
+ carteira_nacional_de_habilita\u00E7\u00E3o: "Carteira Nacional de Habilita\xE7\xE3o (CNH)"
41
+ };
7
42
 
8
43
  // src/shared/enums/nationality.ts
9
44
  var NATIONALITY_BRAZIL = "brasil";
45
+ var NatureOfOccupationTypeEnum = zod.z.enum(["autonomo", "clt", "aposentado", "empresario"]);
46
+ var NatureOfOccupationTypeLabels = {
47
+ autonomo: "Aut\xF4nomo",
48
+ clt: "CLT",
49
+ aposentado: "Aposentado",
50
+ empresario: "Empres\xE1rio"
51
+ };
52
+ var ResidenceTypeEnum = zod.z.enum([
53
+ "proprio",
54
+ "familiar",
55
+ "alugado",
56
+ "proprio_financiado",
57
+ "cedido"
58
+ ]);
59
+ var ResidenceTypeLabels = {
60
+ proprio: "Pr\xF3prio",
61
+ familiar: "Familiar",
62
+ alugado: "Alugado",
63
+ proprio_financiado: "Pr\xF3prio financiado",
64
+ cedido: "Cedido"
65
+ };
10
66
  var SexEnum = zod.z.enum(["masculino", "feminino"]);
67
+ var SexLabels = {
68
+ masculino: "Masculino",
69
+ feminino: "Feminino"
70
+ };
71
+ var UfEnum = zod.z.enum([
72
+ "AC",
73
+ "AL",
74
+ "AP",
75
+ "AM",
76
+ "BA",
77
+ "CE",
78
+ "DF",
79
+ "ES",
80
+ "GO",
81
+ "MA",
82
+ "MT",
83
+ "MS",
84
+ "MG",
85
+ "PA",
86
+ "PB",
87
+ "PR",
88
+ "PE",
89
+ "PI",
90
+ "RJ",
91
+ "RN",
92
+ "RS",
93
+ "RO",
94
+ "RR",
95
+ "SC",
96
+ "SP",
97
+ "SE",
98
+ "TO"
99
+ ]);
100
+ var UfLabels = {
101
+ AC: "Acre",
102
+ AL: "Alagoas",
103
+ AP: "Amap\xE1",
104
+ AM: "Amazonas",
105
+ BA: "Bahia",
106
+ CE: "Cear\xE1",
107
+ DF: "Distrito Federal",
108
+ ES: "Esp\xEDrito Santo",
109
+ GO: "Goi\xE1s",
110
+ MA: "Maranh\xE3o",
111
+ MT: "Mato Grosso",
112
+ MS: "Mato Grosso do Sul",
113
+ MG: "Minas Gerais",
114
+ PA: "Par\xE1",
115
+ PB: "Para\xEDba",
116
+ PR: "Paran\xE1",
117
+ PE: "Pernambuco",
118
+ PI: "Piau\xED",
119
+ RJ: "Rio de Janeiro",
120
+ RN: "Rio Grande do Norte",
121
+ RS: "Rio Grande do Sul",
122
+ RO: "Rond\xF4nia",
123
+ RR: "Roraima",
124
+ SC: "Santa Catarina",
125
+ SP: "S\xE3o Paulo",
126
+ SE: "Sergipe",
127
+ TO: "Tocantins"
128
+ };
129
+ var YesOrNoEnum = zod.z.enum(["sim", "nao"]);
130
+ var YesOrNoLabels = {
131
+ sim: "Sim",
132
+ nao: "N\xE3o"
133
+ };
11
134
  var BANK_SLUGS = [
12
135
  "credito77",
13
136
  "losango",
@@ -26,9 +149,45 @@ var BANK_SLUGS = [
26
149
  ];
27
150
  var BankEnum = zod.z.enum(BANK_SLUGS);
28
151
 
152
+ // src/domains/financing/enums/civil-status.ts
153
+ var CIVIL_STATUS_REQUIRING_PARTNER = ["casado"];
154
+ var PARTNER_FIELDS = [
155
+ "partner_name",
156
+ "partner_birth",
157
+ "partner_type_doc",
158
+ "partner_doc",
159
+ "partner_cpf",
160
+ "partner_city",
161
+ "communion_regime"
162
+ ];
163
+
29
164
  // src/domains/financing/enums/occupation.ts
30
165
  var OCCUPATIONS_REQUIRING_CNPJ = ["empresario", "empresario_ou_proprietario"];
31
166
 
167
+ // src/domains/financing/formalization/optionLabels.ts
168
+ var FORMALIZATION_OPTION_LABELS = {
169
+ sex: SexLabels,
170
+ type_doc: DocumentTypeLabels,
171
+ partner_type_doc: DocumentTypeLabels,
172
+ residence_situation: ResidenceTypeLabels,
173
+ nature_of_occupation: NatureOfOccupationTypeLabels,
174
+ pep_relationship: YesOrNoLabels,
175
+ civil_status: CivilStatusLabels,
176
+ communion_regime: CommunionRegimeLabels,
177
+ state: UfLabels,
178
+ uf_naturalness: UfLabels,
179
+ emitting_state: UfLabels,
180
+ uf_issuing_body: UfLabels,
181
+ doc_issuance_uf: UfLabels
182
+ };
183
+ function getFieldOptions(field) {
184
+ const labels = FORMALIZATION_OPTION_LABELS[field];
185
+ if (!labels) {
186
+ return [];
187
+ }
188
+ return Object.entries(labels).map(([value, label]) => ({ value, label }));
189
+ }
190
+
32
191
  // src/shared/regex/patterns.ts
33
192
  var PATTERNS = {
34
193
  cpf: /^\d{11}$/,
@@ -125,16 +284,16 @@ function yearsSinceDMY(value, reference = /* @__PURE__ */ new Date()) {
125
284
  }
126
285
 
127
286
  // src/shared/regex/index.ts
128
- var cpfSchema = zod.z.string().transform(onlyDigits).refine((v) => PATTERNS.cpf.test(v), "CPF deve ter 11 d\xEDgitos").refine(isValidCPF, "CPF inv\xE1lido");
129
- var cnpjSchema = zod.z.string().transform(onlyDigits).refine((v) => PATTERNS.cnpj.test(v), "CNPJ deve ter 14 d\xEDgitos").refine(isValidCNPJ, "CNPJ inv\xE1lido");
287
+ var cpfSchema = zod.z.string().transform(onlyDigits).refine((v) => PATTERNS.cpf.test(v), "CPF inv\xE1lido").refine(isValidCPF, "CPF inv\xE1lido");
288
+ var cnpjSchema = zod.z.string().transform(onlyDigits).refine((v) => PATTERNS.cnpj.test(v), "CNPJ inv\xE1lido").refine(isValidCNPJ, "CNPJ inv\xE1lido");
130
289
  var cpfCnpjSchema = zod.z.string().transform(onlyDigits).refine(
131
290
  (v) => PATTERNS.cpf.test(v) || PATTERNS.cnpj.test(v),
132
291
  "Documento deve ter 11 (CPF) ou 14 (CNPJ) d\xEDgitos"
133
292
  ).refine((v) => v.length === 11 ? isValidCPF(v) : isValidCNPJ(v), "Documento inv\xE1lido");
134
- var cepSchema = zod.z.string().transform(onlyDigits).refine((v) => PATTERNS.cep.test(v), "CEP deve ter 8 d\xEDgitos");
135
- var phoneBRSchema = zod.z.string().transform(onlyDigits).refine((v) => PATTERNS.phoneBR.test(v), "Telefone deve ter 11 d\xEDgitos com DDD");
293
+ var cepSchema = zod.z.string().transform(onlyDigits).refine((v) => PATTERNS.cep.test(v), "CEP inv\xE1lido");
294
+ var phoneBRSchema = zod.z.string().transform(onlyDigits).refine((v) => PATTERNS.phoneBR.test(v), "Telefone inv\xE1lido");
136
295
  var emailSchema = zod.z.string().trim().refine((v) => PATTERNS.email.test(v), "E-mail inv\xE1lido");
137
- var dateDMYSchema = zod.z.string().refine((v) => PATTERNS.dateDMY.test(v), "Data deve estar no formato DD/MM/AAAA").refine((v) => parseDMY(v) !== null, "Data inexistente no calend\xE1rio");
296
+ var dateDMYSchema = zod.z.string().refine((v) => PATTERNS.dateDMY.test(v), "Data inv\xE1lida").refine((v) => parseDMY(v) !== null, "Data inexistente no calend\xE1rio");
138
297
  var birthDateSchema = dateDMYSchema.refine(
139
298
  (v) => isAdultDMY(v),
140
299
  "\xC9 necess\xE1rio ser maior de idade (18+)"
@@ -148,17 +307,36 @@ zod.z.number().int("Deve ser um n\xFAmero inteiro").min(1, "M\xEDnimo 1").max(28
148
307
 
149
308
  // src/domains/financing/formalization/refinements.ts
150
309
  var RG_MAX_EMISSION_YEARS = 10;
310
+ function applyPartnerRefinement(data, ctx) {
311
+ const civilStatus = data.civil_status;
312
+ const requiresPartner = typeof civilStatus === "string" && CIVIL_STATUS_REQUIRING_PARTNER.includes(civilStatus);
313
+ if (!requiresPartner) {
314
+ return;
315
+ }
316
+ for (const field of PARTNER_FIELDS) {
317
+ const value = data[field];
318
+ const isEmpty = value === void 0 || value === null || typeof value === "string" && value.trim().length === 0;
319
+ if (isEmpty) {
320
+ ctx.addIssue({
321
+ code: zod.z.ZodIssueCode.custom,
322
+ path: [field],
323
+ message: "Campo obrigat\xF3rio para o estado civil informado"
324
+ });
325
+ }
326
+ }
327
+ }
151
328
  function applyCommonRefinements(data, ctx) {
152
- if ("account_third_party" in data && typeof data.account_third_party === "string" && data.account_third_party !== "nao_se_aplica" && !data.bond_document_upload) {
329
+ if ("energy_account_in_requester_name" in data && typeof data.energy_account_in_requester_name === "string" && data.energy_account_in_requester_name !== "nao_aplica" && !data.proof_kinship) {
153
330
  ctx.addIssue({
154
331
  code: zod.z.ZodIssueCode.custom,
155
- path: ["bond_document_upload"],
332
+ path: ["proof_kinship"],
156
333
  message: "Documento de v\xEDnculo \xE9 obrigat\xF3rio quando a conta est\xE1 em nome de terceiro"
157
334
  });
158
335
  }
159
336
  }
160
337
  function applyPfRefinements(data, ctx) {
161
338
  applyCommonRefinements(data, ctx);
339
+ applyPartnerRefinement(data, ctx);
162
340
  if ("nature_of_occupation" in data && typeof data.nature_of_occupation === "string" && OCCUPATIONS_REQUIRING_CNPJ.includes(data.nature_of_occupation) && !data.cnpj_proprietary) {
163
341
  ctx.addIssue({
164
342
  code: zod.z.ZodIssueCode.custom,
@@ -166,7 +344,7 @@ function applyPfRefinements(data, ctx) {
166
344
  message: "CNPJ do propriet\xE1rio \xE9 obrigat\xF3rio para esta ocupa\xE7\xE3o"
167
345
  });
168
346
  }
169
- if (data.type_doc === "rg" && typeof data.doc_issue_date === "string") {
347
+ if (data.type_doc === "documento_de_identidade" && typeof data.doc_issue_date === "string") {
170
348
  const years = yearsSinceDMY(data.doc_issue_date);
171
349
  if (years !== null && years > RG_MAX_EMISSION_YEARS) {
172
350
  ctx.addIssue({
@@ -176,13 +354,6 @@ function applyPfRefinements(data, ctx) {
176
354
  });
177
355
  }
178
356
  }
179
- if (typeof data.nationality === "string" && data.nationality.toLowerCase() !== NATIONALITY_BRAZIL && "type_doc" in data && data.type_doc !== "rne") {
180
- ctx.addIssue({
181
- code: zod.z.ZodIssueCode.custom,
182
- path: ["type_doc"],
183
- message: "Para nacionalidade estrangeira, o documento deve ser Registro de Estrangeiro (RNE)"
184
- });
185
- }
186
357
  }
187
358
  function applyPjRefinements(data, ctx) {
188
359
  applyCommonRefinements(data, ctx);
@@ -193,9 +364,6 @@ function textField(maxLength) {
193
364
  }
194
365
  var numberField = zod.z.number({ invalid_type_error: "Valor num\xE9rico inv\xE1lido" }).nonnegative("Valor n\xE3o pode ser negativo");
195
366
  var integerField = zod.z.number({ invalid_type_error: "Valor num\xE9rico inv\xE1lido" }).int("Deve ser um n\xFAmero inteiro").nonnegative("Valor n\xE3o pode ser negativo");
196
- function selectField(values) {
197
- return zod.z.enum(values);
198
- }
199
367
  var MAX_UPLOAD_BYTES = 5 * 1024 * 1024;
200
368
  var ACCEPTED_UPLOAD_MIME = ["image/jpeg", "image/png", "application/pdf"];
201
369
  var fileUploadField = zod.z.object({
@@ -205,21 +373,11 @@ var fileUploadField = zod.z.object({
205
373
  }),
206
374
  sizeBytes: zod.z.number().max(MAX_UPLOAD_BYTES, "Arquivo deve ter no m\xE1ximo 5MB")
207
375
  });
208
- var THIRD_PARTY_OPTIONS = [
209
- "nao_se_aplica",
210
- "conjuge",
211
- "pai_mae",
212
- "filho_filha",
213
- "parente",
214
- "outro"
215
- ];
216
376
  var formalizationExtras = {
217
- energy_bill_upload: fileUploadField,
218
- account_third_party: selectField(THIRD_PARTY_OPTIONS),
219
- bond_document_upload: fileUploadField.optional(),
377
+ voucher_local_installation_address: fileUploadField,
378
+ proof_kinship: fileUploadField.optional(),
220
379
  document_front_upload: fileUploadField,
221
380
  document_back_upload: fileUploadField,
222
- // RN-014: seguro RD/RE começa ON.
223
381
  rd_re_insurance_toggle: zod.z.boolean().default(true)
224
382
  };
225
383
 
@@ -239,7 +397,7 @@ var alfaPfObject = zod.z.object({
239
397
  energy_account_in_requester_name: textField(),
240
398
  city: textField(),
241
399
  energy_bill_owner_document: cpfCnpjSchema.optional(),
242
- state: textField(2),
400
+ state: UfEnum,
243
401
  nationality: textField(),
244
402
  cellphone: phoneBRSchema,
245
403
  email: emailSchema,
@@ -267,7 +425,7 @@ var alfaPjObject = zod.z.object({
267
425
  legal_nature: textField(),
268
426
  city: textField(),
269
427
  economic_activity_group: textField(),
270
- state: textField(2),
428
+ state: UfEnum,
271
429
  economic_activity: textField(),
272
430
  monthly_income: currencySchema
273
431
  }).strict(),
@@ -285,7 +443,7 @@ var alfaPjObject = zod.z.object({
285
443
  district: textField(),
286
444
  sex: SexEnum,
287
445
  city: textField(),
288
- state: textField(2),
446
+ state: UfEnum,
289
447
  office: textField(),
290
448
  mother_name: textField(),
291
449
  nationality: textField()
@@ -308,7 +466,7 @@ var bancoDoBrasilPfObject = zod.z.object({
308
466
  energy_account_in_requester_name: textField(),
309
467
  city: textField(),
310
468
  energy_bill_owner_document: cpfCnpjSchema.optional(),
311
- state: textField(2),
469
+ state: UfEnum,
312
470
  nationality: textField(),
313
471
  cellphone: phoneBRSchema,
314
472
  email: emailSchema,
@@ -336,7 +494,7 @@ var bancoDoBrasilPjObject = zod.z.object({
336
494
  legal_nature: textField(),
337
495
  city: textField(),
338
496
  economic_activity_group: textField(),
339
- state: textField(2),
497
+ state: UfEnum,
340
498
  economic_activity: textField(),
341
499
  monthly_income: currencySchema
342
500
  }).strict(),
@@ -354,7 +512,7 @@ var bancoDoBrasilPjObject = zod.z.object({
354
512
  district: textField(),
355
513
  sex: SexEnum,
356
514
  city: textField(),
357
- state: textField(2),
515
+ state: UfEnum,
358
516
  office: textField(),
359
517
  mother_name: textField(),
360
518
  nationality: textField()
@@ -377,7 +535,7 @@ var btgPfObject = zod.z.object({
377
535
  energy_account_in_requester_name: textField(),
378
536
  city: textField(),
379
537
  energy_bill_owner_document: cpfCnpjSchema.optional(),
380
- state: textField(2),
538
+ state: UfEnum,
381
539
  nationality: textField(),
382
540
  cellphone: phoneBRSchema,
383
541
  email: emailSchema,
@@ -405,7 +563,7 @@ var btgPjObject = zod.z.object({
405
563
  legal_nature: textField(),
406
564
  city: textField(),
407
565
  economic_activity_group: textField(),
408
- state: textField(2),
566
+ state: UfEnum,
409
567
  economic_activity: textField(),
410
568
  monthly_income: currencySchema
411
569
  }).strict(),
@@ -424,19 +582,19 @@ var btgPjObject = zod.z.object({
424
582
  district: textField(),
425
583
  sex: SexEnum,
426
584
  city: textField(),
427
- state: textField(2),
585
+ state: UfEnum,
428
586
  civil_status: textField(),
429
587
  office: textField(),
430
588
  type_doc: DocumentTypeEnum,
431
589
  doc: textField(),
432
590
  issuing_body: textField(),
433
- uf_issuing_body: textField(2),
591
+ uf_issuing_body: UfEnum,
434
592
  doc_issue_date: issueDateSchema,
435
593
  doc_expiration_date: dateDMYSchema,
436
594
  mother_name: textField(),
437
595
  monthly_income: currencySchema,
438
596
  patrimony: currencySchema,
439
- uf_naturalness: textField(2),
597
+ uf_naturalness: UfEnum,
440
598
  nationality: textField()
441
599
  }).strict()
442
600
  )
@@ -461,9 +619,9 @@ var bvPfObject = zod.z.object({
461
619
  city: textField(),
462
620
  energy_bill_owner_document: cpfCnpjSchema.optional(),
463
621
  civil_status: textField(),
464
- state: textField(2),
622
+ state: UfEnum,
465
623
  nationality: textField(),
466
- uf_naturalness: textField(2),
624
+ uf_naturalness: UfEnum,
467
625
  naturalness: textField(),
468
626
  cellphone: phoneBRSchema,
469
627
  email: emailSchema,
@@ -476,7 +634,7 @@ var bvPfObject = zod.z.object({
476
634
  type_doc: DocumentTypeEnum,
477
635
  doc: textField(15),
478
636
  issuing_body: textField(6),
479
- emitting_state: textField(2),
637
+ emitting_state: UfEnum,
480
638
  doc_issue_date: issueDateSchema,
481
639
  pep_relationship: textField().optional()
482
640
  });
@@ -499,7 +657,7 @@ var bvPjObject = zod.z.object({
499
657
  legal_nature: textField(),
500
658
  city: textField(),
501
659
  economic_activity_group: textField(),
502
- state: textField(2),
660
+ state: UfEnum,
503
661
  economic_activity: textField(),
504
662
  monthly_income: currencySchema,
505
663
  capital_social: currencySchema
@@ -519,7 +677,7 @@ var bvPjObject = zod.z.object({
519
677
  district: textField(),
520
678
  sex: SexEnum,
521
679
  city: textField(),
522
- state: textField(2),
680
+ state: UfEnum,
523
681
  civil_status: textField(),
524
682
  residence_situation: textField(),
525
683
  office: textField(),
@@ -527,14 +685,14 @@ var bvPjObject = zod.z.object({
527
685
  type_doc: DocumentTypeEnum,
528
686
  doc: textField(),
529
687
  issuing_body: textField(),
530
- uf_issuing_body: textField(2),
688
+ uf_issuing_body: UfEnum,
531
689
  doc_issue_date: issueDateSchema,
532
690
  doc_expiration_date: dateDMYSchema,
533
691
  mother_name: textField(),
534
692
  monthly_income: currencySchema,
535
693
  patrimony: currencySchema,
536
694
  naturalness: textField(),
537
- uf_naturalness: textField(2),
695
+ uf_naturalness: UfEnum,
538
696
  nationality: textField(),
539
697
  pep_relationship: textField()
540
698
  }).strict()
@@ -556,7 +714,7 @@ var caixaEconomicaFederalPfObject = zod.z.object({
556
714
  energy_account_in_requester_name: textField(),
557
715
  city: textField(),
558
716
  energy_bill_owner_document: cpfCnpjSchema.optional(),
559
- state: textField(2),
717
+ state: UfEnum,
560
718
  nationality: textField(),
561
719
  cellphone: phoneBRSchema,
562
720
  email: emailSchema,
@@ -584,7 +742,7 @@ var caixaEconomicaFederalPjObject = zod.z.object({
584
742
  legal_nature: textField(),
585
743
  city: textField(),
586
744
  economic_activity_group: textField(),
587
- state: textField(2),
745
+ state: UfEnum,
588
746
  economic_activity: textField(),
589
747
  monthly_income: currencySchema
590
748
  }).strict(),
@@ -602,7 +760,7 @@ var caixaEconomicaFederalPjObject = zod.z.object({
602
760
  district: textField(),
603
761
  sex: SexEnum,
604
762
  city: textField(),
605
- state: textField(2),
763
+ state: UfEnum,
606
764
  office: textField(),
607
765
  mother_name: textField(),
608
766
  nationality: textField()
@@ -625,7 +783,7 @@ var cashMePfObject = zod.z.object({
625
783
  energy_account_in_requester_name: textField(),
626
784
  city: textField(),
627
785
  energy_bill_owner_document: cpfCnpjSchema.optional(),
628
- state: textField(2),
786
+ state: UfEnum,
629
787
  nationality: textField(),
630
788
  cellphone: phoneBRSchema,
631
789
  email: emailSchema,
@@ -653,7 +811,7 @@ var cashMePjObject = zod.z.object({
653
811
  legal_nature: textField(),
654
812
  city: textField(),
655
813
  economic_activity_group: textField(),
656
- state: textField(2),
814
+ state: UfEnum,
657
815
  economic_activity: textField(),
658
816
  monthly_income: currencySchema
659
817
  }).strict(),
@@ -671,7 +829,7 @@ var cashMePjObject = zod.z.object({
671
829
  district: textField(),
672
830
  sex: SexEnum,
673
831
  city: textField(),
674
- state: textField(2),
832
+ state: UfEnum,
675
833
  office: textField(),
676
834
  mother_name: textField(),
677
835
  nationality: textField()
@@ -694,7 +852,7 @@ var credito77PfObject = zod.z.object({
694
852
  energy_account_in_requester_name: textField(),
695
853
  city: textField(),
696
854
  energy_bill_owner_document: cpfCnpjSchema.optional(),
697
- state: textField(2),
855
+ state: UfEnum,
698
856
  nationality: textField(),
699
857
  cellphone: phoneBRSchema,
700
858
  email: emailSchema,
@@ -722,7 +880,7 @@ var credito77PjObject = zod.z.object({
722
880
  legal_nature: textField(),
723
881
  city: textField(),
724
882
  economic_activity_group: textField(),
725
- state: textField(2),
883
+ state: UfEnum,
726
884
  economic_activity: textField(),
727
885
  monthly_income: currencySchema
728
886
  }).strict(),
@@ -740,7 +898,7 @@ var credito77PjObject = zod.z.object({
740
898
  district: textField(),
741
899
  sex: SexEnum,
742
900
  city: textField(),
743
- state: textField(2),
901
+ state: UfEnum,
744
902
  office: textField(),
745
903
  mother_name: textField(),
746
904
  nationality: textField()
@@ -763,7 +921,7 @@ var eosPfObject = zod.z.object({
763
921
  energy_account_in_requester_name: textField(),
764
922
  city: textField(),
765
923
  energy_bill_owner_document: cpfCnpjSchema.optional(),
766
- state: textField(2),
924
+ state: UfEnum,
767
925
  nationality: textField(),
768
926
  cellphone: phoneBRSchema,
769
927
  email: emailSchema,
@@ -791,7 +949,7 @@ var eosPjObject = zod.z.object({
791
949
  legal_nature: textField(),
792
950
  city: textField(),
793
951
  economic_activity_group: textField(),
794
- state: textField(2),
952
+ state: UfEnum,
795
953
  economic_activity: textField(),
796
954
  monthly_income: currencySchema
797
955
  }).strict(),
@@ -809,7 +967,7 @@ var eosPjObject = zod.z.object({
809
967
  district: textField(),
810
968
  sex: SexEnum,
811
969
  city: textField(),
812
- state: textField(2),
970
+ state: UfEnum,
813
971
  office: textField(),
814
972
  mother_name: textField(),
815
973
  nationality: textField()
@@ -832,7 +990,7 @@ var hdtEnergyPfObject = zod.z.object({
832
990
  energy_account_in_requester_name: textField(),
833
991
  city: textField(),
834
992
  energy_bill_owner_document: cpfCnpjSchema.optional(),
835
- state: textField(2),
993
+ state: UfEnum,
836
994
  nationality: textField(),
837
995
  cellphone: phoneBRSchema,
838
996
  email: emailSchema,
@@ -860,7 +1018,7 @@ var hdtEnergyPjObject = zod.z.object({
860
1018
  legal_nature: textField(),
861
1019
  city: textField(),
862
1020
  economic_activity_group: textField(),
863
- state: textField(2),
1021
+ state: UfEnum,
864
1022
  economic_activity: textField(),
865
1023
  monthly_income: currencySchema
866
1024
  }).strict(),
@@ -878,7 +1036,7 @@ var hdtEnergyPjObject = zod.z.object({
878
1036
  district: textField(),
879
1037
  sex: SexEnum,
880
1038
  city: textField(),
881
- state: textField(2),
1039
+ state: UfEnum,
882
1040
  office: textField(),
883
1041
  mother_name: textField(),
884
1042
  nationality: textField()
@@ -901,7 +1059,7 @@ var losangoPfObject = zod.z.object({
901
1059
  energy_account_in_requester_name: textField(),
902
1060
  city: textField(),
903
1061
  energy_bill_owner_document: cpfCnpjSchema.optional(),
904
- state: textField(2),
1062
+ state: UfEnum,
905
1063
  nationality: textField(),
906
1064
  cellphone: phoneBRSchema,
907
1065
  email: emailSchema,
@@ -929,7 +1087,7 @@ var losangoPjObject = zod.z.object({
929
1087
  legal_nature: textField(),
930
1088
  city: textField(),
931
1089
  economic_activity_group: textField(),
932
- state: textField(2),
1090
+ state: UfEnum,
933
1091
  economic_activity: textField(),
934
1092
  monthly_income: currencySchema
935
1093
  }).strict(),
@@ -947,7 +1105,7 @@ var losangoPjObject = zod.z.object({
947
1105
  district: textField(),
948
1106
  sex: SexEnum,
949
1107
  city: textField(),
950
- state: textField(2),
1108
+ state: UfEnum,
951
1109
  office: textField(),
952
1110
  mother_name: textField(),
953
1111
  nationality: textField()
@@ -970,7 +1128,7 @@ var safraPfObject = zod.z.object({
970
1128
  energy_account_in_requester_name: textField(),
971
1129
  city: textField(),
972
1130
  energy_bill_owner_document: cpfCnpjSchema.optional(),
973
- state: textField(2),
1131
+ state: UfEnum,
974
1132
  nationality: textField(),
975
1133
  cellphone: phoneBRSchema,
976
1134
  email: emailSchema,
@@ -998,7 +1156,7 @@ var safraPjObject = zod.z.object({
998
1156
  legal_nature: textField(),
999
1157
  city: textField(),
1000
1158
  economic_activity_group: textField(),
1001
- state: textField(2),
1159
+ state: UfEnum,
1002
1160
  economic_activity: textField(),
1003
1161
  monthly_income: currencySchema
1004
1162
  }).strict(),
@@ -1016,7 +1174,7 @@ var safraPjObject = zod.z.object({
1016
1174
  district: textField(),
1017
1175
  sex: SexEnum,
1018
1176
  city: textField(),
1019
- state: textField(2),
1177
+ state: UfEnum,
1020
1178
  office: textField(),
1021
1179
  mother_name: textField(),
1022
1180
  nationality: textField()
@@ -1039,7 +1197,7 @@ var santanderPfObject = zod.z.object({
1039
1197
  energy_account_in_requester_name: textField(),
1040
1198
  city: textField(),
1041
1199
  energy_bill_owner_document: cpfCnpjSchema.optional(),
1042
- state: textField(2),
1200
+ state: UfEnum,
1043
1201
  nationality: textField(),
1044
1202
  cellphone: phoneBRSchema,
1045
1203
  email: emailSchema,
@@ -1067,7 +1225,7 @@ var santanderPjObject = zod.z.object({
1067
1225
  legal_nature: textField(),
1068
1226
  city: textField(),
1069
1227
  economic_activity_group: textField(),
1070
- state: textField(2),
1228
+ state: UfEnum,
1071
1229
  economic_activity: textField(),
1072
1230
  monthly_income: currencySchema
1073
1231
  }).strict(),
@@ -1085,7 +1243,7 @@ var santanderPjObject = zod.z.object({
1085
1243
  district: textField(),
1086
1244
  sex: SexEnum,
1087
1245
  city: textField(),
1088
- state: textField(2),
1246
+ state: UfEnum,
1089
1247
  office: textField(),
1090
1248
  mother_name: textField(),
1091
1249
  nationality: textField()
@@ -1108,7 +1266,7 @@ var solAgoraPfObject = zod.z.object({
1108
1266
  energy_account_in_requester_name: textField(),
1109
1267
  city: textField(),
1110
1268
  energy_bill_owner_document: cpfCnpjSchema.optional(),
1111
- state: textField(2),
1269
+ state: UfEnum,
1112
1270
  nationality: textField(),
1113
1271
  cellphone: phoneBRSchema,
1114
1272
  email: emailSchema,
@@ -1136,7 +1294,7 @@ var solAgoraPjObject = zod.z.object({
1136
1294
  legal_nature: textField(),
1137
1295
  city: textField(),
1138
1296
  economic_activity_group: textField(),
1139
- state: textField(2),
1297
+ state: UfEnum,
1140
1298
  economic_activity: textField(),
1141
1299
  monthly_income: currencySchema
1142
1300
  }).strict(),
@@ -1154,18 +1312,18 @@ var solAgoraPjObject = zod.z.object({
1154
1312
  cellphone: phoneBRSchema,
1155
1313
  city: textField(),
1156
1314
  email: emailSchema,
1157
- state: textField(2),
1315
+ state: UfEnum,
1158
1316
  birth_date: birthDateSchema,
1159
1317
  civil_status: textField(),
1160
1318
  sex: SexEnum,
1161
1319
  type_doc: DocumentTypeEnum,
1162
1320
  doc: textField(),
1163
- doc_issuance_uf: textField(2),
1321
+ doc_issuance_uf: UfEnum,
1164
1322
  doc_issue_date: issueDateSchema,
1165
1323
  doc_expiration_date: dateDMYSchema,
1166
1324
  mother_name: textField(),
1167
1325
  naturalness: textField(),
1168
- uf_naturalness: textField(2),
1326
+ uf_naturalness: UfEnum,
1169
1327
  nationality: textField()
1170
1328
  }).strict()
1171
1329
  )
@@ -1186,7 +1344,7 @@ var solfacilPfObject = zod.z.object({
1186
1344
  energy_account_in_requester_name: textField(),
1187
1345
  city: textField(),
1188
1346
  energy_bill_owner_document: cpfCnpjSchema.optional(),
1189
- state: textField(2),
1347
+ state: UfEnum,
1190
1348
  nationality: textField(),
1191
1349
  cellphone: phoneBRSchema,
1192
1350
  email: emailSchema,
@@ -1213,7 +1371,7 @@ var solfacilPjObject = zod.z.object({
1213
1371
  district: textField(),
1214
1372
  legal_nature: textField(),
1215
1373
  city: textField(),
1216
- state: textField(2)
1374
+ state: UfEnum
1217
1375
  }).strict(),
1218
1376
  financing_company_guarantor: zod.z.array(
1219
1377
  zod.z.object({
@@ -1230,12 +1388,12 @@ var solfacilPjObject = zod.z.object({
1230
1388
  district: textField(),
1231
1389
  sex: SexEnum,
1232
1390
  city: textField(),
1233
- state: textField(2),
1391
+ state: UfEnum,
1234
1392
  civil_status: textField(),
1235
1393
  office: textField(),
1236
1394
  doc: textField(),
1237
1395
  issuing_body: textField(),
1238
- uf_issuing_body: textField(2),
1396
+ uf_issuing_body: UfEnum,
1239
1397
  doc_issue_date: issueDateSchema,
1240
1398
  mother_name: textField(),
1241
1399
  monthly_income: currencySchema,
@@ -1246,7 +1404,6 @@ var solfacilPjObject = zod.z.object({
1246
1404
  });
1247
1405
  var solfacilPjSchema = solfacilPjObject.strict().superRefine(applyPjRefinements);
1248
1406
  var unifiedPfObject = zod.z.object({
1249
- ...formalizationExtras,
1250
1407
  name: textField(),
1251
1408
  cep: cepSchema,
1252
1409
  cpf: cpfSchema,
@@ -1260,7 +1417,7 @@ var unifiedPfObject = zod.z.object({
1260
1417
  energy_account_in_requester_name: textField(),
1261
1418
  city: textField(),
1262
1419
  energy_bill_owner_document: cpfCnpjSchema.optional(),
1263
- state: textField(2),
1420
+ state: UfEnum,
1264
1421
  nationality: textField(),
1265
1422
  cellphone: phoneBRSchema,
1266
1423
  email: emailSchema,
@@ -1270,18 +1427,27 @@ var unifiedPfObject = zod.z.object({
1270
1427
  doc: textField(15),
1271
1428
  issuing_body: textField(6),
1272
1429
  doc_issue_date: issueDateSchema,
1273
- residence_situation: textField().optional(),
1430
+ residence_situation: ResidenceTypeEnum,
1274
1431
  months_in_residence: integerField.optional(),
1275
- is_installation_at_requester: textField().optional(),
1276
- civil_status: textField().optional(),
1277
- uf_naturalness: textField(2).optional(),
1432
+ civil_status: CivilStatusEnum,
1433
+ uf_naturalness: UfEnum,
1278
1434
  naturalness: textField().optional(),
1279
- nature_of_occupation: textField().optional(),
1435
+ nature_of_occupation: NatureOfOccupationTypeEnum,
1280
1436
  company_time: numberField.optional(),
1281
1437
  cnpj_proprietary: cnpjSchema.optional(),
1282
1438
  equity_value: currencySchema.optional(),
1283
- emitting_state: textField(2).optional(),
1284
- pep_relationship: textField().optional()
1439
+ emitting_state: UfEnum,
1440
+ pep_relationship: YesOrNoEnum,
1441
+ social_name: textField().optional(),
1442
+ partner_name: textField().optional(),
1443
+ partner_birth: dateDMYSchema.optional(),
1444
+ partner_type_doc: DocumentTypeEnum.optional(),
1445
+ partner_doc: textField().optional(),
1446
+ partner_cpf: cpfSchema.optional(),
1447
+ partner_city: textField().optional(),
1448
+ communion_regime: CommunionRegimeEnum.optional(),
1449
+ rural_area: textField(3).optional(),
1450
+ ...formalizationExtras
1285
1451
  });
1286
1452
  var unifiedPfSchema = unifiedPfObject.strict().superRefine(applyPfRefinements);
1287
1453
  var unifiedPjObject = zod.z.object({
@@ -1298,7 +1464,7 @@ var unifiedPjObject = zod.z.object({
1298
1464
  district: textField(),
1299
1465
  legal_nature: textField(),
1300
1466
  city: textField(),
1301
- state: textField(2),
1467
+ state: UfEnum,
1302
1468
  cep: cepSchema,
1303
1469
  economic_activity: textField().optional(),
1304
1470
  economic_activity_group: textField().optional(),
@@ -1321,7 +1487,7 @@ var unifiedPjObject = zod.z.object({
1321
1487
  district: textField(),
1322
1488
  sex: SexEnum,
1323
1489
  city: textField(),
1324
- state: textField(2),
1490
+ state: UfEnum,
1325
1491
  mother_name: textField(),
1326
1492
  nationality: textField(),
1327
1493
  office: textField().optional(),
@@ -1332,16 +1498,16 @@ var unifiedPjObject = zod.z.object({
1332
1498
  type_doc: DocumentTypeEnum.optional(),
1333
1499
  doc: textField().optional(),
1334
1500
  issuing_body: textField().optional(),
1335
- uf_issuing_body: textField(2).optional(),
1501
+ uf_issuing_body: UfEnum.optional(),
1336
1502
  doc_issue_date: issueDateSchema.optional(),
1337
1503
  doc_expiration_date: dateDMYSchema.optional(),
1338
1504
  monthly_income: currencySchema.optional(),
1339
1505
  patrimony: currencySchema.optional(),
1340
1506
  naturalness: textField().optional(),
1341
- uf_naturalness: textField(2).optional(),
1507
+ uf_naturalness: UfEnum.optional(),
1342
1508
  pep_relationship: textField().optional(),
1343
1509
  entry_date: issueDateSchema.optional(),
1344
- doc_issuance_uf: textField(2).optional()
1510
+ doc_issuance_uf: UfEnum.optional()
1345
1511
  }).strict()
1346
1512
  ).optional(),
1347
1513
  financing_company_qsa: zod.z.array(
@@ -1358,7 +1524,7 @@ var unifiedPjObject = zod.z.object({
1358
1524
  district: textField(),
1359
1525
  sex: SexEnum,
1360
1526
  city: textField(),
1361
- state: textField(2),
1527
+ state: UfEnum,
1362
1528
  mother_name: textField(),
1363
1529
  nationality: textField(),
1364
1530
  office: textField().optional(),
@@ -1369,16 +1535,16 @@ var unifiedPjObject = zod.z.object({
1369
1535
  type_doc: DocumentTypeEnum.optional(),
1370
1536
  doc: textField().optional(),
1371
1537
  issuing_body: textField().optional(),
1372
- uf_issuing_body: textField(2).optional(),
1538
+ uf_issuing_body: UfEnum.optional(),
1373
1539
  doc_issue_date: issueDateSchema.optional(),
1374
1540
  doc_expiration_date: dateDMYSchema.optional(),
1375
1541
  monthly_income: currencySchema.optional(),
1376
1542
  patrimony: currencySchema.optional(),
1377
1543
  naturalness: textField().optional(),
1378
- uf_naturalness: textField(2).optional(),
1544
+ uf_naturalness: UfEnum.optional(),
1379
1545
  pep_relationship: textField().optional(),
1380
1546
  entry_date: issueDateSchema.optional(),
1381
- doc_issuance_uf: textField(2).optional()
1547
+ doc_issuance_uf: UfEnum.optional()
1382
1548
  }).strict()
1383
1549
  ).optional()
1384
1550
  });
@@ -1488,17 +1654,28 @@ function getFormalizationBaseSchema(bank, person, options = {}) {
1488
1654
 
1489
1655
  // src/domains/financing/formalization/uiMeta.ts
1490
1656
  var FORMALIZATION_FIELD_META = {
1491
- energy_bill_upload: { kind: "file", label: "Conta de energia", step: 1 },
1492
- account_third_party: {
1657
+ voucher_local_installation_address: {
1658
+ kind: "file",
1659
+ label: "Comprovante de endere\xE7o da instala\xE7\xE3o",
1660
+ step: 1
1661
+ },
1662
+ energy_account_in_requester_name: {
1493
1663
  kind: "select",
1494
1664
  label: "Conta em nome de terceiro?",
1495
- step: 1
1665
+ step: 1,
1666
+ placeholder: "Selecione uma op\xE7\xE3o"
1496
1667
  },
1497
- bond_document_upload: {
1668
+ proof_kinship: {
1498
1669
  kind: "file",
1499
1670
  label: "Documento de v\xEDnculo com o titular",
1500
1671
  step: 1
1501
1672
  },
1673
+ type_doc: {
1674
+ kind: "select",
1675
+ label: "Tipo de documento",
1676
+ step: 3,
1677
+ placeholder: "Selecione uma op\xE7\xE3o"
1678
+ },
1502
1679
  document_front_upload: {
1503
1680
  kind: "file",
1504
1681
  label: "Documento de identidade (frente)",
@@ -1509,87 +1686,241 @@ var FORMALIZATION_FIELD_META = {
1509
1686
  label: "Documento de identidade (verso)",
1510
1687
  step: 2
1511
1688
  },
1512
- name: { kind: "text", label: "Nome", step: 3 },
1513
- cpf: { kind: "cpf", label: "CPF", step: 3 },
1514
- birth_date: { kind: "date", label: "Data de nascimento", step: 3 },
1515
- nationality: { kind: "text", label: "Nacionalidade", step: 3 },
1516
- type_doc: { kind: "select", label: "Tipo de documento", step: 3 },
1517
- doc: { kind: "text", label: "N\xFAmero do documento", step: 3 },
1518
- issuing_body: { kind: "text", label: "\xD3rg\xE3o emissor", step: 3 },
1519
- emitting_state: { kind: "text", label: "UF emissor", step: 3 },
1520
- doc_issue_date: { kind: "date", label: "Data de expedi\xE7\xE3o", step: 3 },
1521
- email: { kind: "email", label: "E-mail", step: 3 },
1522
- cellphone: { kind: "phone", label: "Celular", step: 3 },
1523
- monthly_income: { kind: "currency", label: "Renda mensal", step: 3 },
1524
- mother_name: { kind: "text", label: "Nome da m\xE3e", step: 3 },
1525
- is_installation_at_requester: {
1689
+ name: {
1526
1690
  kind: "text",
1527
- label: "Instala\xE7\xE3o no endere\xE7o do solicitante",
1528
- step: 3
1691
+ label: "Nome",
1692
+ step: 3,
1693
+ placeholder: "Digite o nome completo"
1529
1694
  },
1530
- energy_account_in_requester_name: {
1695
+ cpf: { kind: "cpf", label: "CPF", step: 3, placeholder: "Digite o CPF" },
1696
+ birth_date: {
1697
+ kind: "date",
1698
+ label: "Data de nascimento",
1699
+ step: 3,
1700
+ placeholder: "Digite a data de nascimento"
1701
+ },
1702
+ nationality: {
1703
+ kind: "select",
1704
+ label: "Nacionalidade",
1705
+ step: 3,
1706
+ placeholder: "Selecione uma op\xE7\xE3o"
1707
+ },
1708
+ doc: {
1531
1709
  kind: "text",
1532
- label: "Conta de energia no nome do solicitante",
1533
- step: 3
1710
+ label: "N\xFAmero do documento",
1711
+ step: 3,
1712
+ placeholder: "Digite o n\xFAmero do documento"
1713
+ },
1714
+ issuing_body: {
1715
+ kind: "text",
1716
+ label: "\xD3rg\xE3o emissor",
1717
+ step: 3,
1718
+ placeholder: "Digite o \xF3rg\xE3o emissor"
1719
+ },
1720
+ emitting_state: {
1721
+ kind: "select",
1722
+ label: "UF emissor",
1723
+ step: 3,
1724
+ placeholder: "Digite a UF do emissor"
1725
+ },
1726
+ doc_issue_date: {
1727
+ kind: "date",
1728
+ label: "Data de expedi\xE7\xE3o",
1729
+ step: 3,
1730
+ placeholder: "Digite a data de expedi\xE7\xE3o"
1731
+ },
1732
+ email: {
1733
+ kind: "email",
1734
+ label: "E-mail",
1735
+ step: 3,
1736
+ placeholder: "Digite o e-mail"
1534
1737
  },
1535
- energy_bill_owner_document: {
1536
- kind: "cpfCnpj",
1537
- label: "Documento do titular da conta de energia",
1738
+ cellphone: {
1739
+ kind: "phone",
1740
+ label: "Celular",
1741
+ step: 3,
1742
+ placeholder: "Digite o celular"
1743
+ },
1744
+ monthly_income: {
1745
+ kind: "currency",
1746
+ label: "Renda mensal",
1538
1747
  step: 3
1539
1748
  },
1540
- cep: { kind: "cep", label: "CEP", step: 3 },
1541
- address: { kind: "text", label: "Endere\xE7o", step: 3 },
1542
- number: { kind: "text", label: "N\xFAmero", step: 3 },
1543
- complement: { kind: "text", label: "Complemento", step: 3 },
1544
- district: { kind: "text", label: "Bairro", step: 3 },
1545
- state: { kind: "text", label: "Estado (UF)", step: 3 },
1546
- city: { kind: "text", label: "Cidade", step: 3 },
1547
- sex: { kind: "select", label: "Sexo", step: 4 },
1548
- profession: { kind: "text", label: "Profiss\xE3o", step: 4 },
1549
- rd_re_insurance_toggle: {
1550
- kind: "toggle",
1551
- label: "Seguro prestamista (RD/RE)",
1552
- step: 4
1749
+ mother_name: {
1750
+ kind: "text",
1751
+ label: "Nome da m\xE3e",
1752
+ step: 3,
1753
+ placeholder: "Digite o nome da m\xE3e"
1553
1754
  },
1554
- nature_of_occupation: {
1755
+ // naturalness: {
1756
+ // kind: 'text',
1757
+ // label: 'Naturalidade',
1758
+ // step: 3,
1759
+ // placeholder: 'Selecione uma opção',
1760
+ // },
1761
+ uf_naturalness: {
1762
+ kind: "select",
1763
+ label: "UF de naturalidade",
1764
+ step: 3,
1765
+ placeholder: "Selecione uma op\xE7\xE3o"
1766
+ },
1767
+ cep: { kind: "cep", label: "CEP", step: 3, placeholder: "Digite o CEP" },
1768
+ address: {
1555
1769
  kind: "text",
1770
+ label: "Endere\xE7o",
1771
+ step: 3,
1772
+ placeholder: "Digite o endere\xE7o"
1773
+ },
1774
+ number: {
1775
+ kind: "text",
1776
+ label: "N\xFAmero",
1777
+ step: 3,
1778
+ placeholder: "Digite o n\xFAmero"
1779
+ },
1780
+ complement: {
1781
+ kind: "text",
1782
+ label: "Complemento",
1783
+ step: 3,
1784
+ placeholder: "Digite o complemento"
1785
+ },
1786
+ district: {
1787
+ kind: "text",
1788
+ label: "Bairro",
1789
+ step: 3,
1790
+ placeholder: "Digite o bairro"
1791
+ },
1792
+ state: {
1793
+ kind: "select",
1794
+ label: "Estado (UF)",
1795
+ step: 3,
1796
+ placeholder: "Selecione uma op\xE7\xE3o"
1797
+ },
1798
+ city: {
1799
+ kind: "text",
1800
+ label: "Cidade",
1801
+ step: 3,
1802
+ placeholder: "Informe a cidade"
1803
+ },
1804
+ sex: {
1805
+ kind: "select",
1806
+ label: "Sexo",
1807
+ step: 4,
1808
+ placeholder: "Selecione uma op\xE7\xE3o"
1809
+ },
1810
+ profession: {
1811
+ kind: "select",
1812
+ label: "Profiss\xE3o",
1813
+ step: 4,
1814
+ placeholder: "Selecione uma op\xE7\xE3o"
1815
+ },
1816
+ nature_of_occupation: {
1817
+ kind: "select",
1556
1818
  label: "Natureza da ocupa\xE7\xE3o",
1557
- step: 4
1819
+ step: 4,
1820
+ placeholder: "Selecione uma op\xE7\xE3o"
1821
+ },
1822
+ cnpj_proprietary: {
1823
+ kind: "cnpj",
1824
+ label: "CNPJ do propriet\xE1rio",
1825
+ step: 4,
1826
+ placeholder: "Digite o CNPJ do propriet\xE1rio"
1558
1827
  },
1559
- cnpj_proprietary: { kind: "cnpj", label: "CNPJ do propriet\xE1rio", step: 4 },
1560
1828
  equity_value: { kind: "currency", label: "Patrim\xF4nio", step: 4 },
1561
- civil_status: { kind: "text", label: "Estado civil", step: 4 },
1562
- naturalness: { kind: "text", label: "Naturalidade", step: 4 },
1563
- uf_naturalness: { kind: "text", label: "UF de naturalidade", step: 4 },
1564
- company_time: { kind: "number", label: "Tempo de empresa (meses)", step: 4 },
1565
- pep_relationship: { kind: "text", label: "Rela\xE7\xE3o com PEP", step: 4 },
1829
+ civil_status: {
1830
+ kind: "select",
1831
+ label: "Estado civil",
1832
+ step: 4,
1833
+ placeholder: "Selecione uma op\xE7\xE3o"
1834
+ },
1835
+ company_time: {
1836
+ kind: "number",
1837
+ label: "Tempo de empresa (meses)",
1838
+ step: 4,
1839
+ placeholder: "Digite o tempo de empresa em meses"
1840
+ },
1841
+ pep_relationship: {
1842
+ kind: "select",
1843
+ label: "Rela\xE7\xE3o com PEP",
1844
+ step: 4,
1845
+ placeholder: "Selecione uma op\xE7\xE3o"
1846
+ },
1566
1847
  residence_situation: {
1567
- kind: "text",
1848
+ kind: "select",
1568
1849
  label: "Situa\xE7\xE3o da resid\xEAncia",
1569
- step: 4
1850
+ step: 4,
1851
+ placeholder: "Selecione uma op\xE7\xE3o"
1570
1852
  },
1571
1853
  months_in_residence: {
1572
1854
  kind: "integer",
1573
1855
  label: "Tempo de resid\xEAncia (meses)",
1574
- step: 4
1856
+ step: 4,
1857
+ placeholder: "Digite o tempo de resid\xEAncia em meses"
1575
1858
  },
1576
- financing_company: { kind: "group", label: "Dados da empresa", step: 3 },
1577
- financing_company_guarantor: { kind: "array", label: "Avalistas", step: 3 },
1859
+ financing_company: { kind: "group", label: "Dados da empresa", step: 4 },
1860
+ financing_company_guarantor: { kind: "array", label: "Avalistas", step: 4 },
1578
1861
  financing_company_qsa: {
1579
1862
  kind: "array",
1580
1863
  label: "Quadro societ\xE1rio (QSA)",
1581
- step: 3
1864
+ step: 4,
1865
+ placeholder: "Selecione uma op\xE7\xE3o"
1866
+ },
1867
+ social_name: { kind: "text", label: "Nome social", step: 4 },
1868
+ partner_name: { kind: "text", label: "Nome do c\xF4njuge", step: 4 },
1869
+ partner_birth: {
1870
+ kind: "date",
1871
+ label: "Data de nascimento do c\xF4njuge",
1872
+ step: 4,
1873
+ placeholder: "Digite a data de nascimento do c\xF4njuge"
1874
+ },
1875
+ partner_type_doc: {
1876
+ kind: "select",
1877
+ label: "Tipo de documento do c\xF4njuge",
1878
+ step: 4,
1879
+ placeholder: "Selecione uma op\xE7\xE3o"
1880
+ },
1881
+ partner_doc: {
1882
+ kind: "text",
1883
+ label: "Documento do c\xF4njuge",
1884
+ step: 4,
1885
+ placeholder: "Digite o documento do c\xF4njuge"
1886
+ },
1887
+ partner_cpf: {
1888
+ kind: "cpf",
1889
+ label: "CPF do c\xF4njuge",
1890
+ step: 4,
1891
+ placeholder: "Digite o CPF do c\xF4njuge"
1892
+ },
1893
+ partner_city: {
1894
+ kind: "text",
1895
+ label: "Cidade do c\xF4njuge",
1896
+ step: 4,
1897
+ placeholder: "Digite a cidade do c\xF4njuge"
1898
+ },
1899
+ communion_regime: {
1900
+ kind: "select",
1901
+ label: "Regime de comunh\xE3o",
1902
+ step: 4,
1903
+ placeholder: "Selecione uma op\xE7\xE3o"
1904
+ },
1905
+ rd_re_insurance_toggle: {
1906
+ kind: "toggle",
1907
+ label: "Seguro prestamista (RD/RE)",
1908
+ step: 4
1582
1909
  }
1583
1910
  };
1584
1911
 
1585
1912
  exports.BANK_SLUGS = BANK_SLUGS;
1586
1913
  exports.BankEnum = BankEnum;
1914
+ exports.CIVIL_STATUS_REQUIRING_PARTNER = CIVIL_STATUS_REQUIRING_PARTNER;
1587
1915
  exports.FORMALIZATION_FIELD_META = FORMALIZATION_FIELD_META;
1916
+ exports.FORMALIZATION_OPTION_LABELS = FORMALIZATION_OPTION_LABELS;
1588
1917
  exports.NATIONALITY_BRAZIL = NATIONALITY_BRAZIL;
1589
1918
  exports.OCCUPATIONS_REQUIRING_CNPJ = OCCUPATIONS_REQUIRING_CNPJ;
1919
+ exports.PARTNER_FIELDS = PARTNER_FIELDS;
1590
1920
  exports.UNIFIED_SLUG = UNIFIED_SLUG;
1591
1921
  exports.applyPfRefinements = applyPfRefinements;
1592
1922
  exports.applyPjRefinements = applyPjRefinements;
1923
+ exports.getFieldOptions = getFieldOptions;
1593
1924
  exports.getFormalizationBaseSchema = getFormalizationBaseSchema;
1594
1925
  exports.getFormalizationSchema = getFormalizationSchema;
1595
1926
  exports.pfBaseSchemaRegistry = pfBaseSchemaRegistry;