@nutrien-br/liborgs 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 (59) hide show
  1. package/.nvmrc +1 -0
  2. package/lib/index.d.mts +290 -0
  3. package/lib/index.d.ts +290 -0
  4. package/lib/index.js +949 -0
  5. package/lib/index.mjs +912 -0
  6. package/package.json +41 -0
  7. package/src/core/entity/CreditSourceSchema.ts +15 -0
  8. package/src/core/entity/schFinancial/CreditAnalysisResultSchema.ts +17 -0
  9. package/src/core/entity/schFinancial/CreditSourceLimitHistorySchema.ts +32 -0
  10. package/src/core/entity/schFinancial/RateRulesSchema.ts +21 -0
  11. package/src/core/entity/schFinancial/SolicitationNfSchema.ts +12 -0
  12. package/src/core/entity/schFinancial/SolicitationRateSchema.ts +23 -0
  13. package/src/core/entity/schFinancial/SolicitationRevenueSchema.ts +12 -0
  14. package/src/core/entity/schFinancial/SolicitationSchema.ts +23 -0
  15. package/src/core/entity/schOrgs/CompanySchema.ts +16 -0
  16. package/src/core/entity/schOrgs/PersonSchema.ts +24 -0
  17. package/src/index.ts +2 -0
  18. package/src/infra/config/params.ts +17 -0
  19. package/src/infra/database/Database.ts +33 -0
  20. package/src/infra/database/migrate.ts +52 -0
  21. package/src/infra/database/migrations/01_create_table_credit_source.migration.ts +49 -0
  22. package/src/infra/database/seed.ts +35 -0
  23. package/src/infra/database/seeds/01_create_seed_credit_source.seed.ts +55 -0
  24. package/src/infra/database/strategies/IDatabaseStrategy.ts +5 -0
  25. package/src/infra/database/strategies/PostgresStrategy.ts +17 -0
  26. package/src/infra/database/strategies/SqliteStrategy.ts +14 -0
  27. package/src/infra/database/umzug-migration.type.ts +9 -0
  28. package/src/infra/database/umzug.ts +30 -0
  29. package/src/infra/models/initModels.ts +58 -0
  30. package/src/infra/models/schFinancial/CreditAnalysisResult.ts +82 -0
  31. package/src/infra/models/schFinancial/CreditSource.ts +46 -0
  32. package/src/infra/models/schFinancial/CreditSourceLimitHistory.ts +91 -0
  33. package/src/infra/models/schFinancial/RateRules.ts +45 -0
  34. package/src/infra/models/schFinancial/Solicitation.ts +91 -0
  35. package/src/infra/models/schFinancial/SolicitationNf.ts +74 -0
  36. package/src/infra/models/schFinancial/SolicitationRate.ts +72 -0
  37. package/src/infra/models/schFinancial/SolicitationRevenue.ts +72 -0
  38. package/src/infra/models/schFinancial/__tests__/creditSource.spec.ts +20 -0
  39. package/src/infra/models/schFinancial/__tests__/creditSourceLimitHistory.spec.ts +37 -0
  40. package/src/infra/models/schFinancial/__tests__/rateRules.spec.ts +37 -0
  41. package/src/infra/models/schFinancial/__tests__/solicitation.spec.ts +44 -0
  42. package/src/infra/models/schOrgs/Company.ts +75 -0
  43. package/src/infra/models/schOrgs/Person.ts +107 -0
  44. package/src/infra/models/schOrgs/__tests__/company.spec.ts +20 -0
  45. package/src/infra/models/schOrgs/__tests__/person.spec.ts +41 -0
  46. package/src/utils/initMock.ts +57 -0
  47. package/src/utils/mocks/mockCompanies.ts +27 -0
  48. package/src/utils/mocks/mockCreditAnalysisResult.ts +28 -0
  49. package/src/utils/mocks/mockCreditSourceLimitHistory.ts +26 -0
  50. package/src/utils/mocks/mockCreditSources.ts +24 -0
  51. package/src/utils/mocks/mockPerson.ts +23 -0
  52. package/src/utils/mocks/mockRateRules.ts +18 -0
  53. package/src/utils/mocks/mockSolicitation.ts +9 -0
  54. package/src/utils/mocks/mockSolicitationNf.ts +11 -0
  55. package/src/utils/mocks/mockSolicitationRate.ts +11 -0
  56. package/src/utils/mocks/mockSolicitationRevenue.ts +12 -0
  57. package/tsconfig.json +29 -0
  58. package/tsup.config.js +14 -0
  59. package/vitest.config.ts +43 -0
