@77sol-ui/form-schemas 1.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 (50) hide show
  1. package/README.md +166 -0
  2. package/package.json +61 -0
  3. package/src/domains/financing/enums/banks.ts +22 -0
  4. package/src/domains/financing/enums/index.ts +2 -0
  5. package/src/domains/financing/enums/occupation.ts +2 -0
  6. package/src/domains/financing/formalization/extras.ts +21 -0
  7. package/src/domains/financing/formalization/index.ts +16 -0
  8. package/src/domains/financing/formalization/refinements.ts +70 -0
  9. package/src/domains/financing/formalization/registry.ts +114 -0
  10. package/src/domains/financing/formalization/schemas/AlfaPFSchema.ts +46 -0
  11. package/src/domains/financing/formalization/schemas/AlfaPJSchema.ts +65 -0
  12. package/src/domains/financing/formalization/schemas/BancoDoBrasilPFSchema.ts +46 -0
  13. package/src/domains/financing/formalization/schemas/BancoDoBrasilPJSchema.ts +65 -0
  14. package/src/domains/financing/formalization/schemas/BtgPFSchema.ts +46 -0
  15. package/src/domains/financing/formalization/schemas/BtgPJSchema.ts +77 -0
  16. package/src/domains/financing/formalization/schemas/BvPFSchema.ts +59 -0
  17. package/src/domains/financing/formalization/schemas/BvPJSchema.ts +84 -0
  18. package/src/domains/financing/formalization/schemas/CaixaEconomicaFederalPFSchema.ts +48 -0
  19. package/src/domains/financing/formalization/schemas/CaixaEconomicaFederalPJSchema.ts +67 -0
  20. package/src/domains/financing/formalization/schemas/CashMePFSchema.ts +46 -0
  21. package/src/domains/financing/formalization/schemas/CashMePJSchema.ts +65 -0
  22. package/src/domains/financing/formalization/schemas/Credito77PFSchema.ts +46 -0
  23. package/src/domains/financing/formalization/schemas/Credito77PJSchema.ts +65 -0
  24. package/src/domains/financing/formalization/schemas/EosPFSchema.ts +46 -0
  25. package/src/domains/financing/formalization/schemas/EosPJSchema.ts +65 -0
  26. package/src/domains/financing/formalization/schemas/HdtEnergyPFSchema.ts +46 -0
  27. package/src/domains/financing/formalization/schemas/HdtEnergyPJSchema.ts +65 -0
  28. package/src/domains/financing/formalization/schemas/LosangoPFSchema.ts +46 -0
  29. package/src/domains/financing/formalization/schemas/LosangoPJSchema.ts +65 -0
  30. package/src/domains/financing/formalization/schemas/SafraPFSchema.ts +46 -0
  31. package/src/domains/financing/formalization/schemas/SafraPJSchema.ts +65 -0
  32. package/src/domains/financing/formalization/schemas/SantanderPFSchema.ts +46 -0
  33. package/src/domains/financing/formalization/schemas/SantanderPJSchema.ts +65 -0
  34. package/src/domains/financing/formalization/schemas/SolAgoraPFSchema.ts +46 -0
  35. package/src/domains/financing/formalization/schemas/SolAgoraPJSchema.ts +75 -0
  36. package/src/domains/financing/formalization/schemas/SolfacilPFSchema.ts +46 -0
  37. package/src/domains/financing/formalization/schemas/SolfacilPJSchema.ts +70 -0
  38. package/src/domains/financing/formalization/uiMeta.ts +122 -0
  39. package/src/domains/financing/index.ts +1 -0
  40. package/src/index.ts +1 -0
  41. package/src/shared/enums/document-type.ts +4 -0
  42. package/src/shared/enums/index.ts +3 -0
  43. package/src/shared/enums/nationality.ts +2 -0
  44. package/src/shared/enums/sex.ts +4 -0
  45. package/src/shared/fields/index.ts +1 -0
  46. package/src/shared/fields/primitives.ts +32 -0
  47. package/src/shared/regex/index.ts +75 -0
  48. package/src/shared/regex/patterns.ts +15 -0
  49. package/src/shared/regex/validators.spec.ts +162 -0
  50. package/src/shared/regex/validators.ts +96 -0
