evo360-types 1.3.183 → 1.3.185

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 (28) hide show
  1. package/dist/apps/evo-med/people/zod-schemas.d.ts +28 -28
  2. package/dist/apps/evo-med/people/zod-schemas.js +3 -3
  3. package/dist/apps/evo-med/people/zod-schemas.ts +3 -3
  4. package/dist/types/evo-finops/common/taker.d.ts +25 -0
  5. package/dist/types/evo-finops/common/taker.js +2 -0
  6. package/dist/types/evo-finops/common/taker.ts +37 -0
  7. package/dist/types/evo-finops/common.d.ts +16 -0
  8. package/dist/types/evo-finops/common.js +2 -0
  9. package/dist/types/evo-finops/common.ts +19 -0
  10. package/dist/types/evo-finops/dic/issuer-tax-profile.d.ts +74 -0
  11. package/dist/types/evo-finops/dic/issuer-tax-profile.js +18 -0
  12. package/dist/types/evo-finops/dic/issuer-tax-profile.ts +105 -0
  13. package/dist/types/evo-finops/fb_collections.d.ts +1 -0
  14. package/dist/types/evo-finops/fb_collections.js +5 -0
  15. package/dist/types/evo-finops/fb_collections.ts +3 -0
  16. package/dist/types/evo-finops/invoices/index.d.ts +125 -0
  17. package/dist/types/evo-finops/invoices/index.js +36 -0
  18. package/dist/types/evo-finops/invoices/index.ts +185 -0
  19. package/dist/types/evo-finops/providers/asaas/asaas_provider.d.ts +76 -0
  20. package/dist/types/evo-finops/providers/asaas/asaas_provider.js +14 -0
  21. package/dist/types/evo-finops/providers/asaas/asaas_provider.ts +121 -0
  22. package/dist/types/evo-finops/providers/index.d.ts +44 -0
  23. package/dist/types/evo-finops/providers/index.js +29 -0
  24. package/dist/types/evo-finops/providers/index.ts +55 -0
  25. package/dist/types/evo-finops/providers/provider_fiscal_types.d.ts +105 -0
  26. package/dist/types/evo-finops/providers/provider_fiscal_types.js +2 -0
  27. package/dist/types/evo-finops/providers/provider_fiscal_types.ts +154 -0
  28. package/package.json +1 -1