package/.nvmrc ADDED
@@ -0,0 +1 @@
1
+ 20.19.0
@@ -0,0 +1,290 @@
1
+ import * as sequelize from 'sequelize';
2
+ import { Model, CreationOptional, NonAttribute, Sequelize } from 'sequelize';
3
+ import { z } from 'zod';
4
+
5
+ declare const CreditAnalysisResultSchema: z.ZodObject<{
6
+ careId: z.ZodOptional<z.ZodNumber>;
7
+ careExternalId: z.ZodString;
8
+ careRequestedLimit: z.ZodOptional<z.ZodNumber>;
9
+ careApprovedLimit: z.ZodOptional<z.ZodNumber>;
10
+ careDateSolicitation: z.ZodOptional<z.ZodDate>;
11
+ careResponseDate: z.ZodNullable<z.ZodOptional<z.ZodDate>>;
12
+ careResponse: z.ZodDefault<z.ZodBoolean>;
13
+ careRequestId: z.ZodString;
14
+ soliId: z.ZodNumber;
15
+ csrcId: z.ZodNumber;
16
+ }, z.core.$strip>;
17
+ type CreditAnalysisResultEntity = z.infer<typeof CreditAnalysisResultSchema>;
18
+ type CreateCreditAnalysisResultEntity = z.input<typeof CreditAnalysisResultSchema>;
19
+
20
+ declare class CreditAnalysisResult extends Model<CreditAnalysisResultEntity, CreateCreditAnalysisResultEntity> {
21
+ careId: CreationOptional<number>;
22
+ careExternalId: string;
23
+ careRequestedLimit: number | null;
24
+ careApprovedLimit: number | null;
25
+ careDateSolicitation: CreationOptional<Date>;
26
+ careResponseDate: Date | null;
27
+ careResponse: CreationOptional<boolean>;
28
+ careRequestId: string;
29
+ soliId: number;
30
+ csrcId: number;
31
+ solicitation?: NonAttribute<Solicitation>;
32
+ creditSource?: NonAttribute<CreditSource>;
33
+ init(sequelize: Sequelize): void;
34
+ associate(): void;
35
+ }
36
+
37
+ declare const CreditSourceSchema: z.ZodObject<{
38
+ csrcId: z.ZodNumber;
39
+ csrcName: z.ZodString;
40
+ csrcType: z.ZodEnum<{
41
+ PARTNER: "PARTNER";
42
+ IN_HOUSE: "IN_HOUSE";
43
+ }>;
44
+ }, z.core.$strip>;
45
+ declare const CreateCreditSourceSchema: z.ZodObject<{
46
+ csrcName: z.ZodString;
47
+ csrcType: z.ZodEnum<{
48
+ PARTNER: "PARTNER";
49
+ IN_HOUSE: "IN_HOUSE";
50
+ }>;
51
+ }, z.core.$strip>;
52
+ type CreditSourceEntity = z.infer<typeof CreditSourceSchema>;
53
+ type CreateCreditSourceEntity = z.infer<typeof CreateCreditSourceSchema>;
54
+
55
+ declare const CreditSourceLimitHistorySchema: z.ZodObject<{
56
+ cslhId: z.ZodOptional<z.ZodNumber>;
57
+ csrcId: z.ZodNumber;
58
+ persId: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
59
+ compId: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
60
+ cslhTotalLimit: z.ZodNumber;
61
+ cslhUsedLimit: z.ZodNumber;
62
+ cslhAvailableLimit: z.ZodOptional<z.ZodNumber>;
63
+ cslhReferenceDate: z.ZodCoercedDate<unknown>;
64
+ cslhCreatedAt: z.ZodOptional<z.ZodDate>;
65
+ }, z.core.$strip>;
66
+ type CreditSourceLimitHistoryEntity = z.infer<typeof CreditSourceLimitHistorySchema>;
67
+ type CreateCreditSourceLimitHistoryEntity = z.input<typeof CreditSourceLimitHistorySchema>;
68
+
69
+ declare class CreditSourceLimitHistory extends Model<CreditSourceLimitHistoryEntity, CreateCreditSourceLimitHistoryEntity> {
70
+ cslhId: CreationOptional<number>;
71
+ csrcId: number;
72
+ persId: number | null;
73
+ compId: number | null;
74
+ cslhTotalLimit: number;
75
+ cslhUsedLimit: number;
76
+ cslhAvailableLimit: CreationOptional<number>;
77
+ cslhReferenceDate: Date;
78
+ cslhCreatedAt: CreationOptional<Date>;
79
+ person?: NonAttribute<Person>;
80
+ company?: NonAttribute<Company>;
81
+ creditSource?: NonAttribute<CreditSource>;
82
+ init(sequelize: Sequelize): void;
83
+ associate(): void;
84
+ }
85
+
86
+ declare class CreditSource extends Model<CreditSourceEntity, CreateCreditSourceEntity> {
87
+ csrcId: CreationOptional<number>;
88
+ csrcName: string;
89
+ csrcType: 'PARTNER' | 'IN_HOUSE';
90
+ limitHistories?: NonAttribute<CreditSourceLimitHistory[]>;
91
+ analysisResults?: NonAttribute<CreditAnalysisResult[]>;
92
+ init(sequelize: Sequelize): void;
93
+ associate(): void;
94
+ }
95
+
96
+ declare const RateRulesSchema: z.ZodObject<{
97
+ raruId: z.ZodOptional<z.ZodNumber>;
98
+ raruVersion: z.ZodOptional<z.ZodNumber>;
99
+ raruRating: z.ZodString;
100
+ raruInHousePercentage: z.ZodNumber;
101
+ raruPartnerPercentage: z.ZodNumber;
102
+ }, z.core.$strip>;
103
+ type RateRulesEntity = z.infer<typeof RateRulesSchema>;
104
+ type CreateRateRulesEntity = z.input<typeof RateRulesSchema>;
105
+
106
+ declare class RateRules extends Model<RateRulesEntity, CreateRateRulesEntity> {
107
+ raruId: CreationOptional<number>;
108
+ raruVersion: CreationOptional<number>;
109
+ raruRating: string;
110
+ raruInHousePercentage: number;
111
+ raruPartnerPercentage: number;
112
+ init(sequelize: Sequelize): void;
113
+ associate(): void;
114
+ }
115
+
116
+ declare const SolicitationSchema: z.ZodObject<{
117
+ soliId: z.ZodOptional<z.ZodNumber>;
118
+ soliRequestedLimit: z.ZodNumber;
119
+ soliCompleted: z.ZodDefault<z.ZodBoolean>;
120
+ persId: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
121
+ compId: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
122
+ }, z.core.$strip>;
123
+ type SolicitationEntity = z.infer<typeof SolicitationSchema>;
124
+ type CreateSolicitationEntity = z.input<typeof SolicitationSchema>;
125
+
126
+ declare const SolicitationRateSchema: z.ZodObject<{
127
+ soraId: z.ZodOptional<z.ZodNumber>;
128
+ soraRating: z.ZodOptional<z.ZodString>;
129
+ soraInHousePercentage: z.ZodNumber;
130
+ soraPartnerPercentage: z.ZodNumber;
131
+ soraInHouseAllocation: z.ZodNumber;
132
+ soraPartnerAllocation: z.ZodNumber;
133
+ soliId: z.ZodNumber;
134
+ }, z.core.$strip>;
135
+ type SolicitationRateEntity = z.infer<typeof SolicitationRateSchema>;
136
+ type CreateSolicitationRateEntity = z.input<typeof SolicitationRateSchema>;
137
+
138
+ declare class SolicitationRate extends Model<SolicitationRateEntity, CreateSolicitationRateEntity> {
139
+ soraId: CreationOptional<number>;
140
+ soraRating: CreationOptional<string>;
141
+ soraInHousePercentage: number;
142
+ soraPartnerPercentage: number;
143
+ soraInHouseAllocation: number;
144
+ soraPartnerAllocation: number;
145
+ soliId: number;
146
+ solicitation?: NonAttribute<Solicitation>;
147
+ init(sequelize: Sequelize): void;
148
+ associate(): void;
149
+ }
150
+
151
+ declare const SolicitationNfSchema: z.ZodObject<{
152
+ sonfId: z.ZodOptional<z.ZodNumber>;
153
+ sonfSumNf: z.ZodOptional<z.ZodNumber>;
154
+ sonfCompleted: z.ZodDefault<z.ZodBoolean>;
155
+ sonfRequestId: z.ZodString;
156
+ soliId: z.ZodNumber;
157
+ }, z.core.$strip>;
158
+ type SolicitationNfEntity = z.infer<typeof SolicitationNfSchema>;
159
+ type CreateSolicitationNfEntity = z.input<typeof SolicitationNfSchema>;
160
+
161
+ declare class SolicitationNf extends Model<SolicitationNfEntity, CreateSolicitationNfEntity> {
162
+ sonfId: CreationOptional<number>;
163
+ sonfSumNf: number | null;
164
+ sonfCompleted: CreationOptional<boolean>;
165
+ sonfRequestId: string;
166
+ soliId: number;
167
+ solicitation?: NonAttribute<Solicitation>;
168
+ init(sequelize: Sequelize): void;
169
+ associate(): void;
170
+ }
171
+
172
+ declare class Solicitation extends Model<SolicitationEntity, CreateSolicitationEntity> {
173
+ soliId: CreationOptional<number>;
174
+ soliRequestedLimit: number;
175
+ soliCompleted: boolean;
176
+ persId: CreationOptional<number>;
177
+ compId: CreationOptional<number>;
178
+ person?: NonAttribute<Person>;
179
+ company?: NonAttribute<Company>;
180
+ rates?: NonAttribute<SolicitationRate[]>;
181
+ revenues?: NonAttribute<SolicitationRevenue[]>;
182
+ nfs?: NonAttribute<SolicitationNf[]>;
183
+ analysisResults?: NonAttribute<CreditAnalysisResult[]>;
184
+ init(sequelize: Sequelize): void;
185
+ associate(): void;
186
+ }
187
+
188
+ declare const SolicitationRevenueSchema: z.ZodObject<{
189
+ soreId: z.ZodOptional<z.ZodNumber>;
190
+ soreRevenue: z.ZodOptional<z.ZodNumber>;
191
+ soreCompleted: z.ZodDefault<z.ZodBoolean>;
192
+ soreRequestId: z.ZodString;
193
+ soliId: z.ZodNumber;
194
+ }, z.core.$strip>;
195
+ type SolicitationRevenueEntity = z.infer<typeof SolicitationRevenueSchema>;
196
+ type CreateSolicitationRevenueEntity = z.input<typeof SolicitationRevenueSchema>;
197
+
198
+ declare class SolicitationRevenue extends Model<SolicitationRevenueEntity, CreateSolicitationRevenueEntity> {
199
+ soreId: CreationOptional<number>;
200
+ soreRevenue: number | null;
201
+ soreCompleted: CreationOptional<boolean>;
202
+ soreRequestId: string;
203
+ soliId: number;
204
+ solicitation?: NonAttribute<Solicitation>;
205
+ init(sequelize: Sequelize): void;
206
+ associate(): void;
207
+ }
208
+
209
+ declare const CompanySchema: z.ZodObject<{
210
+ compId: z.ZodOptional<z.ZodNumber>;
211
+ compDes: z.ZodOptional<z.ZodNullable<z.ZodString>>;
212
+ compCorporateName: z.ZodString;
213
+ compRegistration: z.ZodOptional<z.ZodNullable<z.ZodString>>;
214
+ compUuid: z.ZodOptional<z.ZodString>;
215
+ compObs: z.ZodOptional<z.ZodNullable<z.ZodString>>;
216
+ compRegisDate: z.ZodDate;
217
+ compRegisUser: z.ZodString;
218
+ compErpRegisDate: z.ZodOptional<z.ZodDate>;
219
+ }, z.core.$strip>;
220
+ type CompanyEntity = z.infer<typeof CompanySchema>;
221
+ type CreateCompanyEntity = z.input<typeof CompanySchema>;
222
+
223
+ declare class Company extends Model<CompanyEntity, CreateCompanyEntity> {
224
+ compId: CreationOptional<number>;
225
+ compDes: CreationOptional<string>;
226
+ compCorporateName: string;
227
+ compRegistration: CreationOptional<string>;
228
+ compUuid: CreationOptional<string>;
229
+ compObs: CreationOptional<string>;
230
+ compRegisDate: Date;
231
+ compRegisUser: string;
232
+ compErpRegisDate: CreationOptional<Date>;
233
+ solicitations?: NonAttribute<Solicitation[]>;
234
+ creditLimitHistories?: NonAttribute<CreditSourceLimitHistory[]>;
235
+ init(sequelize: Sequelize): void;
236
+ associate(): void;
237
+ }
238
+
239
+ declare const PersonSchema: z.ZodObject<{
240
+ persId: z.ZodOptional<z.ZodNumber>;
241
+ persName: z.ZodString;
242
+ persSocialName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
243
+ persFirstName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
244
+ persLastName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
245
+ persBirthDate: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
246
+ persMothersName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
247
+ persFathersName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
248
+ persIndSex: z.ZodString;
249
+ persRegistration: z.ZodOptional<z.ZodNullable<z.ZodString>>;
250
+ persUuid: z.ZodOptional<z.ZodString>;
251
+ mastCod: z.ZodOptional<z.ZodNullable<z.ZodString>>;
252
+ gendCod: z.ZodOptional<z.ZodNullable<z.ZodString>>;
253
+ persObs: z.ZodOptional<z.ZodNullable<z.ZodString>>;
254
+ persRegisDate: z.ZodDate;
255
+ persRegisUser: z.ZodString;
256
+ persErpRegisDate: z.ZodOptional<z.ZodDate>;
257
+ }, z.core.$strip>;
258
+ type PersonEntity = z.infer<typeof PersonSchema>;
259
+ type CreatePersonEntity = z.input<typeof PersonSchema>;
260
+
261
+ declare class Person extends Model<PersonEntity, CreatePersonEntity> {
262
+ persId: CreationOptional<number>;
263
+ persName: string;
264
+ persSocialName: CreationOptional<string>;
265
+ persFirstName: CreationOptional<string>;
266
+ persLastName: CreationOptional<string>;
267
+ persBirthDate: CreationOptional<Date>;
268
+ persMothersName: CreationOptional<string>;
269
+ persFathersName: CreationOptional<string>;
270
+ persIndSex: string;
271
+ persRegistration: CreationOptional<string>;
272
+ persUuid: CreationOptional<string>;
273
+ mastCod: CreationOptional<string>;
274
+ gendCod: CreationOptional<string>;
275
+ persObs: CreationOptional<string>;
276
+ persRegisDate: Date;
277
+ persRegisUser: string;
278
+ persErpRegisDate: CreationOptional<Date>;
279
+ solicitations?: NonAttribute<Solicitation[]>;
280
+ creditLimitHistories?: NonAttribute<CreditSourceLimitHistory[]>;
281
+ init(sequelize: Sequelize): void;
282
+ associate(): void;
283
+ }
284
+
285
+ declare function initModels(): Promise<sequelize.Sequelize>;
286
+
287
+ declare function initMock(): Promise<void>;
288
+ declare function closeMock(): Promise<void>;
289
+
290
+ export { Company, CreditAnalysisResult, CreditSource, CreditSourceLimitHistory, Person, RateRules, Solicitation, SolicitationNf, SolicitationRate, SolicitationRevenue, closeMock, initMock, initModels };
package/lib/index.d.ts ADDED
@@ -0,0 +1,290 @@
1
+ import * as sequelize from 'sequelize';
2
+ import { Model, CreationOptional, NonAttribute, Sequelize } from 'sequelize';
3
+ import { z } from 'zod';
4
+
5
+ declare const CreditAnalysisResultSchema: z.ZodObject<{
6
+ careId: z.ZodOptional<z.ZodNumber>;
7
+ careExternalId: z.ZodString;
8
+ careRequestedLimit: z.ZodOptional<z.ZodNumber>;
9
+ careApprovedLimit: z.ZodOptional<z.ZodNumber>;
10
+ careDateSolicitation: z.ZodOptional<z.ZodDate>;
11
+ careResponseDate: z.ZodNullable<z.ZodOptional<z.ZodDate>>;
12
+ careResponse: z.ZodDefault<z.ZodBoolean>;
13
+ careRequestId: z.ZodString;
14
+ soliId: z.ZodNumber;
15
+ csrcId: z.ZodNumber;
16
+ }, z.core.$strip>;
17
+ type CreditAnalysisResultEntity = z.infer<typeof CreditAnalysisResultSchema>;
18
+ type CreateCreditAnalysisResultEntity = z.input<typeof CreditAnalysisResultSchema>;
19
+
20
+ declare class CreditAnalysisResult extends Model<CreditAnalysisResultEntity, CreateCreditAnalysisResultEntity> {
21
+ careId: CreationOptional<number>;
22
+ careExternalId: string;
23
+ careRequestedLimit: number | null;
24
+ careApprovedLimit: number | null;
25
+ careDateSolicitation: CreationOptional<Date>;
26
+ careResponseDate: Date | null;
27
+ careResponse: CreationOptional<boolean>;
28
+ careRequestId: string;
29
+ soliId: number;
30
+ csrcId: number;
31
+ solicitation?: NonAttribute<Solicitation>;
32
+ creditSource?: NonAttribute<CreditSource>;
33
+ init(sequelize: Sequelize): void;
34
+ associate(): void;
35
+ }
36
+
37
+ declare const CreditSourceSchema: z.ZodObject<{
38
+ csrcId: z.ZodNumber;
39
+ csrcName: z.ZodString;
40
+ csrcType: z.ZodEnum<{
41
+ PARTNER: "PARTNER";
42
+ IN_HOUSE: "IN_HOUSE";
43
+ }>;
44
+ }, z.core.$strip>;
45
+ declare const CreateCreditSourceSchema: z.ZodObject<{
46
+ csrcName: z.ZodString;
47
+ csrcType: z.ZodEnum<{
48
+ PARTNER: "PARTNER";
49
+ IN_HOUSE: "IN_HOUSE";
50
+ }>;
51
+ }, z.core.$strip>;
52
+ type CreditSourceEntity = z.infer<typeof CreditSourceSchema>;
53
+ type CreateCreditSourceEntity = z.infer<typeof CreateCreditSourceSchema>;
54
+
55
+ declare const CreditSourceLimitHistorySchema: z.ZodObject<{
56
+ cslhId: z.ZodOptional<z.ZodNumber>;
57
+ csrcId: z.ZodNumber;
58
+ persId: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
59
+ compId: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
60
+ cslhTotalLimit: z.ZodNumber;
61
+ cslhUsedLimit: z.ZodNumber;
62
+ cslhAvailableLimit: z.ZodOptional<z.ZodNumber>;
63
+ cslhReferenceDate: z.ZodCoercedDate<unknown>;
64
+ cslhCreatedAt: z.ZodOptional<z.ZodDate>;
65
+ }, z.core.$strip>;
66
+ type CreditSourceLimitHistoryEntity = z.infer<typeof CreditSourceLimitHistorySchema>;
67
+ type CreateCreditSourceLimitHistoryEntity = z.input<typeof CreditSourceLimitHistorySchema>;
68
+
69
+ declare class CreditSourceLimitHistory extends Model<CreditSourceLimitHistoryEntity, CreateCreditSourceLimitHistoryEntity> {
70
+ cslhId: CreationOptional<number>;
71
+ csrcId: number;
72
+ persId: number | null;
73
+ compId: number | null;
74
+ cslhTotalLimit: number;
75
+ cslhUsedLimit: number;
76
+ cslhAvailableLimit: CreationOptional<number>;
77
+ cslhReferenceDate: Date;
78
+ cslhCreatedAt: CreationOptional<Date>;
79
+ person?: NonAttribute<Person>;
80
+ company?: NonAttribute<Company>;
81
+ creditSource?: NonAttribute<CreditSource>;
82
+ init(sequelize: Sequelize): void;
83
+ associate(): void;
84
+ }
85
+
86
+ declare class CreditSource extends Model<CreditSourceEntity, CreateCreditSourceEntity> {
87
+ csrcId: CreationOptional<number>;
88
+ csrcName: string;
89
+ csrcType: 'PARTNER' | 'IN_HOUSE';
90
+ limitHistories?: NonAttribute<CreditSourceLimitHistory[]>;
91
+ analysisResults?: NonAttribute<CreditAnalysisResult[]>;
92
+ init(sequelize: Sequelize): void;
93
+ associate(): void;
94
+ }
95
+
96
+ declare const RateRulesSchema: z.ZodObject<{
97
+ raruId: z.ZodOptional<z.ZodNumber>;
98
+ raruVersion: z.ZodOptional<z.ZodNumber>;
99
+ raruRating: z.ZodString;
100
+ raruInHousePercentage: z.ZodNumber;
101
+ raruPartnerPercentage: z.ZodNumber;
102
+ }, z.core.$strip>;
103
+ type RateRulesEntity = z.infer<typeof RateRulesSchema>;
104
+ type CreateRateRulesEntity = z.input<typeof RateRulesSchema>;
105
+
106
+ declare class RateRules extends Model<RateRulesEntity, CreateRateRulesEntity> {
107
+ raruId: CreationOptional<number>;
108
+ raruVersion: CreationOptional<number>;
109
+ raruRating: string;
110
+ raruInHousePercentage: number;
111
+ raruPartnerPercentage: number;
112
+ init(sequelize: Sequelize): void;
113
+ associate(): void;
114
+ }
115
+
116
+ declare const SolicitationSchema: z.ZodObject<{
117
+ soliId: z.ZodOptional<z.ZodNumber>;
118
+ soliRequestedLimit: z.ZodNumber;
119
+ soliCompleted: z.ZodDefault<z.ZodBoolean>;
120
+ persId: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
121
+ compId: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
122
+ }, z.core.$strip>;
123
+ type SolicitationEntity = z.infer<typeof SolicitationSchema>;
124
+ type CreateSolicitationEntity = z.input<typeof SolicitationSchema>;
125
+
126
+ declare const SolicitationRateSchema: z.ZodObject<{
127
+ soraId: z.ZodOptional<z.ZodNumber>;
128
+ soraRating: z.ZodOptional<z.ZodString>;
129
+ soraInHousePercentage: z.ZodNumber;
130
+ soraPartnerPercentage: z.ZodNumber;
131
+ soraInHouseAllocation: z.ZodNumber;
132
+ soraPartnerAllocation: z.ZodNumber;
133
+ soliId: z.ZodNumber;
134
+ }, z.core.$strip>;
135
+ type SolicitationRateEntity = z.infer<typeof SolicitationRateSchema>;
136
+ type CreateSolicitationRateEntity = z.input<typeof SolicitationRateSchema>;
137
+
138
+ declare class SolicitationRate extends Model<SolicitationRateEntity, CreateSolicitationRateEntity> {
139
+ soraId: CreationOptional<number>;
140
+ soraRating: CreationOptional<string>;
141
+ soraInHousePercentage: number;
142
+ soraPartnerPercentage: number;
143
+ soraInHouseAllocation: number;
144
+ soraPartnerAllocation: number;
145
+ soliId: number;
146
+ solicitation?: NonAttribute<Solicitation>;
147
+ init(sequelize: Sequelize): void;
148
+ associate(): void;
149
+ }
150
+
151
+ declare const SolicitationNfSchema: z.ZodObject<{
152
+ sonfId: z.ZodOptional<z.ZodNumber>;
153
+ sonfSumNf: z.ZodOptional<z.ZodNumber>;
154
+ sonfCompleted: z.ZodDefault<z.ZodBoolean>;
155
+ sonfRequestId: z.ZodString;
156
+ soliId: z.ZodNumber;
157
+ }, z.core.$strip>;
158
+ type SolicitationNfEntity = z.infer<typeof SolicitationNfSchema>;
159
+ type CreateSolicitationNfEntity = z.input<typeof SolicitationNfSchema>;
160
+
161
+ declare class SolicitationNf extends Model<SolicitationNfEntity, CreateSolicitationNfEntity> {
162
+ sonfId: CreationOptional<number>;
163
+ sonfSumNf: number | null;
164
+ sonfCompleted: CreationOptional<boolean>;
165
+ sonfRequestId: string;
166
+ soliId: number;
167
+ solicitation?: NonAttribute<Solicitation>;
168
+ init(sequelize: Sequelize): void;
169
+ associate(): void;
170
+ }
171
+
172
+ declare class Solicitation extends Model<SolicitationEntity, CreateSolicitationEntity> {
173
+ soliId: CreationOptional<number>;
174
+ soliRequestedLimit: number;
175
+ soliCompleted: boolean;
176
+ persId: CreationOptional<number>;
177
+ compId: CreationOptional<number>;
178
+ person?: NonAttribute<Person>;
179
+ company?: NonAttribute<Company>;
180
+ rates?: NonAttribute<SolicitationRate[]>;
181
+ revenues?: NonAttribute<SolicitationRevenue[]>;
182
+ nfs?: NonAttribute<SolicitationNf[]>;
183
+ analysisResults?: NonAttribute<CreditAnalysisResult[]>;
184
+ init(sequelize: Sequelize): void;
185
+ associate(): void;
186
+ }
187
+
188
+ declare const SolicitationRevenueSchema: z.ZodObject<{
189
+ soreId: z.ZodOptional<z.ZodNumber>;
190
+ soreRevenue: z.ZodOptional<z.ZodNumber>;
191
+ soreCompleted: z.ZodDefault<z.ZodBoolean>;
192
+ soreRequestId: z.ZodString;
193
+ soliId: z.ZodNumber;
194
+ }, z.core.$strip>;
195
+ type SolicitationRevenueEntity = z.infer<typeof SolicitationRevenueSchema>;
196
+ type CreateSolicitationRevenueEntity = z.input<typeof SolicitationRevenueSchema>;
197
+
198
+ declare class SolicitationRevenue extends Model<SolicitationRevenueEntity, CreateSolicitationRevenueEntity> {
199
+ soreId: CreationOptional<number>;
200
+ soreRevenue: number | null;
201
+ soreCompleted: CreationOptional<boolean>;
202
+ soreRequestId: string;
203
+ soliId: number;
204
+ solicitation?: NonAttribute<Solicitation>;
205
+ init(sequelize: Sequelize): void;
206
+ associate(): void;
207
+ }
208
+
209
+ declare const CompanySchema: z.ZodObject<{
210
+ compId: z.ZodOptional<z.ZodNumber>;
211
+ compDes: z.ZodOptional<z.ZodNullable<z.ZodString>>;
212
+ compCorporateName: z.ZodString;
213
+ compRegistration: z.ZodOptional<z.ZodNullable<z.ZodString>>;
214
+ compUuid: z.ZodOptional<z.ZodString>;
215
+ compObs: z.ZodOptional<z.ZodNullable<z.ZodString>>;
216
+ compRegisDate: z.ZodDate;
217
+ compRegisUser: z.ZodString;
218
+ compErpRegisDate: z.ZodOptional<z.ZodDate>;
219
+ }, z.core.$strip>;
220
+ type CompanyEntity = z.infer<typeof CompanySchema>;
221
+ type CreateCompanyEntity = z.input<typeof CompanySchema>;
222
+
223
+ declare class Company extends Model<CompanyEntity, CreateCompanyEntity> {
224
+ compId: CreationOptional<number>;
225
+ compDes: CreationOptional<string>;
226
+ compCorporateName: string;
227
+ compRegistration: CreationOptional<string>;
228
+ compUuid: CreationOptional<string>;
229
+ compObs: CreationOptional<string>;
230
+ compRegisDate: Date;
231
+ compRegisUser: string;
232
+ compErpRegisDate: CreationOptional<Date>;
233
+ solicitations?: NonAttribute<Solicitation[]>;
234
+ creditLimitHistories?: NonAttribute<CreditSourceLimitHistory[]>;
235
+ init(sequelize: Sequelize): void;
236
+ associate(): void;
237
+ }
238
+
239
+ declare const PersonSchema: z.ZodObject<{
240
+ persId: z.ZodOptional<z.ZodNumber>;
241
+ persName: z.ZodString;
242
+ persSocialName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
243
+ persFirstName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
244
+ persLastName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
245
+ persBirthDate: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
246
+ persMothersName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
247
+ persFathersName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
248
+ persIndSex: z.ZodString;
249
+ persRegistration: z.ZodOptional<z.ZodNullable<z.ZodString>>;
250
+ persUuid: z.ZodOptional<z.ZodString>;
251
+ mastCod: z.ZodOptional<z.ZodNullable<z.ZodString>>;
252
+ gendCod: z.ZodOptional<z.ZodNullable<z.ZodString>>;
253
+ persObs: z.ZodOptional<z.ZodNullable<z.ZodString>>;
254
+ persRegisDate: z.ZodDate;
255
+ persRegisUser: z.ZodString;
256
+ persErpRegisDate: z.ZodOptional<z.ZodDate>;
257
+ }, z.core.$strip>;
258
+ type PersonEntity = z.infer<typeof PersonSchema>;
259
+ type CreatePersonEntity = z.input<typeof PersonSchema>;
260
+
261
+ declare class Person extends Model<PersonEntity, CreatePersonEntity> {
262
+ persId: CreationOptional<number>;
263
+ persName: string;
264
+ persSocialName: CreationOptional<string>;
265
+ persFirstName: CreationOptional<string>;
266
+ persLastName: CreationOptional<string>;
267
+ persBirthDate: CreationOptional<Date>;
268
+ persMothersName: CreationOptional<string>;
269
+ persFathersName: CreationOptional<string>;
270
+ persIndSex: string;
271
+ persRegistration: CreationOptional<string>;
272
+ persUuid: CreationOptional<string>;
273
+ mastCod: CreationOptional<string>;
274
+ gendCod: CreationOptional<string>;
275
+ persObs: CreationOptional<string>;
276
+ persRegisDate: Date;
277
+ persRegisUser: string;
278
+ persErpRegisDate: CreationOptional<Date>;
279
+ solicitations?: NonAttribute<Solicitation[]>;
280
+ creditLimitHistories?: NonAttribute<CreditSourceLimitHistory[]>;
281
+ init(sequelize: Sequelize): void;
282
+ associate(): void;
283
+ }
284
+
285
+ declare function initModels(): Promise<sequelize.Sequelize>;
286
+
287
+ declare function initMock(): Promise<void>;
288
+ declare function closeMock(): Promise<void>;
289
+
290
+ export { Company, CreditAnalysisResult, CreditSource, CreditSourceLimitHistory, Person, RateRules, Solicitation, SolicitationNf, SolicitationRate, SolicitationRevenue, closeMock, initMock, initModels };