@@ -0,0 +1,46 @@
1
+ import { z } from 'zod'
2
+ import { DocumentTypeEnum, SexEnum } from '../../../../shared/enums'
3
+ import { textField } from '../../../../shared/fields/primitives'
4
+ import {
5
+ birthDateSchema,
6
+ cepSchema,
7
+ cpfCnpjSchema,
8
+ cpfSchema,
9
+ currencySchema,
10
+ emailSchema,
11
+ issueDateSchema,
12
+ phoneBRSchema,
13
+ } from '../../../../shared/regex'
14
+ import { formalizationExtras } from '../extras'
15
+ import { applyPfRefinements } from '../refinements'
16
+
17
+ export const eosPfObject = z.object({
18
+ ...formalizationExtras,
19
+ name: textField(),
20
+ cep: cepSchema,
21
+ cpf: cpfSchema,
22
+ address: textField(),
23
+ birth_date: birthDateSchema,
24
+ number: textField(),
25
+ sex: SexEnum,
26
+ complement: textField(15).optional(),
27
+ mother_name: textField(),
28
+ district: textField(),
29
+ energy_account_in_requester_name: textField(),
30
+ city: textField(),
31
+ energy_bill_owner_document: cpfCnpjSchema.optional(),
32
+ state: textField(2),
33
+ nationality: textField(),
34
+ cellphone: phoneBRSchema,
35
+ email: emailSchema,
36
+ monthly_income: currencySchema,
37
+ profession: textField(),
38
+ type_doc: DocumentTypeEnum,
39
+ doc: textField(15),
40
+ issuing_body: textField(6),
41
+ doc_issue_date: issueDateSchema,
42
+ })
43
+
44
+ export const eosPfSchema = eosPfObject.strict().superRefine(applyPfRefinements)
45
+
46
+ export type EosPfFicha = z.infer<typeof eosPfSchema>
@@ -0,0 +1,65 @@
1
+ import { z } from 'zod'
2
+ import { SexEnum } from '../../../../shared/enums'
3
+ import { textField } from '../../../../shared/fields/primitives'
4
+ import {
5
+ birthDateSchema,
6
+ cepSchema,
7
+ cnpjSchema,
8
+ cpfSchema,
9
+ currencySchema,
10
+ emailSchema,
11
+ issueDateSchema,
12
+ phoneBRSchema,
13
+ } from '../../../../shared/regex'
14
+ import { formalizationExtras } from '../extras'
15
+ import { applyPjRefinements } from '../refinements'
16
+
17
+ export const eosPjObject = z.object({
18
+ ...formalizationExtras,
19
+ financing_company: z
20
+ .object({
21
+ corporate_name: textField(),
22
+ cep: cepSchema,
23
+ address: textField(),
24
+ foundation_date: issueDateSchema,
25
+ number: textField(),
26
+ cnpj: cnpjSchema,
27
+ email: emailSchema,
28
+ complement: textField(15).optional(),
29
+ phone: phoneBRSchema,
30
+ district: textField(),
31
+ legal_nature: textField(),
32
+ city: textField(),
33
+ economic_activity_group: textField(),
34
+ state: textField(2),
35
+ economic_activity: textField(),
36
+ monthly_income: currencySchema,
37
+ })
38
+ .strict(),
39
+ financing_company_guarantor: z.array(
40
+ z
41
+ .object({
42
+ name: textField(),
43
+ cep: cepSchema,
44
+ cpf: cpfSchema,
45
+ address: textField(),
46
+ birth_date: birthDateSchema,
47
+ number: textField(),
48
+ complement: textField(15).optional(),
49
+ cellphone: phoneBRSchema,
50
+ email: emailSchema,
51
+ district: textField(),
52
+ sex: SexEnum,
53
+ city: textField(),
54
+ state: textField(2),
55
+ office: textField(),
56
+ mother_name: textField(),
57
+ nationality: textField(),
58
+ })
59
+ .strict(),
60
+ ),
61
+ })
62
+
63
+ export const eosPjSchema = eosPjObject.strict().superRefine(applyPjRefinements)
64
+
65
+ export type EosPjFicha = z.infer<typeof eosPjSchema>
@@ -0,0 +1,46 @@
1
+ import { z } from 'zod'
2
+ import { DocumentTypeEnum, SexEnum } from '../../../../shared/enums'
3
+ import { textField } from '../../../../shared/fields/primitives'
4
+ import {
5
+ birthDateSchema,
6
+ cepSchema,
7
+ cpfCnpjSchema,
8
+ cpfSchema,
9
+ currencySchema,
10
+ emailSchema,
11
+ issueDateSchema,
12
+ phoneBRSchema,
13
+ } from '../../../../shared/regex'
14
+ import { formalizationExtras } from '../extras'
15
+ import { applyPfRefinements } from '../refinements'
16
+
17
+ export const hdtEnergyPfObject = z.object({
18
+ ...formalizationExtras,
19
+ name: textField(),
20
+ cep: cepSchema,
21
+ cpf: cpfSchema,
22
+ address: textField(),
23
+ birth_date: birthDateSchema,
24
+ number: textField(),
25
+ sex: SexEnum,
26
+ complement: textField(15).optional(),
27
+ mother_name: textField(),
28
+ district: textField(),
29
+ energy_account_in_requester_name: textField(),
30
+ city: textField(),
31
+ energy_bill_owner_document: cpfCnpjSchema.optional(),
32
+ state: textField(2),
33
+ nationality: textField(),
34
+ cellphone: phoneBRSchema,
35
+ email: emailSchema,
36
+ monthly_income: currencySchema,
37
+ profession: textField(),
38
+ type_doc: DocumentTypeEnum,
39
+ doc: textField(15),
40
+ issuing_body: textField(6),
41
+ doc_issue_date: issueDateSchema,
42
+ })
43
+
44
+ export const hdtEnergyPfSchema = hdtEnergyPfObject.strict().superRefine(applyPfRefinements)
45
+
46
+ export type HdtEnergyPfFicha = z.infer<typeof hdtEnergyPfSchema>
@@ -0,0 +1,65 @@
1
+ import { z } from 'zod'
2
+ import { SexEnum } from '../../../../shared/enums'
3
+ import { textField } from '../../../../shared/fields/primitives'
4
+ import {
5
+ birthDateSchema,
6
+ cepSchema,
7
+ cnpjSchema,
8
+ cpfSchema,
9
+ currencySchema,
10
+ emailSchema,
11
+ issueDateSchema,
12
+ phoneBRSchema,
13
+ } from '../../../../shared/regex'
14
+ import { formalizationExtras } from '../extras'
15
+ import { applyPjRefinements } from '../refinements'
16
+
17
+ export const hdtEnergyPjObject = z.object({
18
+ ...formalizationExtras,
19
+ financing_company: z
20
+ .object({
21
+ corporate_name: textField(),
22
+ cep: cepSchema,
23
+ address: textField(),
24
+ foundation_date: issueDateSchema,
25
+ number: textField(),
26
+ cnpj: cnpjSchema,
27
+ email: emailSchema,
28
+ complement: textField(15).optional(),
29
+ phone: phoneBRSchema,
30
+ district: textField(),
31
+ legal_nature: textField(),
32
+ city: textField(),
33
+ economic_activity_group: textField(),
34
+ state: textField(2),
35
+ economic_activity: textField(),
36
+ monthly_income: currencySchema,
37
+ })
38
+ .strict(),
39
+ financing_company_guarantor: z.array(
40
+ z
41
+ .object({
42
+ name: textField(),
43
+ cep: cepSchema,
44
+ cpf: cpfSchema,
45
+ address: textField(),
46
+ birth_date: birthDateSchema,
47
+ number: textField(),
48
+ complement: textField(15).optional(),
49
+ cellphone: phoneBRSchema,
50
+ email: emailSchema,
51
+ district: textField(),
52
+ sex: SexEnum,
53
+ city: textField(),
54
+ state: textField(2),
55
+ office: textField(),
56
+ mother_name: textField(),
57
+ nationality: textField(),
58
+ })
59
+ .strict(),
60
+ ),
61
+ })
62
+
63
+ export const hdtEnergyPjSchema = hdtEnergyPjObject.strict().superRefine(applyPjRefinements)
64
+
65
+ export type HdtEnergyPjFicha = z.infer<typeof hdtEnergyPjSchema>
@@ -0,0 +1,46 @@
1
+ import { z } from 'zod'
2
+ import { DocumentTypeEnum, SexEnum } from '../../../../shared/enums'
3
+ import { textField } from '../../../../shared/fields/primitives'
4
+ import {
5
+ birthDateSchema,
6
+ cepSchema,
7
+ cpfCnpjSchema,
8
+ cpfSchema,
9
+ currencySchema,
10
+ emailSchema,
11
+ issueDateSchema,
12
+ phoneBRSchema,
13
+ } from '../../../../shared/regex'
14
+ import { formalizationExtras } from '../extras'
15
+ import { applyPfRefinements } from '../refinements'
16
+
17
+ export const losangoPfObject = z.object({
18
+ ...formalizationExtras,
19
+ name: textField(),
20
+ cep: cepSchema,
21
+ cpf: cpfSchema,
22
+ address: textField(),
23
+ birth_date: birthDateSchema,
24
+ number: textField(),
25
+ sex: SexEnum,
26
+ complement: textField(15).optional(),
27
+ mother_name: textField(),
28
+ district: textField(),
29
+ energy_account_in_requester_name: textField(),
30
+ city: textField(),
31
+ energy_bill_owner_document: cpfCnpjSchema.optional(),
32
+ state: textField(2),
33
+ nationality: textField(),
34
+ cellphone: phoneBRSchema,
35
+ email: emailSchema,
36
+ monthly_income: currencySchema,
37
+ profession: textField(),
38
+ type_doc: DocumentTypeEnum,
39
+ doc: textField(15),
40
+ issuing_body: textField(6),
41
+ doc_issue_date: issueDateSchema,
42
+ })
43
+
44
+ export const losangoPfSchema = losangoPfObject.strict().superRefine(applyPfRefinements)
45
+
46
+ export type LosangoPfFicha = z.infer<typeof losangoPfSchema>
@@ -0,0 +1,65 @@
1
+ import { z } from 'zod'
2
+ import { SexEnum } from '../../../../shared/enums'
3
+ import { textField } from '../../../../shared/fields/primitives'
4
+ import {
5
+ birthDateSchema,
6
+ cepSchema,
7
+ cnpjSchema,
8
+ cpfSchema,
9
+ currencySchema,
10
+ emailSchema,
11
+ issueDateSchema,
12
+ phoneBRSchema,
13
+ } from '../../../../shared/regex'
14
+ import { formalizationExtras } from '../extras'
15
+ import { applyPjRefinements } from '../refinements'
16
+
17
+ export const losangoPjObject = z.object({
18
+ ...formalizationExtras,
19
+ financing_company: z
20
+ .object({
21
+ corporate_name: textField(),
22
+ cep: cepSchema,
23
+ address: textField(),
24
+ foundation_date: issueDateSchema,
25
+ number: textField(),
26
+ cnpj: cnpjSchema,
27
+ email: emailSchema,
28
+ complement: textField(15).optional(),
29
+ phone: phoneBRSchema,
30
+ district: textField(),
31
+ legal_nature: textField(),
32
+ city: textField(),
33
+ economic_activity_group: textField(),
34
+ state: textField(2),
35
+ economic_activity: textField(),
36
+ monthly_income: currencySchema,
37
+ })
38
+ .strict(),
39
+ financing_company_guarantor: z.array(
40
+ z
41
+ .object({
42
+ name: textField(),
43
+ cep: cepSchema,
44
+ cpf: cpfSchema,
45
+ address: textField(),
46
+ birth_date: birthDateSchema,
47
+ number: textField(),
48
+ complement: textField(15).optional(),
49
+ cellphone: phoneBRSchema,
50
+ email: emailSchema,
51
+ district: textField(),
52
+ sex: SexEnum,
53
+ city: textField(),
54
+ state: textField(2),
55
+ office: textField(),
56
+ mother_name: textField(),
57
+ nationality: textField(),
58
+ })
59
+ .strict(),
60
+ ),
61
+ })
62
+
63
+ export const losangoPjSchema = losangoPjObject.strict().superRefine(applyPjRefinements)
64
+
65
+ export type LosangoPjFicha = z.infer<typeof losangoPjSchema>
@@ -0,0 +1,46 @@
1
+ import { z } from 'zod'
2
+ import { DocumentTypeEnum, SexEnum } from '../../../../shared/enums'
3
+ import { textField } from '../../../../shared/fields/primitives'
4
+ import {
5
+ birthDateSchema,
6
+ cepSchema,
7
+ cpfCnpjSchema,
8
+ cpfSchema,
9
+ currencySchema,
10
+ emailSchema,
11
+ issueDateSchema,
12
+ phoneBRSchema,
13
+ } from '../../../../shared/regex'
14
+ import { formalizationExtras } from '../extras'
15
+ import { applyPfRefinements } from '../refinements'
16
+
17
+ export const safraPfObject = z.object({
18
+ ...formalizationExtras,
19
+ name: textField(),
20
+ cep: cepSchema,
21
+ cpf: cpfSchema,
22
+ address: textField(),
23
+ birth_date: birthDateSchema,
24
+ number: textField(),
25
+ sex: SexEnum,
26
+ complement: textField(15).optional(),
27
+ mother_name: textField(),
28
+ district: textField(),
29
+ energy_account_in_requester_name: textField(),
30
+ city: textField(),
31
+ energy_bill_owner_document: cpfCnpjSchema.optional(),
32
+ state: textField(2),
33
+ nationality: textField(),
34
+ cellphone: phoneBRSchema,
35
+ email: emailSchema,
36
+ monthly_income: currencySchema,
37
+ profession: textField(),
38
+ type_doc: DocumentTypeEnum,
39
+ doc: textField(15),
40
+ issuing_body: textField(6),
41
+ doc_issue_date: issueDateSchema,
42
+ })
43
+
44
+ export const safraPfSchema = safraPfObject.strict().superRefine(applyPfRefinements)
45
+
46
+ export type SafraPfFicha = z.infer<typeof safraPfSchema>
@@ -0,0 +1,65 @@
1
+ import { z } from 'zod'
2
+ import { SexEnum } from '../../../../shared/enums'
3
+ import { textField } from '../../../../shared/fields/primitives'
4
+ import {
5
+ birthDateSchema,
6
+ cepSchema,
7
+ cnpjSchema,
8
+ cpfSchema,
9
+ currencySchema,
10
+ emailSchema,
11
+ issueDateSchema,
12
+ phoneBRSchema,
13
+ } from '../../../../shared/regex'
14
+ import { formalizationExtras } from '../extras'
15
+ import { applyPjRefinements } from '../refinements'
16
+
17
+ export const safraPjObject = z.object({
18
+ ...formalizationExtras,
19
+ financing_company: z
20
+ .object({
21
+ corporate_name: textField(),
22
+ cep: cepSchema,
23
+ address: textField(),
24
+ foundation_date: issueDateSchema,
25
+ number: textField(),
26
+ cnpj: cnpjSchema,
27
+ email: emailSchema,
28
+ complement: textField(15).optional(),
29
+ phone: phoneBRSchema,
30
+ district: textField(),
31
+ legal_nature: textField(),
32
+ city: textField(),
33
+ economic_activity_group: textField(),
34
+ state: textField(2),
35
+ economic_activity: textField(),
36
+ monthly_income: currencySchema,
37
+ })
38
+ .strict(),
39
+ financing_company_guarantor: z.array(
40
+ z
41
+ .object({
42
+ name: textField(),
43
+ cep: cepSchema,
44
+ cpf: cpfSchema,
45
+ address: textField(),
46
+ birth_date: birthDateSchema,
47
+ number: textField(),
48
+ complement: textField(15).optional(),
49
+ cellphone: phoneBRSchema,
50
+ email: emailSchema,
51
+ district: textField(),
52
+ sex: SexEnum,
53
+ city: textField(),
54
+ state: textField(2),
55
+ office: textField(),
56
+ mother_name: textField(),
57
+ nationality: textField(),
58
+ })
59
+ .strict(),
60
+ ),
61
+ })
62
+
63
+ export const safraPjSchema = safraPjObject.strict().superRefine(applyPjRefinements)
64
+
65
+ export type SafraPjFicha = z.infer<typeof safraPjSchema>
@@ -0,0 +1,46 @@
1
+ import { z } from 'zod'
2
+ import { DocumentTypeEnum, SexEnum } from '../../../../shared/enums'
3
+ import { textField } from '../../../../shared/fields/primitives'
4
+ import {
5
+ birthDateSchema,
6
+ cepSchema,
7
+ cpfCnpjSchema,
8
+ cpfSchema,
9
+ currencySchema,
10
+ emailSchema,
11
+ issueDateSchema,
12
+ phoneBRSchema,
13
+ } from '../../../../shared/regex'
14
+ import { formalizationExtras } from '../extras'
15
+ import { applyPfRefinements } from '../refinements'
16
+
17
+ export const santanderPfObject = z.object({
18
+ ...formalizationExtras,
19
+ name: textField(),
20
+ cep: cepSchema,
21
+ cpf: cpfSchema,
22
+ address: textField(),
23
+ birth_date: birthDateSchema,
24
+ number: textField(),
25
+ sex: SexEnum,
26
+ complement: textField(15).optional(),
27
+ mother_name: textField(),
28
+ district: textField(),
29
+ energy_account_in_requester_name: textField(),
30
+ city: textField(),
31
+ energy_bill_owner_document: cpfCnpjSchema.optional(),
32
+ state: textField(2),
33
+ nationality: textField(),
34
+ cellphone: phoneBRSchema,
35
+ email: emailSchema,
36
+ monthly_income: currencySchema,
37
+ profession: textField(),
38
+ type_doc: DocumentTypeEnum,
39
+ doc: textField(15),
40
+ issuing_body: textField(6),
41
+ doc_issue_date: issueDateSchema,
42
+ })
43
+
44
+ export const santanderPfSchema = santanderPfObject.strict().superRefine(applyPfRefinements)
45
+
46
+ export type SantanderPfFicha = z.infer<typeof santanderPfSchema>
@@ -0,0 +1,65 @@
1
+ import { z } from 'zod'
2
+ import { SexEnum } from '../../../../shared/enums'
3
+ import { textField } from '../../../../shared/fields/primitives'
4
+ import {
5
+ birthDateSchema,
6
+ cepSchema,
7
+ cnpjSchema,
8
+ cpfSchema,
9
+ currencySchema,
10
+ emailSchema,
11
+ issueDateSchema,
12
+ phoneBRSchema,
13
+ } from '../../../../shared/regex'
14
+ import { formalizationExtras } from '../extras'
15
+ import { applyPjRefinements } from '../refinements'
16
+
17
+ export const santanderPjObject = z.object({
18
+ ...formalizationExtras,
19
+ financing_company: z
20
+ .object({
21
+ corporate_name: textField(),
22
+ cep: cepSchema,
23
+ address: textField(),
24
+ foundation_date: issueDateSchema,
25
+ number: textField(),
26
+ cnpj: cnpjSchema,
27
+ email: emailSchema,
28
+ complement: textField(15).optional(),
29
+ phone: phoneBRSchema,
30
+ district: textField(),
31
+ legal_nature: textField(),
32
+ city: textField(),
33
+ economic_activity_group: textField(),
34
+ state: textField(2),
35
+ economic_activity: textField(),
36
+ monthly_income: currencySchema,
37
+ })
38
+ .strict(),
39
+ financing_company_guarantor: z.array(
40
+ z
41
+ .object({
42
+ name: textField(),
43
+ cep: cepSchema,
44
+ cpf: cpfSchema,
45
+ address: textField(),
46
+ birth_date: birthDateSchema,
47
+ number: textField(),
48
+ complement: textField(15).optional(),
49
+ cellphone: phoneBRSchema,
50
+ email: emailSchema,
51
+ district: textField(),
52
+ sex: SexEnum,
53
+ city: textField(),
54
+ state: textField(2),
55
+ office: textField(),
56
+ mother_name: textField(),
57
+ nationality: textField(),
58
+ })
59
+ .strict(),
60
+ ),
61
+ })
62
+
63
+ export const santanderPjSchema = santanderPjObject.strict().superRefine(applyPjRefinements)
64
+
65
+ export type SantanderPjFicha = z.infer<typeof santanderPjSchema>
@@ -0,0 +1,46 @@
1
+ import { z } from 'zod'
2
+ import { DocumentTypeEnum, SexEnum } from '../../../../shared/enums'
3
+ import { textField } from '../../../../shared/fields/primitives'
4
+ import {
5
+ birthDateSchema,
6
+ cepSchema,
7
+ cpfCnpjSchema,
8
+ cpfSchema,
9
+ currencySchema,
10
+ emailSchema,
11
+ issueDateSchema,
12
+ phoneBRSchema,
13
+ } from '../../../../shared/regex'
14
+ import { formalizationExtras } from '../extras'
15
+ import { applyPfRefinements } from '../refinements'
16
+
17
+ export const solAgoraPfObject = z.object({
18
+ ...formalizationExtras,
19
+ name: textField(),
20
+ cep: cepSchema,
21
+ cpf: cpfSchema,
22
+ address: textField(),
23
+ birth_date: birthDateSchema,
24
+ number: textField(),
25
+ sex: SexEnum,
26
+ complement: textField(15).optional(),
27
+ mother_name: textField(),
28
+ district: textField(),
29
+ energy_account_in_requester_name: textField(),
30
+ city: textField(),
31
+ energy_bill_owner_document: cpfCnpjSchema.optional(),
32
+ state: textField(2),
33
+ nationality: textField(),
34
+ cellphone: phoneBRSchema,
35
+ email: emailSchema,
36
+ monthly_income: currencySchema,
37
+ profession: textField(),
38
+ type_doc: DocumentTypeEnum,
39
+ doc: textField(15),
40
+ issuing_body: textField(6),
41
+ doc_issue_date: issueDateSchema,
42
+ })
43
+
44
+ export const solAgoraPfSchema = solAgoraPfObject.strict().superRefine(applyPfRefinements)
45
+
46
+ export type SolAgoraPfFicha = z.infer<typeof solAgoraPfSchema>
@@ -0,0 +1,75 @@
1
+ import { z } from 'zod'
2
+ import { DocumentTypeEnum, SexEnum } from '../../../../shared/enums'
3
+ import { textField } from '../../../../shared/fields/primitives'
4
+ import {
5
+ birthDateSchema,
6
+ cepSchema,
7
+ cnpjSchema,
8
+ cpfSchema,
9
+ currencySchema,
10
+ dateDMYSchema,
11
+ emailSchema,
12
+ issueDateSchema,
13
+ phoneBRSchema,
14
+ } from '../../../../shared/regex'
15
+ import { formalizationExtras } from '../extras'
16
+ import { applyPjRefinements } from '../refinements'
17
+
18
+ export const solAgoraPjObject = z.object({
19
+ ...formalizationExtras,
20
+ financing_company: z
21
+ .object({
22
+ corporate_name: textField(),
23
+ cep: cepSchema,
24
+ address: textField(),
25
+ foundation_date: issueDateSchema,
26
+ number: textField(),
27
+ cnpj: cnpjSchema,
28
+ email: emailSchema,
29
+ complement: textField(15).optional(),
30
+ phone: phoneBRSchema,
31
+ district: textField(),
32
+ legal_nature: textField(),
33
+ city: textField(),
34
+ economic_activity_group: textField(),
35
+ state: textField(2),
36
+ economic_activity: textField(),
37
+ monthly_income: currencySchema,
38
+ })
39
+ .strict(),
40
+ financing_company_qsa: z.array(
41
+ z
42
+ .object({
43
+ cep: cepSchema,
44
+ name: textField(),
45
+ address: textField(),
46
+ cpf: cpfSchema,
47
+ number: textField(),
48
+ entry_date: issueDateSchema,
49
+ complement: textField(15).optional(),
50
+ phone: phoneBRSchema,
51
+ district: textField(),
52
+ cellphone: phoneBRSchema,
53
+ city: textField(),
54
+ email: emailSchema,
55
+ state: textField(2),
56
+ birth_date: birthDateSchema,
57
+ civil_status: textField(),
58
+ sex: SexEnum,
59
+ type_doc: DocumentTypeEnum,
60
+ doc: textField(),
61
+ doc_issuance_uf: textField(2),
62
+ doc_issue_date: issueDateSchema,
63
+ doc_expiration_date: dateDMYSchema,
64
+ mother_name: textField(),
65
+ naturalness: textField(),
66
+ uf_naturalness: textField(2),
67
+ nationality: textField(),
68
+ })
69
+ .strict(),
70
+ ),
71
+ })
72
+
73
+ export const solAgoraPjSchema = solAgoraPjObject.strict().superRefine(applyPjRefinements)
74
+
75
+ export type SolAgoraPjFicha = z.infer<typeof solAgoraPjSchema>