@@ -477,8 +477,8 @@ export declare const zBloodTypeSchema: z.ZodUnion<[z.ZodEnum<["A+", "A-", "B+",
477
477
  export declare const zPatientAllergySchema: z.ZodObject<{
478
478
  code: z.ZodString;
479
479
  name: z.ZodString;
480
- ref: z.ZodAny;
481
480
  kind: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodEnum<["Food", "Drug", "Insect", "Other"]>>>>;
481
+ ref: z.ZodAny;
482
482
  severity: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodEnum<["Mild", "Moderate", "Severe", "Unknown"]>>>>;
483
483
  }, "strip", z.ZodTypeAny, {
484
484
  code: string;
@@ -499,7 +499,7 @@ export declare const zPatientChronicConditionSchema: z.ZodObject<{
499
499
  ref: z.ZodAny;
500
500
  diagnosis_date: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
501
501
  severity: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodEnum<["Mild", "Moderate", "Severe", "Unknown"]>>>>;
502
- controlled: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
502
+ controlled: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
503
503
  medications: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
504
504
  name: z.ZodString;
505
505
  dosage: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
@@ -513,33 +513,33 @@ export declare const zPatientChronicConditionSchema: z.ZodObject<{
513
513
  dosage?: string | null | undefined;
514
514
  frequency?: string | null | undefined;
515
515
  }>, "many">>>;
516
- notes: z.ZodDefault<z.ZodOptional<z.ZodString>>;
516
+ notes: z.ZodOptional<z.ZodNullable<z.ZodString>>;
517
517
  }, "strip", z.ZodTypeAny, {
518
518
  code: string;
519
519
  name: string;
520
520
  severity: "Mild" | "Moderate" | "Severe" | "Unknown" | null;
521
- controlled: boolean;
522
- notes: string;
523
521
  ref?: any;
524
522
  diagnosis_date?: Date | null | undefined;
523
+ controlled?: boolean | null | undefined;
525
524
  medications?: {
526
525
  name: string;
527
526
  dosage: string | null;
528
527
  frequency: string | null;
529
528
  }[] | null | undefined;
529
+ notes?: string | null | undefined;
530
530
  }, {
531
531
  code: string;
532
532
  name: string;
533
533
  ref?: any;
534
534
  diagnosis_date?: Date | null | undefined;
535
535
  severity?: "Mild" | "Moderate" | "Severe" | "Unknown" | null | undefined;
536
- controlled?: boolean | undefined;
536
+ controlled?: boolean | null | undefined;
537
537
  medications?: {
538
538
  name: string;
539
539
  dosage?: string | null | undefined;
540
540
  frequency?: string | null | undefined;
541
541
  }[] | null | undefined;
542
- notes?: string | undefined;
542
+ notes?: string | null | undefined;
543
543
  }>;
544
544
  export declare const zAppointmentCountersSchema: z.ZodObject<{
545
545
  statusBase: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
@@ -635,8 +635,8 @@ export declare const zPatientSchema: z.ZodObject<z.objectUtil.extendShape<z.obje
635
635
  allergies: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
636
636
  code: z.ZodString;
637
637
  name: z.ZodString;
638
- ref: z.ZodAny;
639
638
  kind: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodEnum<["Food", "Drug", "Insect", "Other"]>>>>;
639
+ ref: z.ZodAny;
640
640
  severity: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodEnum<["Mild", "Moderate", "Severe", "Unknown"]>>>>;
641
641
  }, "strip", z.ZodTypeAny, {
642
642
  code: string;
@@ -657,7 +657,7 @@ export declare const zPatientSchema: z.ZodObject<z.objectUtil.extendShape<z.obje
657
657
  ref: z.ZodAny;
658
658
  diagnosis_date: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
659
659
  severity: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodEnum<["Mild", "Moderate", "Severe", "Unknown"]>>>>;
660
- controlled: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
660
+ controlled: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
661
661
  medications: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
662
662
  name: z.ZodString;
663
663
  dosage: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
@@ -671,33 +671,33 @@ export declare const zPatientSchema: z.ZodObject<z.objectUtil.extendShape<z.obje
671
671
  dosage?: string | null | undefined;
672
672
  frequency?: string | null | undefined;
673
673
  }>, "many">>>;
674
- notes: z.ZodDefault<z.ZodOptional<z.ZodString>>;
674
+ notes: z.ZodOptional<z.ZodNullable<z.ZodString>>;
675
675
  }, "strip", z.ZodTypeAny, {
676
676
  code: string;
677
677
  name: string;
678
678
  severity: "Mild" | "Moderate" | "Severe" | "Unknown" | null;
679
- controlled: boolean;
680
- notes: string;
681
679
  ref?: any;
682
680
  diagnosis_date?: Date | null | undefined;
681
+ controlled?: boolean | null | undefined;
683
682
  medications?: {
684
683
  name: string;
685
684
  dosage: string | null;
686
685
  frequency: string | null;
687
686
  }[] | null | undefined;
687
+ notes?: string | null | undefined;
688
688
  }, {
689
689
  code: string;
690
690
  name: string;
691
691
  ref?: any;
692
692
  diagnosis_date?: Date | null | undefined;
693
693
  severity?: "Mild" | "Moderate" | "Severe" | "Unknown" | null | undefined;
694
- controlled?: boolean | undefined;
694
+ controlled?: boolean | null | undefined;
695
695
  medications?: {
696
696
  name: string;
697
697
  dosage?: string | null | undefined;
698
698
  frequency?: string | null | undefined;
699
699
  }[] | null | undefined;
700
- notes?: string | undefined;
700
+ notes?: string | null | undefined;
701
701
  }>, "many">>>;
702
702
  notes: z.ZodOptional<z.ZodNullable<z.ZodString>>;
703
703
  appointmentCounters: z.ZodOptional<z.ZodNullable<z.ZodObject<{
@@ -814,8 +814,8 @@ export declare const zPatientSchema: z.ZodObject<z.objectUtil.extendShape<z.obje
814
814
  allergies: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
815
815
  code: z.ZodString;
816
816
  name: z.ZodString;
817
- ref: z.ZodAny;
818
817
  kind: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodEnum<["Food", "Drug", "Insect", "Other"]>>>>;
818
+ ref: z.ZodAny;
819
819
  severity: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodEnum<["Mild", "Moderate", "Severe", "Unknown"]>>>>;
820
820
  }, "strip", z.ZodTypeAny, {
821
821
  code: string;
@@ -836,7 +836,7 @@ export declare const zPatientSchema: z.ZodObject<z.objectUtil.extendShape<z.obje
836
836
  ref: z.ZodAny;
837
837
  diagnosis_date: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
838
838
  severity: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodEnum<["Mild", "Moderate", "Severe", "Unknown"]>>>>;
839
- controlled: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
839
+ controlled: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
840
840
  medications: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
841
841
  name: z.ZodString;
842
842
  dosage: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
@@ -850,33 +850,33 @@ export declare const zPatientSchema: z.ZodObject<z.objectUtil.extendShape<z.obje
850
850
  dosage?: string | null | undefined;
851
851
  frequency?: string | null | undefined;
852
852
  }>, "many">>>;
853
- notes: z.ZodDefault<z.ZodOptional<z.ZodString>>;
853
+ notes: z.ZodOptional<z.ZodNullable<z.ZodString>>;
854
854
  }, "strip", z.ZodTypeAny, {
855
855
  code: string;
856
856
  name: string;
857
857
  severity: "Mild" | "Moderate" | "Severe" | "Unknown" | null;
858
- controlled: boolean;
859
- notes: string;
860
858
  ref?: any;
861
859
  diagnosis_date?: Date | null | undefined;
860
+ controlled?: boolean | null | undefined;
862
861
  medications?: {
863
862
  name: string;
864
863
  dosage: string | null;
865
864
  frequency: string | null;
866
865
  }[] | null | undefined;
866
+ notes?: string | null | undefined;
867
867
  }, {
868
868
  code: string;
869
869
  name: string;
870
870
  ref?: any;
871
871
  diagnosis_date?: Date | null | undefined;
872
872
  severity?: "Mild" | "Moderate" | "Severe" | "Unknown" | null | undefined;
873
- controlled?: boolean | undefined;
873
+ controlled?: boolean | null | undefined;
874
874
  medications?: {
875
875
  name: string;
876
876
  dosage?: string | null | undefined;
877
877
  frequency?: string | null | undefined;
878
878
  }[] | null | undefined;
879
- notes?: string | undefined;
879
+ notes?: string | null | undefined;
880
880
  }>, "many">>>;
881
881
  notes: z.ZodOptional<z.ZodNullable<z.ZodString>>;
882
882
  appointmentCounters: z.ZodOptional<z.ZodNullable<z.ZodObject<{
@@ -993,8 +993,8 @@ export declare const zPatientSchema: z.ZodObject<z.objectUtil.extendShape<z.obje
993
993
  allergies: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
994
994
  code: z.ZodString;
995
995
  name: z.ZodString;
996
- ref: z.ZodAny;
997
996
  kind: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodEnum<["Food", "Drug", "Insect", "Other"]>>>>;
997
+ ref: z.ZodAny;
998
998
  severity: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodEnum<["Mild", "Moderate", "Severe", "Unknown"]>>>>;
999
999
  }, "strip", z.ZodTypeAny, {
1000
1000
  code: string;
@@ -1015,7 +1015,7 @@ export declare const zPatientSchema: z.ZodObject<z.objectUtil.extendShape<z.obje
1015
1015
  ref: z.ZodAny;
1016
1016
  diagnosis_date: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
1017
1017
  severity: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodEnum<["Mild", "Moderate", "Severe", "Unknown"]>>>>;
1018
- controlled: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
1018
+ controlled: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
1019
1019
  medications: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
1020
1020
  name: z.ZodString;
1021
1021
  dosage: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
@@ -1029,33 +1029,33 @@ export declare const zPatientSchema: z.ZodObject<z.objectUtil.extendShape<z.obje
1029
1029
  dosage?: string | null | undefined;
1030
1030
  frequency?: string | null | undefined;
1031
1031
  }>, "many">>>;
1032
- notes: z.ZodDefault<z.ZodOptional<z.ZodString>>;
1032
+ notes: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1033
1033
  }, "strip", z.ZodTypeAny, {
1034
1034
  code: string;
1035
1035
  name: string;
1036
1036
  severity: "Mild" | "Moderate" | "Severe" | "Unknown" | null;
1037
- controlled: boolean;
1038
- notes: string;
1039
1037
  ref?: any;
1040
1038
  diagnosis_date?: Date | null | undefined;
1039
+ controlled?: boolean | null | undefined;
1041
1040
  medications?: {
1042
1041
  name: string;
1043
1042
  dosage: string | null;
1044
1043
  frequency: string | null;
1045
1044
  }[] | null | undefined;
1045
+ notes?: string | null | undefined;
1046
1046
  }, {
1047
1047
  code: string;
1048
1048
  name: string;
1049
1049
  ref?: any;
1050
1050
  diagnosis_date?: Date | null | undefined;
1051
1051
  severity?: "Mild" | "Moderate" | "Severe" | "Unknown" | null | undefined;
1052
- controlled?: boolean | undefined;
1052
+ controlled?: boolean | null | undefined;
1053
1053
  medications?: {
1054
1054
  name: string;
1055
1055
  dosage?: string | null | undefined;
1056
1056
  frequency?: string | null | undefined;
1057
1057
  }[] | null | undefined;
1058
- notes?: string | undefined;
1058
+ notes?: string | null | undefined;
1059
1059
  }>, "many">>>;
