@sfinges/sf-solicitud 0.0.0-stage → 0.1.1
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.
- package/README.md +100 -2
- package/fesm2022/sfinges-sf-solicitud.mjs +689 -0
- package/fesm2022/sfinges-sf-solicitud.mjs.map +1 -0
- package/index.d.ts +5 -0
- package/lib/components/application-person/application-person.component.d.ts +48 -0
- package/lib/components/debt-buyouts/debt-buyouts.component.d.ts +60 -0
- package/lib/components/line-simulator/line-simulator.component.d.ts +147 -0
- package/lib/gateways/application-person.port.d.ts +20 -0
- package/lib/models/application.models.d.ts +162 -0
- package/lib/utils/format.util.d.ts +17 -0
- package/package.json +28 -3
- package/public-api.d.ts +5 -0
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Modelos de una solicitud de crédito como los pintan los componentes de sf-solicitud. Los hosts los arman con lo que
|
|
3
|
+
* traen de su API (TFB, del detalle de LoanService por TFAServices; forms-ui, de los datos del formulario).
|
|
4
|
+
*/
|
|
5
|
+
/** Una persona de la solicitud (titular, codeudor…), con lo que trae la propia solicitud. */
|
|
6
|
+
export interface ApplicationParty {
|
|
7
|
+
role: string;
|
|
8
|
+
documentType?: string | null;
|
|
9
|
+
documentNumber: string;
|
|
10
|
+
name: string;
|
|
11
|
+
phone?: string | null;
|
|
12
|
+
email?: string | null;
|
|
13
|
+
age?: number | null;
|
|
14
|
+
}
|
|
15
|
+
/** Entradas de la capacidad de pago con que se simula. */
|
|
16
|
+
export interface ApplicationCapacity {
|
|
17
|
+
age: number;
|
|
18
|
+
income: number;
|
|
19
|
+
legalDeductions: number;
|
|
20
|
+
otherAffiliations: number;
|
|
21
|
+
otherDeductions: number;
|
|
22
|
+
purchasesValue: number;
|
|
23
|
+
hasGarnishment: boolean;
|
|
24
|
+
}
|
|
25
|
+
/** Lo que la solicitud tiene guardado, para compararlo con lo que se simula. */
|
|
26
|
+
export interface SavedConditions {
|
|
27
|
+
/** Código de la línea guardada; null si nunca se eligió. */
|
|
28
|
+
line?: string | null;
|
|
29
|
+
amount: number;
|
|
30
|
+
term: number;
|
|
31
|
+
/** Tasa mensual en porcentaje (1.5 = 1,5 % M.V.). */
|
|
32
|
+
rate: number;
|
|
33
|
+
totalInstallment: number;
|
|
34
|
+
charges: SavedCharge[];
|
|
35
|
+
}
|
|
36
|
+
export interface SavedCharge {
|
|
37
|
+
name: string;
|
|
38
|
+
/** Fracción en los porcentuales (0.05 = 5 %), pesos en los fijos. */
|
|
39
|
+
configuredValue: number;
|
|
40
|
+
}
|
|
41
|
+
/** Resultado del simulador comercial: capacidad común y una fila por línea. */
|
|
42
|
+
export interface CommercialSimulation {
|
|
43
|
+
minTerm?: number | null;
|
|
44
|
+
maxTerm?: number | null;
|
|
45
|
+
capacity: SimulationCapacity;
|
|
46
|
+
lines: SimulationLine[];
|
|
47
|
+
warnings: string[];
|
|
48
|
+
}
|
|
49
|
+
export interface SimulationCapacity {
|
|
50
|
+
netIncome: number;
|
|
51
|
+
payrollCapacity: number;
|
|
52
|
+
availableInstallment: number;
|
|
53
|
+
maxAmountByAge?: number | null;
|
|
54
|
+
maxAmount?: number | null;
|
|
55
|
+
}
|
|
56
|
+
export interface SimulationCharge {
|
|
57
|
+
name: string;
|
|
58
|
+
description?: string | null;
|
|
59
|
+
method?: string | null;
|
|
60
|
+
/** Fracción en los porcentuales (0.05 = 5 %), pesos en los fijos. */
|
|
61
|
+
configuredValue: number;
|
|
62
|
+
value: number;
|
|
63
|
+
includedInCapital: number;
|
|
64
|
+
}
|
|
65
|
+
export interface SimulationLine {
|
|
66
|
+
line: string;
|
|
67
|
+
lineName?: string | null;
|
|
68
|
+
term: number;
|
|
69
|
+
defaultTerm?: number | null;
|
|
70
|
+
rate: number;
|
|
71
|
+
defaultAmount: number;
|
|
72
|
+
requestedAmount?: number | null;
|
|
73
|
+
amount: number;
|
|
74
|
+
installment: number;
|
|
75
|
+
currentInstallment: number;
|
|
76
|
+
insurance: number;
|
|
77
|
+
administrativeCharges: number;
|
|
78
|
+
charges: SimulationCharge[];
|
|
79
|
+
installmentCharges: SimulationCharge[];
|
|
80
|
+
disbursement: number;
|
|
81
|
+
transfer: number;
|
|
82
|
+
viable: boolean;
|
|
83
|
+
viabilityReasons: string[];
|
|
84
|
+
error?: string | null;
|
|
85
|
+
}
|
|
86
|
+
/** Lo que la persona fijó para una línea. Solo van los cargos que editó, en la unidad del core. */
|
|
87
|
+
export interface LineTerm {
|
|
88
|
+
line: string;
|
|
89
|
+
term?: number | null;
|
|
90
|
+
amount?: number | null;
|
|
91
|
+
defaultTerm?: number | null;
|
|
92
|
+
defaultAmount?: number | null;
|
|
93
|
+
editedCharges?: Record<string, number> | null;
|
|
94
|
+
}
|
|
95
|
+
/** Lo que el simulador le pide al host que simule: la capacidad (editada, si se puede) y las líneas. */
|
|
96
|
+
export interface SimulationRequest {
|
|
97
|
+
capacity: ApplicationCapacity;
|
|
98
|
+
lines: LineTerm[];
|
|
99
|
+
}
|
|
100
|
+
/** Lo que el simulador le pide al host que guarde, ya confirmado por la persona. */
|
|
101
|
+
export interface SaveConditionsRequest {
|
|
102
|
+
line: string;
|
|
103
|
+
term: number;
|
|
104
|
+
amount?: number | null;
|
|
105
|
+
editedCharges?: Record<string, number> | null;
|
|
106
|
+
/** La capacidad con que se simuló, solo cuando la persona pudo editarla (`capacityEditable`). */
|
|
107
|
+
capacity?: ApplicationCapacity;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Una compra de cartera (PRSTMSCC) con los nombres de la tabla del formulario de compra de cartera, que son también
|
|
111
|
+
* los que devuelve LoanService: así los dos hosts la pasan tal cual.
|
|
112
|
+
*/
|
|
113
|
+
export interface DebtBuyout {
|
|
114
|
+
IdPrstmsCC: number;
|
|
115
|
+
Buro?: string | null;
|
|
116
|
+
Sector?: string | null;
|
|
117
|
+
EstadoObligacion?: string | null;
|
|
118
|
+
NitEntidad?: string | null;
|
|
119
|
+
Entidad?: string | null;
|
|
120
|
+
NumeroObligacion?: string | null;
|
|
121
|
+
ValorCuota: number;
|
|
122
|
+
SaldoActual: number;
|
|
123
|
+
SaldoMora: number;
|
|
124
|
+
Desprendible: boolean;
|
|
125
|
+
Comprar: boolean;
|
|
126
|
+
EstadoTesoreria?: string | null;
|
|
127
|
+
/** dd/MM/yyyy o yyyy-MM-dd; se muestra como yyyy-MM-dd. */
|
|
128
|
+
FechaVencimiento?: string | null;
|
|
129
|
+
}
|
|
130
|
+
/** La persona completa, ya normalizada por el host (en TFB sale del servicio de Personas). */
|
|
131
|
+
export interface ApplicationPerson {
|
|
132
|
+
firstNames?: string | null;
|
|
133
|
+
lastNames?: string | null;
|
|
134
|
+
/** F, M o el texto que traiga. */
|
|
135
|
+
gender?: string | null;
|
|
136
|
+
maritalStatus?: string | null;
|
|
137
|
+
birthPlace?: string | null;
|
|
138
|
+
/** Fecha de texto; se muestra como yyyy-MM-dd. */
|
|
139
|
+
birthDate?: string | null;
|
|
140
|
+
documentIssuePlace?: string | null;
|
|
141
|
+
documentIssueDate?: string | null;
|
|
142
|
+
contacts: PersonContact[];
|
|
143
|
+
addresses: PersonAddress[];
|
|
144
|
+
}
|
|
145
|
+
export interface PersonContact {
|
|
146
|
+
type?: string | null;
|
|
147
|
+
description?: string | null;
|
|
148
|
+
value?: string | null;
|
|
149
|
+
primary?: boolean;
|
|
150
|
+
}
|
|
151
|
+
export interface PersonAddress {
|
|
152
|
+
address?: string | null;
|
|
153
|
+
country?: string | null;
|
|
154
|
+
city?: string | null;
|
|
155
|
+
neighborhood?: string | null;
|
|
156
|
+
phone?: string | null;
|
|
157
|
+
}
|
|
158
|
+
export interface PersonAccount {
|
|
159
|
+
bank?: string | null;
|
|
160
|
+
accountType?: string | null;
|
|
161
|
+
number?: string | null;
|
|
162
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/** Locale de moneda y números de los componentes: `| currency: 'COP' : 'symbol-narrow' : '1.0-0' : 'es-CO'`. */
|
|
2
|
+
export declare const LOCALE = "es-CO";
|
|
3
|
+
/**
|
|
4
|
+
* Los hosts no registran ningún locale: cada componente registra es-CO al crearse. Va en el constructor y no en la raíz
|
|
5
|
+
* del módulo para no depender de que el bundler conserve un efecto de módulo con `sideEffects: false`.
|
|
6
|
+
*/
|
|
7
|
+
export declare function ensureLocale(): void;
|
|
8
|
+
/** Un texto apto para un id del DOM (sin espacios ni caracteres raros). */
|
|
9
|
+
export declare function safeId(value: string): string;
|
|
10
|
+
/**
|
|
11
|
+
* Una fecha de texto en el formato de los fronts (yyyy-MM-dd). Entiende dd/MM/yyyy (compras de cartera), yyyy/MM/dd y
|
|
12
|
+
* yyyy-MM-dd con o sin hora; lo que no reconoce lo devuelve tal cual, y vacío es null.
|
|
13
|
+
*/
|
|
14
|
+
export declare function toIsoDate(value: string | null | undefined): string | null;
|
|
15
|
+
export declare function round(value: number, decimals: number): number;
|
|
16
|
+
/** Dos valores de la pantalla son el mismo: números con tolerancia de medio centavo, textos sin mayúsculas. */
|
|
17
|
+
export declare function sameValue(a: number | string, b: number | string): boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,31 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sfinges/sf-solicitud",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"description": "Vista de una solicitud de crédito para los fronts de TECFIAPP: persona, simulador comercial por línea y compras de cartera.",
|
|
5
|
+
"peerDependencies": {
|
|
6
|
+
"@angular/common": "^19.2.0",
|
|
7
|
+
"@angular/core": "^19.2.0",
|
|
8
|
+
"@angular/forms": "^19.2.0",
|
|
9
|
+
"primeng": "^19.1.4",
|
|
10
|
+
"primeicons": "^7.0.0",
|
|
11
|
+
"rxjs": "^7.8.0"
|
|
12
|
+
},
|
|
13
|
+
"dependencies": {
|
|
14
|
+
"tslib": "^2.3.0"
|
|
15
|
+
},
|
|
16
|
+
"publishConfig": {
|
|
17
|
+
"access": "public"
|
|
18
|
+
},
|
|
19
|
+
"sideEffects": false,
|
|
20
|
+
"module": "fesm2022/sfinges-sf-solicitud.mjs",
|
|
21
|
+
"typings": "index.d.ts",
|
|
22
|
+
"exports": {
|
|
23
|
+
"./package.json": {
|
|
24
|
+
"default": "./package.json"
|
|
25
|
+
},
|
|
26
|
+
".": {
|
|
27
|
+
"types": "./index.d.ts",
|
|
28
|
+
"default": "./fesm2022/sfinges-sf-solicitud.mjs"
|
|
29
|
+
}
|
|
30
|
+
}
|
|
6
31
|
}
|
package/public-api.d.ts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export * from './lib/models/application.models';
|
|
2
|
+
export * from './lib/gateways/application-person.port';
|
|
3
|
+
export * from './lib/components/application-person/application-person.component';
|
|
4
|
+
export * from './lib/components/line-simulator/line-simulator.component';
|
|
5
|
+
export * from './lib/components/debt-buyouts/debt-buyouts.component';
|