1060
1060
  notes: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1061
1061
  appointmentCounters: z.ZodOptional<z.ZodNullable<z.ZodObject<{
@@ -64,8 +64,8 @@ exports.zBloodTypeSchema = zod_1.z
64
64
  exports.zPatientAllergySchema = zod_1.z.object({
65
65
  code: zod_1.z.string().min(1).max(20),
66
66
  name: zod_1.z.string().min(1).max(255),
67
- ref: zod_1.z.any(),
68
67
  kind: zod_schemas_1.zAllergyKindSchema.nullable().optional().default("Other"),
68
+ ref: zod_1.z.any(),
69
69
  severity: zod_schemas_1.zSeveritySchema.nullable().optional().default("Unknown"),
70
70
  });
71
71
  exports.zPatientChronicConditionSchema = zod_1.z.object({
@@ -74,9 +74,9 @@ exports.zPatientChronicConditionSchema = zod_1.z.object({
74
74
  ref: zod_1.z.any(),
75
75
  diagnosis_date: zod_1.z.coerce.date().nullable().optional(),
76
76
  severity: zod_schemas_1.zSeveritySchema.nullable().optional().default("Unknown"),
77
- controlled: zod_1.z.boolean().optional().default(false),
77
+ controlled: zod_1.z.boolean().nullable().optional(),
78
78
  medications: zod_1.z.array(zod_schemas_1.zMedicationSchema).nullable().optional(),
79
- notes: zod_1.z.string().max(2048).optional().default(""),
79
+ notes: zod_1.z.string().max(2048).nullable().optional(),
80
80
  });
81
81
  // Schema para contadores de appointments (usado em Patient e Calendar)
82
82
  exports.zAppointmentCountersSchema = zod_1.z
@@ -79,8 +79,8 @@ export const zBloodTypeSchema = z
79
79
  export const zPatientAllergySchema = z.object({
80
80
  code: z.string().min(1).max(20),
81
81
  name: z.string().min(1).max(255),
82
- ref: z.any(),
83
82
  kind: zAllergyKindSchema.nullable().optional().default("Other"),
83
+ ref: z.any(),
84
84
  severity: zSeveritySchema.nullable().optional().default("Unknown"),
85
85
  });
86
86
 
@@ -90,9 +90,9 @@ export const zPatientChronicConditionSchema = z.object({
90
90
  ref: z.any(),
91
91
  diagnosis_date: z.coerce.date().nullable().optional(),
92
92
  severity: zSeveritySchema.nullable().optional().default("Unknown"),
93
- controlled: z.boolean().optional().default(false),
93
+ controlled: z.boolean().nullable().optional(),
94
94
  medications: z.array(zMedicationSchema).nullable().optional(),
95
- notes: z.string().max(2048).optional().default(""),
95
+ notes: z.string().max(2048).nullable().optional(),
96
96
  });
97
97
 
98
98
  // Schema para contadores de appointments (usado em Patient e Calendar)
@@ -0,0 +1,25 @@
1
+ import { FinopsProviderType } from "../providers";
2
+ export type InvoiceTakerType = "PF" | "PJ" | "unknown";
3
+ export interface Address {
4
+ postalCode?: string;
5
+ street?: string;
6
+ number?: string;
7
+ complement?: string;
8
+ province?: string;
9
+ city?: string;
10
+ state?: string;
11
+ country?: "BR";
12
+ }
13
+ export interface TakerTaxProfile {
14
+ type: InvoiceTakerType;
15
+ name: string;
16
+ cpfCnpj?: string;
17
+ email?: string;
18
+ phone?: string;
19
+ address?: Address;
20
+ }
21
+ export interface TakerProviderRefs {
22
+ provider_id: string;
23
+ provider_type: FinopsProviderType;
24
+ extra?: Record<string, unknown>;
25
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,37 @@
1
+ import { FinopsProviderType } from "../providers";
2
+
3
+ export type InvoiceTakerType = "PF" | "PJ" | "unknown";
4
+
5
+ export interface Address {
6
+ postalCode?: string; // digits only recommended
7
+ street?: string;
8
+ number?: string;
9
+ complement?: string;
10
+ province?: string; // neighborhood
11
+ city?: string;
12
+ state?: string; // “SP”
13
+ country?: "BR";
14
+ }
15
+
16
+ export interface TakerTaxProfile {
17
+ // Minimal data required to register/sync a customer in Asaas and issue NFSe.
18
+ type: InvoiceTakerType;
19
+
20
+ name: string;
21
+ cpfCnpj?: string; // digits only, may be required by municipality/provider
22
+
23
+ email?: string;
24
+ phone?: string;
25
+
26
+ address?: Address;
27
+ }
28
+
29
+ export interface TakerProviderRefs {
30
+ // Provider-specific references (e.g., Asaas customer id).
31
+ // Keep provider id because you can have multiple providers per tenant.
32
+ provider_id: string;
33
+ provider_type: FinopsProviderType;
34
+
35
+ // Future providers can extend here.
36
+ extra?: Record<string, unknown>;
37
+ }
@@ -0,0 +1,16 @@
1
+ export interface ProviderTrace {
2
+ provider_id: string;
3
+ account_id?: string;
4
+ correlation_id?: string;
5
+ request_id?: string;
6
+ }
7
+ export interface ProviderPayloadSnapshot {
8
+ direction: "request" | "response" | "webhook";
9
+ at: Date;
10
+ http_status?: number;
11
+ endpoint?: string;
12
+ method?: "GET" | "POST" | "PUT" | "DELETE" | "PATCH";
13
+ headers?: Record<string, string>;
14
+ body?: unknown;
15
+ raw?: string;
16
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,19 @@
1
+ // Useful for safe tracing / debugging
2
+ export interface ProviderTrace {
3
+ provider_id: string; // Provider ID
4
+ account_id?: string; // Provider subaccount id for this tenant (if you store it)
5
+ correlation_id?: string; // your internal correlation id
6
+ request_id?: string; // if provider returns anything like this
7
+ }
8
+
9
+ // For storing I/O payloads safely (redact secrets before saving)
10
+ export interface ProviderPayloadSnapshot {
11
+ direction: "request" | "response" | "webhook";
12
+ at: Date;
13
+ http_status?: number;
14
+ endpoint?: string;
15
+ method?: "GET" | "POST" | "PUT" | "DELETE" | "PATCH";
16
+ headers?: Record<string, string>; // redact tokens
17
+ body?: unknown; // consider redaction
18
+ raw?: string; // optional
19
+ }
@@ -0,0 +1,74 @@
1
+ import { IFireDoc } from "../../shared";
2
+ import { ProviderEnv } from "../providers";
3
+ import { IProviderCredentialsSecretRefs, IProviderFiscalInfoPayload, IProviderMunicipalOptionsSnapshot, IProviderRemoteRefs } from "../providers/provider_fiscal_types";
4
+ export declare enum TaxProfileSyncStateEnum {
5
+ NotConfigured = "not_configured",// nothing sent to Provider yet
6
+ Pending = "pending",// waiting sync
7
+ Synced = "synced",// ok on Provider
8
+ Error = "error"
9
+ }
10
+ export type TaxProfileSyncState = `${TaxProfileSyncStateEnum}`;
11
+ export interface IIssuerCompanyAddress {
12
+ street?: string;
13
+ number?: string;
14
+ complement?: string;
15
+ neighborhood?: string;
16
+ city?: string;
17
+ state?: string;
18
+ postal_code?: string;
19
+ country?: string;
20
+ }
21
+ export interface IIssuerCompanyIdentity {
22
+ legal_name: string;
23
+ trade_name?: string;
24
+ cnpj: string;
25
+ municipal_inscription?: string;
26
+ phone?: string;
27
+ email?: string;
28
+ address?: IIssuerCompanyAddress;
29
+ }
30
+ export declare enum IssuerTaxRegimeEnum {
31
+ SimplesNacional = "simples_nacional",
32
+ LucroPresumido = "lucro_presumido",
33
+ LucroReal = "lucro_real",
34
+ Mei = "mei",
35
+ Unknown = "unknown"
36
+ }
37
+ export type IssuerTaxRegime = `${IssuerTaxRegimeEnum}`;
38
+ export interface IIssuerMunicipalCredentialsRef {
39
+ username_ref?: string;
40
+ password_ref?: string;
41
+ certificate_ref?: string;
42
+ }
43
+ export interface IIssuerNfseConfig {
44
+ municipality_code?: string;
45
+ service_municipality?: {
46
+ city?: string;
47
+ state?: string;
48
+ code?: string;
49
+ };
50
+ tax_regime?: IssuerTaxRegime;
51
+ rps_series?: string;
52
+ rps_next_number?: number;
53
+ provider_fiscal_info_id?: string;
54
+ credentials_ref?: IIssuerMunicipalCredentialsRef;
55
+ municipal_extras?: Record<string, unknown>;
56
+ }
57
+ export interface IIssuerTaxProfile extends IFireDoc {
58
+ company: IIssuerCompanyIdentity;
59
+ nfse: IIssuerNfseConfig;
60
+ provider_id: string;
61
+ provider_env: ProviderEnv;
62
+ provider_municipal_options_snapshot: IProviderMunicipalOptionsSnapshot;
63
+ provider_fiscal_info: IProviderFiscalInfoPayload;
64
+ provider_credentials_secret_refs: IProviderCredentialsSecretRefs;
65
+ provider_remote_refs: IProviderRemoteRefs;
66
+ sync_state: TaxProfileSyncState;
67
+ last_sync_at?: string;
68
+ last_sync_error?: {
69
+ message: string;
70
+ code?: string;
71
+ details?: unknown;
72
+ };
73
+ [key: string]: unknown;
74
+ }
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.IssuerTaxRegimeEnum = exports.TaxProfileSyncStateEnum = void 0;
4
+ var TaxProfileSyncStateEnum;
5
+ (function (TaxProfileSyncStateEnum) {
6
+ TaxProfileSyncStateEnum["NotConfigured"] = "not_configured";
7
+ TaxProfileSyncStateEnum["Pending"] = "pending";
8
+ TaxProfileSyncStateEnum["Synced"] = "synced";
9
+ TaxProfileSyncStateEnum["Error"] = "error";
10
+ })(TaxProfileSyncStateEnum || (exports.TaxProfileSyncStateEnum = TaxProfileSyncStateEnum = {}));
11
+ var IssuerTaxRegimeEnum;
12
+ (function (IssuerTaxRegimeEnum) {
13
+ IssuerTaxRegimeEnum["SimplesNacional"] = "simples_nacional";
14
+ IssuerTaxRegimeEnum["LucroPresumido"] = "lucro_presumido";
15
+ IssuerTaxRegimeEnum["LucroReal"] = "lucro_real";
16
+ IssuerTaxRegimeEnum["Mei"] = "mei";
17
+ IssuerTaxRegimeEnum["Unknown"] = "unknown";
18
+ })(IssuerTaxRegimeEnum || (exports.IssuerTaxRegimeEnum = IssuerTaxRegimeEnum = {}));
@@ -0,0 +1,105 @@
1
+ import { IFireDoc } from "../../shared";
2
+ import { ProviderEnv } from "../providers";
3
+ import {
4
+ IProviderCredentialsSecretRefs,
5
+ IProviderFiscalInfoPayload,
6
+ IProviderMunicipalOptionsSnapshot,
7
+ IProviderRemoteRefs,
8
+ } from "../providers/provider_fiscal_types";
9
+
10
+ export enum TaxProfileSyncStateEnum {
11
+ NotConfigured = "not_configured", // nothing sent to Provider yet
12
+ Pending = "pending", // waiting sync
13
+ Synced = "synced", // ok on Provider
14
+ Error = "error", // last sync failed
15
+ }
16
+ export type TaxProfileSyncState = `${TaxProfileSyncStateEnum}`;
17
+
18
+ export interface IIssuerCompanyAddress {
19
+ street?: string;
20
+ number?: string;
21
+ complement?: string;
22
+ neighborhood?: string;
23
+ city?: string;
24
+ state?: string; // "SP", "RJ", etc
25
+ postal_code?: string; // digits only recommended
26
+ country?: string; // "BR"
27
+ }
28
+
29
+ export interface IIssuerCompanyIdentity {
30
+ legal_name: string; // Razão social
31
+ trade_name?: string; // Nome fantasia
32
+ cnpj: string; // digits only recommended
33
+ municipal_inscription?: string; // inscrição municipal (IM)
34
+ phone?: string;
35
+ email?: string;
36
+ address?: IIssuerCompanyAddress;
37
+ }
38
+
39
+ export enum IssuerTaxRegimeEnum {
40
+ SimplesNacional = "simples_nacional",
41
+ LucroPresumido = "lucro_presumido",
42
+ LucroReal = "lucro_real",
43
+ Mei = "mei",
44
+ Unknown = "unknown",
45
+ }
46
+
47
+ export type IssuerTaxRegime = `${IssuerTaxRegimeEnum}`;
48
+
49
+ // Credentials can exist depending on the municipality/provider requirements.
50
+ // Do NOT store plaintext passwords. Store references to secrets.
51
+ export interface IIssuerMunicipalCredentialsRef {
52
+ // Reference to where you store secrets (Vault, KMS, Secret Manager, etc.)
53
+ // Example: "gcp-secret://projects/.../secrets/..."
54
+ username_ref?: string;
55
+ password_ref?: string;
56
+ certificate_ref?: string; // if using a certificate
57
+ }
58
+
59
+ export interface IIssuerNfseConfig {
60
+ // These fields may vary by municipality; keep it generic.
61
+ municipality_code?: string; // IBGE or provider-specific
62
+ service_municipality?: {
63
+ city?: string;
64
+ state?: string;
65
+ code?: string;
66
+ };
67
+
68
+ tax_regime?: IssuerTaxRegime;
69
+
70
+ // RPS control (if relevant). Some providers handle it; still good to store.
71
+ rps_series?: string;
72
+ rps_next_number?: number;
73
+
74
+ // Provider-specific (Provider) data you might need.
75
+ provider_fiscal_info_id?: string; // if Provider returns an id for fiscal info
76
+ credentials_ref?: IIssuerMunicipalCredentialsRef;
77
+
78
+ // Extra dynamic fields needed for some municipalities.
79
+ // Keep it as a flexible object (validated by your app per municipality).
80
+ municipal_extras?: Record<string, unknown>;
81
+ }
82
+
83
+ export interface IIssuerTaxProfile extends IFireDoc {
84
+ company: IIssuerCompanyIdentity;
85
+ nfse: IIssuerNfseConfig;
86
+
87
+ provider_id: string;
88
+ provider_env: ProviderEnv; //Sandbox or Production
89
+
90
+ provider_municipal_options_snapshot: IProviderMunicipalOptionsSnapshot; //resultado do municipalOptions
91
+ provider_fiscal_info: IProviderFiscalInfoPayload; //payload que você manda para fiscalInfo
92
+ provider_credentials_secret_refs: IProviderCredentialsSecretRefs; //nada em plaintext
93
+ provider_remote_refs: IProviderRemoteRefs; //last sync etc
94
+
95
+ // Sync state with Provider API
96
+ sync_state: TaxProfileSyncState;
97
+ last_sync_at?: string;
98
+ last_sync_error?: {
99
+ message: string;
100
+ code?: string;
101
+ details?: unknown;
102
+ };
103
+
104
+ [key: string]: unknown; // index signature
105
+ }
@@ -0,0 +1 @@
1
+ export declare const EVO_FINOPS_APP = "evo-finops";
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.EVO_FINOPS_APP = void 0;
4
+ //EVO Med Application Doc
5
+ exports.EVO_FINOPS_APP = "evo-finops";
@@ -0,0 +1,3 @@
1
+ //EVO Med Application Doc
2
+ export const EVO_FINOPS_APP = "evo-finops";
3
+