creditu-common-library 1.3.1 → 1.3.4

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.
@@ -6,8 +6,7 @@ export declare class AmortizationService {
6
6
  constructor(math: MathService);
7
7
  private readonly interestService;
8
8
  private getMonthlyPayment;
9
- getAmortizationIPC(upperBound: number, amortizationDiff: number, IPCAupdate: number): number;
10
- getAmortizationDiffGerman(previousBalance: number, balance: number, numberOfMonths: number): number;
9
+ private getAmortizationDiffGerman;
11
10
  /**
12
11
  *
13
12
  * @param monthlyRate Tasa mensual del crédito
@@ -17,7 +16,7 @@ export declare class AmortizationService {
17
16
  * @param paymentNumber Número de cuota
18
17
  * @returns
19
18
  */
20
- getAmortizationDiffFrench(monthlyRate: number, numberOfMonths: number, previusBalance: number, balance: number, paymentNumber: number): number;
19
+ private getAmortizationDiffFrench;
21
20
  /**
22
21
  *
23
22
  * @param monthlyRate Tasa mensual del crédito
@@ -26,7 +25,7 @@ export declare class AmortizationService {
26
25
  * @param paymentNumber Número de cuota
27
26
  * @returns
28
27
  */
29
- getAmortizationFrench(monthlyRate: number, numberOfMonths: number, balance: number, paymentNumber: number): number;
28
+ private getAmortizationFrench;
30
29
  /**
31
30
  * Calcula la amortizacion
32
31
  * @param paymentNumber
@@ -39,4 +38,5 @@ export declare class AmortizationService {
39
38
  amortizationDiff: any;
40
39
  };
41
40
  getAmortization(amortizationIUB: number, postponedInflationaryUpdate: number, amortizationDiff: number): number;
41
+ getAmortizationIPC(upperBound: number, amortizationDiff: number, IPCAupdate: number): number;
42
42
  }
@@ -17,12 +17,6 @@ var AmortizationService = /** @class */ (function () {
17
17
  var periodRate = this.math.subtract(periodInterest, 1);
18
18
  return this.math.multiply(this.math.divide(interest, periodRate), balance);
19
19
  };
20
- AmortizationService.prototype.getAmortizationIPC = function (upperBound, amortizationDiff, IPCAupdate) {
21
- return this.math.round(upperBound < IPCAupdate
22
- ? this.math.subtract(upperBound, amortizationDiff)
23
- : this.math.subtract(IPCAupdate, amortizationDiff), 10);
24
- };
25
- // (balanceAfter - balance) / numberOfMonths
26
20
  AmortizationService.prototype.getAmortizationDiffGerman = function (previousBalance, balance, numberOfMonths) {
27
21
  return this.math.round(this.math.divide(this.math.subtract(balance, previousBalance), numberOfMonths), 10);
28
22
  };
@@ -35,8 +29,8 @@ var AmortizationService = /** @class */ (function () {
35
29
  * @param paymentNumber Número de cuota
36
30
  * @returns
37
31
  */
38
- AmortizationService.prototype.getAmortizationDiffFrench = function (monthlyRate, numberOfMonths, previusBalance, balance, paymentNumber) {
39
- var period = this.math.subtract(this.math.add(numberOfMonths, 1), paymentNumber);
32
+ AmortizationService.prototype.getAmortizationDiffFrench = function (monthlyRate, period, previusBalance, balance) {
33
+ // const period = this.math.subtract(this.math.add(numberOfMonths, 1), paymentNumber);
40
34
  var initialMonthlyPayment = this.getMonthlyPayment(monthlyRate, period, previusBalance);
41
35
  var initialInterest = this.math.multiply(previusBalance, monthlyRate);
42
36
  var initialMonthlyAmortization = this.math.subtract(initialMonthlyPayment, initialInterest);
@@ -53,8 +47,8 @@ var AmortizationService = /** @class */ (function () {
53
47
  * @param paymentNumber Número de cuota
54
48
  * @returns
55
49
  */
56
- AmortizationService.prototype.getAmortizationFrench = function (monthlyRate, numberOfMonths, balance, paymentNumber) {
57
- var period = this.math.subtract(this.math.add(numberOfMonths, 1), paymentNumber);
50
+ AmortizationService.prototype.getAmortizationFrench = function (monthlyRate, period, balance) {
51
+ // const period = this.math.subtract(this.math.add(numberOfMonths, 1), paymentNumber);
58
52
  var monthlyPayment = this.getMonthlyPayment(monthlyRate, period, balance);
59
53
  var interest = this.math.multiply(balance, monthlyRate);
60
54
  return this.math.subtract(monthlyPayment, interest);
@@ -80,20 +74,26 @@ var AmortizationService = /** @class */ (function () {
80
74
  }
81
75
  var amortizationIUB;
82
76
  var amortizationDiff;
77
+ var period = this.math.subtract(this.math.add(inputs.numberOfMonths.value(), 1), inputs.paymentNumber.value());
83
78
  if (inputs.amortizationMethod === models_1.AmortizationMethod.GERMAN) {
84
79
  amortizationIUB = this.getAmortizationGerman(inputs.paymentNumber, inputs.numberOfMonths, balance);
85
- amortizationDiff = this.getAmortizationDiffGerman(inputs.previousBalance.value(), balance, inputs.numberOfMonths.value());
80
+ amortizationDiff = this.getAmortizationDiffGerman(inputs.previousBalance.value(), balance, period);
86
81
  }
87
82
  else if (inputs.amortizationMethod === models_1.AmortizationMethod.FRENCH) {
88
83
  var monthlyRate = this.interestService.getMonthlyInterestValue(annualRate);
89
- amortizationIUB = this.getAmortizationFrench(monthlyRate, inputs.numberOfMonths.value(), balance, inputs.paymentNumber.value());
90
- amortizationDiff = this.getAmortizationDiffFrench(monthlyRate, inputs.numberOfMonths.value(), inputs.previousBalance.value(), balance, inputs.paymentNumber.value());
84
+ amortizationIUB = this.getAmortizationFrench(monthlyRate, period, balance);
85
+ amortizationDiff = this.getAmortizationDiffFrench(monthlyRate, period, inputs.previousBalance.value(), balance);
91
86
  }
92
87
  return { amortizationIUB: amortizationIUB, amortizationDiff: amortizationDiff };
93
88
  };
94
89
  AmortizationService.prototype.getAmortization = function (amortizationIUB, postponedInflationaryUpdate, amortizationDiff) {
95
90
  return this.math.subtract(amortizationIUB, postponedInflationaryUpdate, amortizationDiff);
96
91
  };
92
+ AmortizationService.prototype.getAmortizationIPC = function (upperBound, amortizationDiff, IPCAupdate) {
93
+ return this.math.round(upperBound < IPCAupdate
94
+ ? this.math.subtract(upperBound, amortizationDiff)
95
+ : this.math.subtract(IPCAupdate, amortizationDiff), 10);
96
+ };
97
97
  return AmortizationService;
98
98
  }());
99
99
  exports.AmortizationService = AmortizationService;
@@ -67,4 +67,18 @@ export declare class OfferInputs {
67
67
  * Se utiliza para aplicar o no lógico de doble cuota y setear los valores de: numberOfAnnualDoublePayments, indexOfFirstDoublePayment, indexOfSecondDoublePayment
68
68
  */
69
69
  useDoublePayments: boolean;
70
+ /**
71
+ * Estado de la propiedad
72
+ * true = Nueva
73
+ * false = Usada
74
+ */
75
+ isPropertyNew: boolean;
76
+ /**
77
+ * Distrito del cliente (Perú)
78
+ */
79
+ district: string;
80
+ /**
81
+ * Edad prospecto
82
+ */
83
+ prospectAge: number;
70
84
  }
@@ -314,7 +314,7 @@ var OfferService = /** @class */ (function () {
314
314
  // eslint-disable-next-line class-methods-use-this
315
315
  OfferService.prototype.getCreditAmountToOffer = function (approvedAmount, credituAmount, creditMinAmount, creditMaxAmount) {
316
316
  models_1.Guarder.defined(creditMinAmount, 'CreditMinAmount');
317
- var minApprovedAmount = Math.min(approvedAmount, credituAmount);
317
+ var minApprovedAmount = Math.round(Math.min(approvedAmount, credituAmount));
318
318
  if (minApprovedAmount > creditMaxAmount.value())
319
319
  return creditMaxAmount.value();
320
320
  if (minApprovedAmount < creditMinAmount.value())
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "creditu-common-library",
3
- "version": "1.3.1",
3
+ "version": "1.3.4",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "files": [
@@ -394,20 +394,20 @@ describe('installment-service for german method', () => {
394
394
  ]
395
395
  },
396
396
  balanceInflationaryUpdated: 130438.2727816632,
397
- balanceAfter: 128879.9907283133,
397
+ balanceAfter: 128880,
398
398
  ipcaUpdate: 1198.2727816632,
399
399
  dailyRate: 0.0002009109,
400
400
  interest: 781.24533156,
401
401
  interestDiff: 7.2434619051,
402
402
  interestIUB: 788.4887934651,
403
- monthlyPayment: 1141.2546032467,
404
- monthlyPaymentWithInsurances: 2373.4165708302,
405
- monthlyPaymentWithLate: 2373.4165708302,
406
- amortization: 360.0092716867,
407
- amortizationDiff: 3.3285355046,
403
+ monthlyPayment: 1141.24533156,
404
+ monthlyPaymentWithInsurances: 2373.4072991435,
405
+ monthlyPaymentWithLate: 2373.4072991435,
406
+ amortization: 360,
407
+ amortizationDiff: 3.3378071913,
408
408
  amortizationIUB: 363.3378071913,
409
409
  postponedInflationaryUpdate: 0,
410
- amortizationIPCA: 1194.9442461586,
410
+ amortizationIPCA: 1194.9349744719,
411
411
  debtorLifeInsuranceFee: 22.1457240152,
412
412
  codebtorLifeInsuranceFee: 0,
413
413
  propertyInsuranceFee: 4.5,
@@ -522,20 +522,20 @@ describe('installment-service for german method', () => {
522
522
  ]
523
523
  },
524
524
  balanceInflationaryUpdated: 130438.2727816632,
525
- balanceAfter: 129432.0635099765,
525
+ balanceAfter: 129432.0727816632,
526
526
  ipcaUpdate: 1198.2727816632,
527
527
  dailyRate: 0.0002009109,
528
528
  interest: 781.24533156,
529
529
  interestDiff: 7.2434619051,
530
530
  interestIUB: 788.4887934651,
531
- monthlyPayment: 589.1818215835,
532
- monthlyPaymentWithInsurances: 1821.343789167,
533
- monthlyPaymentWithLate: 1821.343789167,
534
- amortization: -192.0635099765,
535
- amortizationDiff: 3.3285355046,
531
+ monthlyPayment: 589.1725498968,
532
+ monthlyPaymentWithInsurances: 1821.3345174803,
533
+ monthlyPaymentWithLate: 1821.3345174803,
534
+ amortization: -192.0727816632,
535
+ amortizationDiff: 3.3378071913,
536
536
  amortizationIUB: 363.3378071913,
537
537
  postponedInflationaryUpdate: 552.0727816632,
538
- amortizationIPCA: 642.8714644954,
538
+ amortizationIPCA: 642.8621928087,
539
539
  debtorLifeInsuranceFee: 22.1457240152,
540
540
  codebtorLifeInsuranceFee: 0,
541
541
  propertyInsuranceFee: 4.5,
@@ -803,20 +803,20 @@ describe('installment-service for german method', () => {
803
803
  ]
804
804
  },
805
805
  balanceInflationaryUpdated: 130438.2727816632,
806
- balanceAfter: 128879.9907283133,
806
+ balanceAfter: 128880,
807
807
  ipcaUpdate: 1198.2727816632,
808
808
  dailyRate: 0.0002009109,
809
809
  interest: 781.24533156,
810
810
  interestDiff: 7.2434619051,
811
811
  interestIUB: 788.4887934651,
812
- monthlyPayment: 1141.2546032467,
813
- monthlyPaymentWithInsurances: 2373.4165708302,
814
- monthlyPaymentWithLate: 2373.4165708302,
815
- amortization: 360.0092716867,
816
- amortizationDiff: 3.3285355046,
812
+ monthlyPayment: 1141.24533156,
813
+ monthlyPaymentWithInsurances: 2373.4072991435,
814
+ monthlyPaymentWithLate: 2373.4072991435,
815
+ amortization: 360,
816
+ amortizationDiff: 3.3378071913,
817
817
  amortizationIUB: 363.3378071913,
818
818
  postponedInflationaryUpdate: 0,
819
- amortizationIPCA: 1194.9442461586,
819
+ amortizationIPCA: 1194.9349744719,
820
820
  debtorLifeInsuranceFee: 22.1457240152,
821
821
  codebtorLifeInsuranceFee: 0,
822
822
  propertyInsuranceFee: 4.5,
@@ -1811,4 +1811,146 @@ describe('installment-service for french method', () => {
1811
1811
  const result = service.getTotalMonthlyPayment(inputs, params);
1812
1812
  expect(result).toEqual(expectedResult);
1813
1813
  });
1814
+ it('Luciana (installment 1) should return the calculated installment', () => {
1815
+ const expectedResult = {
1816
+ IPCAByDates: [
1817
+ { date: '2022-04-18', ipca: 0.0101, dailyIPCA: 0.000335034 },
1818
+ { date: '2022-04-19', ipca: 0.0101, dailyIPCA: 0.000335034 },
1819
+ { date: '2022-04-20', ipca: 0.0101, dailyIPCA: 0.000335034 },
1820
+ { date: '2022-04-21', ipca: 0.0101, dailyIPCA: 0.000335034 },
1821
+ { date: '2022-04-22', ipca: 0.0101, dailyIPCA: 0.000335034 },
1822
+ { date: '2022-04-23', ipca: 0.0101, dailyIPCA: 0.000335034 },
1823
+ { date: '2022-04-24', ipca: 0.0101, dailyIPCA: 0.000335034 },
1824
+ { date: '2022-04-25', ipca: 0.0101, dailyIPCA: 0.000335034 },
1825
+ { date: '2022-04-26', ipca: 0.0101, dailyIPCA: 0.000335034 },
1826
+ { date: '2022-04-27', ipca: 0.0101, dailyIPCA: 0.000335034 },
1827
+ { date: '2022-04-28', ipca: 0.0101, dailyIPCA: 0.000335034 },
1828
+ { date: '2022-04-29', ipca: 0.0101, dailyIPCA: 0.000335034 },
1829
+ { date: '2022-04-30', ipca: 0.0101, dailyIPCA: 0.000335034 },
1830
+ { date: '2022-05-01', ipca: 0.0162, dailyIPCA: 0.0005185273 },
1831
+ { date: '2022-05-02', ipca: 0.0162, dailyIPCA: 0.0005185273 },
1832
+ { date: '2022-05-03', ipca: 0.0162, dailyIPCA: 0.0005185273 },
1833
+ { date: '2022-05-04', ipca: 0.0162, dailyIPCA: 0.0005185273 },
1834
+ { date: '2022-05-05', ipca: 0.0162, dailyIPCA: 0.0005185273 },
1835
+ { date: '2022-05-06', ipca: 0.0162, dailyIPCA: 0.0005185273 },
1836
+ { date: '2022-05-07', ipca: 0.0162, dailyIPCA: 0.0005185273 },
1837
+ { date: '2022-05-08', ipca: 0.0162, dailyIPCA: 0.0005185273 }
1838
+ ],
1839
+ balanceValues: {
1840
+ balances: [
1841
+ 242279.144564732, 242360.3163156521,
1842
+ 242441.5152618686, 242522.7414124928,
1843
+ 242603.9947766392, 242685.2753634252,
1844
+ 242766.5831819713, 242847.9182414011,
1845
+ 242929.2805508412, 243010.6701194213,
1846
+ 243092.0869562741, 243173.5310705354,
1847
+ 243299.6231850329, 243425.7806817341,
1848
+ 243552.0035945414, 243678.2919573749,
1849
+ 243804.6458041722, 243931.0651688885,
1850
+ 244057.5500854966, 244184.100587987
1851
+ ],
1852
+ balanceMonetaryUpdateValues: [
1853
+ 81.144564732, 81.1717509201,
1854
+ 81.1989462165, 81.2261506242,
1855
+ 81.2533641464, 81.280586786,
1856
+ 81.3078185461, 81.3350594298,
1857
+ 81.3623094401, 81.3895685801,
1858
+ 81.4168368528, 81.4441142613,
1859
+ 126.0921144975, 126.1574967012,
1860
+ 126.2229128073, 126.2883628335,
1861
+ 126.3538467973, 126.4193647163,
1862
+ 126.4849166081, 126.5505024904
1863
+ ]
1864
+ },
1865
+ balanceInflationaryUpdated: 244184.100587987,
1866
+ balanceAfter: 242048.7684186506,
1867
+ ipcaUpdate: 1986.100587987,
1868
+ dailyRate: 0.0002330313,
1869
+ interest: 1132.6166001979,
1870
+ interestDiff: 9.2878161488,
1871
+ interestIUB: 1141.9044163467,
1872
+ monthlyPayment: 1281.8481815473,
1873
+ monthlyPaymentWithInsurances: 3384.8755862471,
1874
+ amortization: 149.2315813494,
1875
+ amortizationDiff: 1.2237464036,
1876
+ amortizationIUB: 150.455327753,
1877
+ postponedInflationaryUpdate: 0,
1878
+ amortizationIPCA: 1984.8768415834,
1879
+ debtorLifeInsuranceFee: 82.679000564,
1880
+ codebtorLifeInsuranceFee: 0,
1881
+ propertyInsuranceFee: 24.96,
1882
+ lateDays: 0,
1883
+ lateCharges: 0,
1884
+ lateInterest: 0,
1885
+ lateAmortizationIPCA: 0,
1886
+ lateChargesInterest: 0,
1887
+ lateRate: 0.0007515586,
1888
+ monthlyPaymentWithLate: 3384.8755862471
1889
+ };
1890
+ const amortizationMethod = AmortizationMethod.FRENCH;
1891
+ const paymentNumber = new PaymentNumber(1);
1892
+ const isGraceMonth = false;
1893
+ const numberOfMonths = new NumberOfMonths(360);
1894
+ const previousBalance = new PreviousBalance(242198.00); //
1895
+ const annualRate = 0.0875;
1896
+ const debtorLifeInsuranceRate = new CreditInsuranceRate(0.00017);
1897
+ const inflationaryUpperBound = 1;
1898
+ const propertyAmount = 416000.0;
1899
+ const propertyInsuranceRate = new CreditInsuranceRate(0.00003);
1900
+ const IPCAmap = { '2022-04-18': 0.0101, '2022-05-08': 0.0162 };
1901
+ const inputs: DebtInputs = {
1902
+ amortizationMethod,
1903
+ isGraceMonth,
1904
+ paymentNumber,
1905
+ numberOfMonths,
1906
+ previousBalance,
1907
+ inflationaryUpperBound,
1908
+ propertyAmount,
1909
+ IPCAmap,
1910
+ IPCAmapLate: { '2022-03-08': 0.0054 },
1911
+ today: '2022-05-08'
1912
+ };
1913
+ const params: DebtParams = {
1914
+ annualRate,
1915
+ debtorLifeInsuranceRate,
1916
+ // codebtorLifeInsuranceRate: debtorLifeInsuranceRate,
1917
+ propertyInsuranceRate
1918
+ };
1919
+ const result = service.getTotalMonthlyPayment(inputs, params);
1920
+ expect(result).toEqual(expectedResult);
1921
+ });
1922
+ it('Tiago (installment 4) should return the calculated installment with correct amortizationDiff', () => {
1923
+ const amortizationMethod = AmortizationMethod.GERMAN;
1924
+ const paymentNumber = new PaymentNumber(3);
1925
+ const isGraceMonth = false;
1926
+ const numberOfMonths = new NumberOfMonths(360);
1927
+ const previousBalance = new PreviousBalance(164217.58); //
1928
+ const annualRate = 0.0800;
1929
+ const debtorLifeInsuranceRate = new CreditInsuranceRate(0.00017);
1930
+ const inflationaryUpperBound = 0.003;
1931
+ const propertyAmount = 208000;
1932
+ const propertyInsuranceRate = new CreditInsuranceRate(0.00003);
1933
+ const IPCAmap = { '2022-04-08': 0.0101, '2022-05-08': 0.0162 };
1934
+ const inputs: DebtInputs = {
1935
+ amortizationMethod,
1936
+ isGraceMonth,
1937
+ paymentNumber,
1938
+ numberOfMonths,
1939
+ previousBalance,
1940
+ inflationaryUpperBound,
1941
+ propertyAmount,
1942
+ IPCAmap,
1943
+ IPCAmapLate: { '2022-05-08': 0.0162 },
1944
+ today: '2022-05-08'
1945
+ };
1946
+ const params: DebtParams = {
1947
+ annualRate,
1948
+ debtorLifeInsuranceRate,
1949
+ // codebtorLifeInsuranceRate: debtorLifeInsuranceRate,
1950
+ propertyInsuranceRate
1951
+ };
1952
+ const result = service.getTotalMonthlyPayment(inputs, params);
1953
+ const { amortizationDiff } = result;
1954
+ expect(amortizationDiff).toBe(5.313323492);
1955
+ });
1814
1956
  });
@@ -72,7 +72,10 @@ describe('offerService', () => {
72
72
  numberOfGraceMonths: 0,
73
73
  operationalExpensesFinancing: OperationalExpensesFinancing.DEBTOR,
74
74
  useDoublePayments: true,
75
- clientAge: undefined
75
+ clientAge: undefined,
76
+ district: undefined,
77
+ isPropertyNew: undefined,
78
+ prospectAge: undefined
76
79
  };
77
80
  const offerParams: OfferParams = {
78
81
  purpose: Purpose.HOME,
@@ -129,25 +132,25 @@ describe('offerService', () => {
129
132
  creditInsuranceFee: 0,
130
133
  gf: 0,
131
134
  gp: 32499.999999999996,
132
- lifeInsuranceFee: 95.00401058569999,
135
+ lifeInsuranceFee: 95.00399000000002,
133
136
  propertyInsuranceFee: 19.5,
134
137
  unemploymentInsuranceFee: 0,
135
- creditAmount: 558847.1210925741,
138
+ creditAmount: 558847,
136
139
  credituAmount: 582660,
137
140
  approvedAmount: 558847.1210925741,
138
141
  approvedAmountFinanceCharge: 718916.7501636882,
139
- creditInsurancePremium: 41396.0830427353,
140
- installment: 7707.9959894143,
142
+ creditInsurancePremium: 41396.074072915,
143
+ installment: 7707.9943192239,
141
144
  unitInstallment: 0.0137926737,
142
145
  approvedAmountIncomeDividend: 558847.1210925741,
143
- backEndRatio: 0.35,
146
+ backEndRatio: 0.3499999244,
144
147
  approvedAmountLoanToValue: 584997.6600163799,
145
- financingAmount: 517451.03803419106,
146
- frontEndRatio: 0.35,
147
- loanToValueCredit: 0.8597648017,
148
- loanToValueHome: 0.7960785201,
149
- totalFee: 7822.500000000001,
150
- creditFee: 7822.500000000001,
148
+ financingAmount: 517450.9259114373,
149
+ frontEndRatio: 0.3499999244,
150
+ loanToValueCredit: 0.8597646154,
151
+ loanToValueHome: 0.7960783476,
152
+ totalFee: 7822.4983092239,
153
+ creditFee: 7822.4983092239,
151
154
  propertyValue: 650000,
152
155
  monthlyInterestRate: 0.0110148959202348,
153
156
  amountRequestedByClient: 539500,
@@ -155,7 +158,7 @@ describe('offerService', () => {
155
158
  percentageOperationalExpensesFinanced: 0,
156
159
  operationalExpenses: 34435.539999999986,
157
160
  creditInsuranceFactor: 0.08,
158
- financingRatio: 0.9591307470999999
161
+ financingRatio: 0.9591305392
159
162
  };
160
163
 
161
164
  const params: OfferParams = {
@@ -218,7 +221,10 @@ describe('offerService', () => {
218
221
  numberOfGraceMonths: 0, // Meses de gracias(N)
219
222
  operationalExpensesFinancing: OperationalExpensesFinancing.DEBTOR,
220
223
  clientAge: 35,
221
- useDoublePayments: false
224
+ useDoublePayments: false,
225
+ district: undefined,
226
+ isPropertyNew: undefined,
227
+ prospectAge: undefined
222
228
  };
223
229
  const math = new MathService(true, 20);
224
230
  const offerService = new OfferService(math);
@@ -234,28 +240,28 @@ describe('offerService', () => {
234
240
  Kgop2: 0,
235
241
  Kscr: 0.0066666667,
236
242
  adjustmentFactorGraceMonths: 1,
237
- creditInsuranceFee: 2914.0306328198,
243
+ creditInsuranceFee: 2914.0333479035,
238
244
  gf: 0,
239
245
  gp: 32499.999999999996,
240
- lifeInsuranceFee: 74.3077807654,
246
+ lifeInsuranceFee: 74.30785,
241
247
  propertyInsuranceFee: 19.5,
242
248
  unemploymentInsuranceFee: 0,
243
- creditAmount: 437104.5927374448,
249
+ creditAmount: 437105,
244
250
  credituAmount: 585000,
245
251
  approvedAmount: 437104.5927374448,
246
252
  approvedAmountFinanceCharge: 562303.7167625874,
247
- creditInsurancePremium: 34968.3674189956,
248
- installment: 4814.6615864149,
253
+ creditInsurancePremium: 34968.4,
254
+ installment: 4814.6660723694995,
249
255
  unitInstallment: 0.0110148959202348,
250
256
  approvedAmountIncomeDividend: 437104.5927374448,
251
- backEndRatio: 0.35,
257
+ backEndRatio: 0.35000032529999997,
252
258
  approvedAmountLoanToValue: 585000,
253
- financingAmount: 437104.5927374448,
259
+ financingAmount: 437105,
254
260
  frontEndRatio: 0.35,
255
- loanToValueCredit: 0.6724686042,
256
- loanToValueHome: 0.6724686042,
257
- totalFee: 7822.5000000001,
258
- creditFee: 7822.5000000001,
261
+ loanToValueCredit: 0.6724692308,
262
+ loanToValueHome: 0.6724692308,
263
+ totalFee: 7822.5072702729985,
264
+ creditFee: 7822.5072702729985,
259
265
  propertyValue: 650000,
260
266
  monthlyInterestRate: 0.0110148959202348,
261
267
  amountRequestedByClient: 585000,
@@ -263,7 +269,7 @@ describe('offerService', () => {
263
269
  percentageOperationalExpensesFinanced: 0,
264
270
  operationalExpenses: 34435.539999999986,
265
271
  creditInsuranceFactor: 0.08,
266
- financingRatio: 0.7471873379999999
272
+ financingRatio: 0.7471880341999999
267
273
  };
268
274
 
269
275
  const params: OfferParams = {
@@ -326,7 +332,10 @@ describe('offerService', () => {
326
332
  numberOfGraceMonths: 12, // Meses de gracias(N)
327
333
  operationalExpensesFinancing: OperationalExpensesFinancing.DEBTOR,
328
334
  clientAge: 35,
329
- useDoublePayments: false
335
+ useDoublePayments: false,
336
+ district: undefined,
337
+ isPropertyNew: undefined,
338
+ prospectAge: undefined
330
339
  };
331
340
  const math = new MathService(true, 20);
332
341
  const offerService = new OfferService(math);
@@ -344,28 +353,28 @@ describe('offerService', () => {
344
353
  Kgop2: 0,
345
354
  Kscr: 0.0066666667,
346
355
  adjustmentFactorGraceMonths: 1,
347
- creditInsuranceFee: 2521.6511653518,
356
+ creditInsuranceFee: 2521.6533459416,
348
357
  gf: 0,
349
358
  gp: 32499.999999999996,
350
- lifeInsuranceFee: 64.302104395,
359
+ lifeInsuranceFee: 64.30216,
351
360
  propertyInsuranceFee: 19.5,
352
361
  unemploymentInsuranceFee: 0,
353
- creditAmount: 378247.6729115391,
362
+ creditAmount: 378248,
354
363
  credituAmount: 585000,
355
364
  approvedAmount: 378247.6729115391,
356
365
  approvedAmountFinanceCharge: 486588.50963552855,
357
- creditInsurancePremium: 30259.813832923104,
358
- installment: 5217.046730253201,
366
+ creditInsurancePremium: 30259.84,
367
+ installment: 5217.0512416776,
359
368
  unitInstallment: 0.0137926737,
360
369
  approvedAmountIncomeDividend: 378247.6729115391,
361
- backEndRatio: 0.35,
370
+ backEndRatio: 0.35000030190000003,
362
371
  approvedAmountLoanToValue: 585000,
363
- financingAmount: 378247.6729115391,
372
+ financingAmount: 378248,
364
373
  frontEndRatio: 0.35,
365
- loanToValueCredit: 0.5819194968,
366
- loanToValueHome: 0.5819194968,
367
- totalFee: 7822.500000000001,
368
- creditFee: 7822.500000000001,
374
+ loanToValueCredit: 0.58192,
375
+ loanToValueHome: 0.58192,
376
+ totalFee: 7822.5067476192,
377
+ creditFee: 7822.5067476192,
369
378
  propertyValue: 650000,
370
379
  monthlyInterestRate: 0.0110148959202348,
371
380
  amountRequestedByClient: 585000,
@@ -373,7 +382,7 @@ describe('offerService', () => {
373
382
  percentageOperationalExpensesFinanced: 0,
374
383
  operationalExpenses: 34435.539999999986,
375
384
  creditInsuranceFactor: 0.08,
376
- financingRatio: 0.6465772187
385
+ financingRatio: 0.6465777778
377
386
  };
378
387
 
379
388
  const params: OfferParams = {
@@ -436,7 +445,10 @@ describe('offerService', () => {
436
445
  numberOfGraceMonths: 0, // Meses de gracias(N)
437
446
  operationalExpensesFinancing: OperationalExpensesFinancing.DEBTOR,
438
447
  clientAge: 35,
439
- useDoublePayments: false
448
+ useDoublePayments: false,
449
+ district: undefined,
450
+ isPropertyNew: undefined,
451
+ prospectAge: undefined
440
452
  };
441
453
  const math = new MathService(true, 20);
442
454
  const offerService = new OfferService(math);
@@ -454,28 +466,28 @@ describe('offerService', () => {
454
466
  Kgop2: 0,
455
467
  Kscr: 0.0029032,
456
468
  adjustmentFactorGraceMonths: 1,
457
- creditInsuranceFee: 1552.3416905968,
469
+ creditInsuranceFee: 1552.3412969457,
458
470
  gf: 0,
459
471
  gp: 32499.999999999996,
460
- lifeInsuranceFee: 95.0041840917,
472
+ lifeInsuranceFee: 95.00416,
461
473
  propertyInsuranceFee: 19.5,
462
474
  unemploymentInsuranceFee: 0,
463
- creditAmount: 558848.1417156955,
475
+ creditAmount: 558848,
464
476
  credituAmount: 584999.9410752,
465
477
  approvedAmount: 558848.1417156955,
466
478
  approvedAmountFinanceCharge: 718918.0631221518,
467
- creditInsurancePremium: 42776.0179277166,
468
- installment: 6155.6541049068,
479
+ creditInsurancePremium: 42776.0070803456,
480
+ installment: 6155.6525439232,
469
481
  unitInstallment: 0.0110148959202348,
470
482
  approvedAmountIncomeDividend: 558848.1417156955,
471
- backEndRatio: 0.3499999991,
483
+ backEndRatio: 0.34999991059999996,
472
484
  approvedAmountLoanToValue: 585000,
473
- financingAmount: 534700.2240964576,
474
- frontEndRatio: 0.3499999991,
475
- loanToValueCredit: 0.8597663719,
476
- loanToValueHome: 0.8226157294,
477
- totalFee: 7822.4999795953,
478
- creditFee: 7822.4999795953,
485
+ financingAmount: 534700.08850432,
486
+ frontEndRatio: 0.34999991059999996,
487
+ loanToValueCredit: 0.8597661539,
488
+ loanToValueHome: 0.8226155207999999,
489
+ totalFee: 7822.4980008689,
490
+ creditFee: 7822.4980008689,
479
491
  propertyValue: 650000,
480
492
  monthlyInterestRate: 0.0110148959202348,
481
493
  amountRequestedByClient: 559722,
@@ -483,7 +495,7 @@ describe('offerService', () => {
483
495
  percentageOperationalExpensesFinanced: 0,
484
496
  operationalExpenses: 34435.539999999986,
485
497
  creditInsuranceFactor: 0.08,
486
- financingRatio: 0.9552960650000001
498
+ financingRatio: 0.9552958227999999
487
499
  };
488
500
 
489
501
  const params: OfferParams = {
@@ -546,7 +558,10 @@ describe('offerService', () => {
546
558
  numberOfGraceMonths: 12, // Meses de gracias(N)
547
559
  operationalExpensesFinancing: OperationalExpensesFinancing.DEBTOR,
548
560
  clientAge: 35,
549
- useDoublePayments: false
561
+ useDoublePayments: false,
562
+ district: undefined,
563
+ isPropertyNew: undefined,
564
+ prospectAge: undefined
550
565
  };
551
566
  const math = new MathService(true, 20);
552
567
  const offerService = new OfferService(math);
@@ -567,25 +582,25 @@ describe('offerService', () => {
567
582
  creditInsuranceFee: 0,
568
583
  gf: 0,
569
584
  gp: 32499.999999999996,
570
- lifeInsuranceFee: 88.3999116,
585
+ lifeInsuranceFee: 88.39983,
571
586
  propertyInsuranceFee: 19.5,
572
587
  unemploymentInsuranceFee: 0,
573
- creditAmount: 519999.48,
588
+ creditAmount: 519999,
574
589
  credituAmount: 519999.48,
575
590
  approvedAmount: 519999.99999999994,
576
591
  approvedAmountFinanceCharge: 880329.7165416365,
577
- creditInsurancePremium: 38518.4799989215,
578
- installment: 5840.918027076101,
592
+ creditInsurancePremium: 38518.4444433659,
593
+ installment: 5840.9126354541,
579
594
  unitInstallment: 0.0112325459,
580
595
  approvedAmountIncomeDividend: 684320.8585549303,
581
- backEndRatio: 0.2661663507,
596
+ backEndRatio: 0.2661661058,
582
597
  approvedAmountLoanToValue: 519999.99999999994,
583
- financingAmount: 481480.9999865185,
584
- frontEndRatio: 0.2661663507,
585
- loanToValueCredit: 0.7999992,
586
- loanToValueHome: 0.74074,
587
- totalFee: 5948.817938676101,
588
- creditFee: 5948.817938676101,
598
+ financingAmount: 481480.5555420741,
599
+ frontEndRatio: 0.2661661058,
600
+ loanToValueCredit: 0.7999984615,
601
+ loanToValueHome: 0.7407393162000001,
602
+ totalFee: 5948.812465454101,
603
+ creditFee: 5948.812465454101,
589
604
  propertyValue: 650000,
590
605
  monthlyInterestRate: 0.0110148959202348,
591
606
  amountRequestedByClient: 481481,
@@ -593,7 +608,7 @@ describe('offerService', () => {
593
608
  percentageOperationalExpensesFinanced: 0,
594
609
  operationalExpenses: 34435.539999999986,
595
610
  creditInsuranceFactor: 0.08,
596
- financingRatio: 1
611
+ financingRatio: 0.9999990769000001
597
612
  };
598
613
 
599
614
  const params: OfferParams = {
@@ -656,7 +671,10 @@ describe('offerService', () => {
656
671
  numberOfGraceMonths: 0, // Meses de gracias(N)
657
672
  operationalExpensesFinancing: OperationalExpensesFinancing.DEBTOR,
658
673
  clientAge: 35,
659
- useDoublePayments: false
674
+ useDoublePayments: false,
675
+ district: undefined,
676
+ isPropertyNew: undefined,
677
+ prospectAge: undefined
660
678
  };
661
679
  const math = new MathService(true, 20);
662
680
  const offerService = new OfferService(math);
@@ -677,25 +695,25 @@ describe('offerService', () => {
677
695
  creditInsuranceFee: 0,
678
696
  gf: 0,
679
697
  gp: 22500,
680
- lifeInsuranceFee: 61.199938800000005,
698
+ lifeInsuranceFee: 61.2,
681
699
  propertyInsuranceFee: 13.5,
682
700
  unemploymentInsuranceFee: 0,
683
- creditAmount: 359999.64,
701
+ creditAmount: 360000,
684
702
  credituAmount: 359999.64,
685
703
  approvedAmount: 360000,
686
704
  approvedAmountFinanceCharge: 717899.3819035813,
687
- creditInsurancePremium: 26666.6399992533,
688
- installment: 4670.8512211441,
705
+ creditInsurancePremium: 26666.666665920002,
706
+ installment: 4670.8558920000005,
689
707
  unitInstallment: 0.0129745997,
690
708
  approvedAmountIncomeDividend: 615195.607668448,
691
- backEndRatio: 0.17576115409999998,
709
+ backEndRatio: 0.1757613293,
692
710
  approvedAmountLoanToValue: 360000,
693
- financingAmount: 333332.9999906667,
694
- frontEndRatio: 0.17576115409999998,
695
- loanToValueCredit: 0.7999992,
696
- loanToValueHome: 0.74074,
697
- totalFee: 4745.551159944101,
698
- creditFee: 4745.551159944101,
711
+ financingAmount: 333333.333324,
712
+ frontEndRatio: 0.1757613293,
713
+ loanToValueCredit: 0.8,
714
+ loanToValueHome: 0.7407407407,
715
+ totalFee: 4745.555892,
716
+ creditFee: 4745.555892,
699
717
  propertyValue: 450000,
700
718
  monthlyInterestRate: 0.0128434215415128,
701
719
  amountRequestedByClient: 333333,
@@ -703,7 +721,7 @@ describe('offerService', () => {
703
721
  percentageOperationalExpensesFinanced: 0,
704
722
  operationalExpenses: 24435.54,
705
723
  creditInsuranceFactor: 0.08,
706
- financingRatio: 1
724
+ financingRatio: 1.000001
707
725
  };
708
726
 
709
727
  const params: OfferParams = {
@@ -766,7 +784,10 @@ describe('offerService', () => {
766
784
  numberOfGraceMonths: 0, // Meses de gracias(N)
767
785
  operationalExpensesFinancing: OperationalExpensesFinancing.DEBTOR,
768
786
  clientAge: 35,
769
- useDoublePayments: false
787
+ useDoublePayments: false,
788
+ district: undefined,
789
+ isPropertyNew: undefined,
790
+ prospectAge: undefined
770
791
  };
771
792
  const math = new MathService(true, 20);
772
793
  const offerService = new OfferService(math);
@@ -876,7 +897,10 @@ describe('offerService', () => {
876
897
  numberOfGraceMonths: 12, // Meses de gracias(N)
877
898
  operationalExpensesFinancing: OperationalExpensesFinancing.DEBTOR,
878
899
  clientAge: 35,
879
- useDoublePayments: false
900
+ useDoublePayments: false,
901
+ district: undefined,
902
+ isPropertyNew: undefined,
903
+ prospectAge: undefined
880
904
  };
881
905
  const math = new MathService(true, 20);
882
906
  const offerService = new OfferService(math);
@@ -897,25 +921,25 @@ describe('offerService', () => {
897
921
  creditInsuranceFee: 0,
898
922
  gf: 0,
899
923
  gp: 32499.999999999996,
900
- lifeInsuranceFee: 84.3644109052,
924
+ lifeInsuranceFee: 84.3644,
901
925
  propertyInsuranceFee: 0,
902
926
  unemploymentInsuranceFee: 0,
903
- creditAmount: 421822.0545259302,
927
+ creditAmount: 421822,
904
928
  credituAmount: 519999.9999999999,
905
929
  approvedAmount: 421822.0545259302,
906
930
  approvedAmountFinanceCharge: 421822.0545259302,
907
931
  creditInsurancePremium: 0,
908
- installment: 4738.1355890948,
932
+ installment: 4738.1349766298,
909
933
  unitInstallment: 0.0112325459,
910
934
  approvedAmountIncomeDividend: 586483.5408183229,
911
- backEndRatio: 0.35,
935
+ backEndRatio: 0.3499999721,
912
936
  approvedAmountLoanToValue: 519999.9999999999,
913
- financingAmount: 421822.0545259302,
914
- frontEndRatio: 0.2157718121,
915
- loanToValueCredit: 0.648957007,
916
- loanToValueHome: 0.648957007,
917
- totalFee: 7822.500000000001,
918
- creditFee: 4822.5,
937
+ financingAmount: 421822,
938
+ frontEndRatio: 0.21577178419999998,
939
+ loanToValueCredit: 0.6489569231,
940
+ loanToValueHome: 0.6489569231,
941
+ totalFee: 7822.4993766298,
942
+ creditFee: 4822.4993766298,
919
943
  propertyValue: 650000,
920
944
  monthlyInterestRate: 0.0110148959202348,
921
945
  amountRequestedByClient: 519999.99999999994,
@@ -923,7 +947,7 @@ describe('offerService', () => {
923
947
  percentageOperationalExpensesFinanced: 0,
924
948
  operationalExpenses: 34435.539999999986,
925
949
  creditInsuranceFactor: 0,
926
- financingRatio: 0.8111962587
950
+ financingRatio: 0.8111961538
927
951
  };
928
952
 
929
953
  const params: OfferParams = {
@@ -986,7 +1010,10 @@ describe('offerService', () => {
986
1010
  numberOfGraceMonths: 0, // Meses de gracias(N)
987
1011
  operationalExpensesFinancing: OperationalExpensesFinancing.DEBTOR,
988
1012
  clientAge: 35,
989
- useDoublePayments: false
1013
+ useDoublePayments: false,
1014
+ district: undefined,
1015
+ isPropertyNew: undefined,
1016
+ prospectAge: undefined
990
1017
  };
991
1018
  const math = new MathService(true, 20);
992
1019
  const offerService = new OfferService(math);
@@ -1007,33 +1034,33 @@ describe('offerService', () => {
1007
1034
  creditInsuranceFee: 0,
1008
1035
  gf: 19.8,
1009
1036
  gp: 11,
1010
- lifeInsuranceFee: 0.6915562282,
1037
+ lifeInsuranceFee: 0.69147,
1011
1038
  propertyInsuranceFee: 0.4004,
1012
1039
  unemploymentInsuranceFee: 0,
1013
- creditAmount: 1773.221098,
1040
+ creditAmount: 1773,
1014
1041
  credituAmount: 1773.221098,
1015
1042
  approvedAmount: 1980,
1016
1043
  approvedAmountFinanceCharge: 4207.7629943957,
1017
- creditInsurancePremium: 116.8510980018,
1018
- installment: 9.2552950711,
1044
+ creditInsurancePremium: 116.8363636381,
1045
+ installment: 9.2541410541,
1019
1046
  unitInstallment: 0.0052194817,
1020
1047
  approvedAmountIncomeDividend: 3734.7943267201,
1021
- backEndRatio: 0.3261295773,
1048
+ backEndRatio: 0.326109246,
1022
1049
  approvedAmountLoanToValue: 1980,
1023
- financingAmount: 1636.5700000250001,
1024
- frontEndRatio: 0.16962182350000002,
1025
- loanToValueCredit: 0.80600959,
1026
- loanToValueHome: 0.7438954546,
1027
- totalFee: 19.8945196013,
1028
- creditFee: 10.3472512993,
1050
+ financingAmount: 1636.3636363886,
1051
+ frontEndRatio: 0.1696014922,
1052
+ loanToValueCredit: 0.8059090909,
1053
+ loanToValueHome: 0.7438016529000001,
1054
+ totalFee: 19.8932793561,
1055
+ creditFee: 10.3460110541,
1029
1056
  propertyValue: 2200,
1030
1057
  monthlyInterestRate: 0.003962491754522,
1031
1058
  amountRequestedByClient: 1636.5700000000002,
1032
1059
  operationalExpensesFee: 0,
1033
1060
  percentageOperationalExpensesFinanced: 19.8,
1034
- operationalExpenses: 26.348442196000004,
1061
+ operationalExpenses: 26.348,
1035
1062
  creditInsuranceFactor: 0.0714,
1036
- financingRatio: 1
1063
+ financingRatio: 0.9998739047999999
1037
1064
  };
1038
1065
  const params: OfferParams = {
1039
1066
  maximumBackendRatio: 0.55, // Máximo de CF (L alpha)
@@ -1095,7 +1122,10 @@ describe('offerService', () => {
1095
1122
  numberOfGraceMonths: 0, // Meses de gracias(N)
1096
1123
  operationalExpensesFinancing: OperationalExpensesFinancing.CREDITU,
1097
1124
  clientAge: 35,
1098
- useDoublePayments: false
1125
+ useDoublePayments: false,
1126
+ district: undefined,
1127
+ isPropertyNew: undefined,
1128
+ prospectAge: undefined
1099
1129
  };
1100
1130
  const math = new MathService(true, 20);
1101
1131
  const offerService = new OfferService(math);
@@ -1205,7 +1235,10 @@ describe('offerService', () => {
1205
1235
  numberOfGraceMonths: 0, // Meses de gracias(N)
1206
1236
  operationalExpensesFinancing: OperationalExpensesFinancing.DEBTOR,
1207
1237
  clientAge: 35,
1208
- useDoublePayments: false
1238
+ useDoublePayments: false,
1239
+ district: undefined,
1240
+ isPropertyNew: undefined,
1241
+ prospectAge: undefined
1209
1242
  };
1210
1243
  const math = new MathService(true, 20);
1211
1244
  const offerService = new OfferService(math);
@@ -1226,33 +1259,33 @@ describe('offerService', () => {
1226
1259
  creditInsuranceFee: 0,
1227
1260
  gf: 20.8,
1228
1261
  gp: 12,
1229
- lifeInsuranceFee: 0.391312779,
1262
+ lifeInsuranceFee: 0.391365,
1230
1263
  propertyInsuranceFee: 0.4368,
1231
1264
  unemploymentInsuranceFee: 0,
1232
- creditAmount: 2006.7322000000001,
1265
+ creditAmount: 2007,
1233
1266
  credituAmount: 2006.7322000000001,
1234
1267
  approvedAmount: 2070.5411139114003,
1235
1268
  approvedAmountFinanceCharge: 3302.1569962424,
1236
- creditInsurancePremium: 133.732200002,
1237
- installment: 9.9468750499,
1269
+ creditInsurancePremium: 133.7500466699,
1270
+ installment: 9.9482024682,
1238
1271
  unitInstallment: 0.0049567526,
1239
1272
  approvedAmountIncomeDividend: 2070.5411139114003,
1240
- backEndRatio: 0.33963817939999996,
1273
+ backEndRatio: 0.339681667,
1241
1274
  approvedAmountLoanToValue: 2160,
1242
- financingAmount: 1873.0000000282002,
1243
- frontEndRatio: 0.33963817939999996,
1244
- loanToValueCredit: 0.8361384167,
1245
- loanToValueHome: 0.7804166667,
1246
- totalFee: 10.7749878289,
1247
- creditFee: 10.7749878289,
1275
+ financingAmount: 1873.2499533603,
1276
+ frontEndRatio: 0.339681667,
1277
+ loanToValueCredit: 0.83625,
1278
+ loanToValueHome: 0.7805208138999999,
1279
+ totalFee: 10.7763674682,
1280
+ creditFee: 10.7763674682,
1248
1281
  propertyValue: 2400,
1249
1282
  monthlyInterestRate: 0.0035947364096048,
1250
1283
  amountRequestedByClient: 1873,
1251
1284
  operationalExpensesFee: 0,
1252
1285
  percentageOperationalExpensesFinanced: 20.8,
1253
- operationalExpenses: 27.815464399999996,
1286
+ operationalExpenses: 27.815999999999995,
1254
1287
  creditInsuranceFactor: 0.0714,
1255
- financingRatio: 1
1288
+ financingRatio: 1.0001334508
1256
1289
  };
1257
1290
  const params: OfferParams = {
1258
1291
  maximumBackendRatio: 0.55, // Máximo de CF (L alpha)
@@ -1314,7 +1347,10 @@ describe('offerService', () => {
1314
1347
  numberOfGraceMonths: 0, // Meses de gracias(N)
1315
1348
  operationalExpensesFinancing: OperationalExpensesFinancing.DEBTOR,
1316
1349
  clientAge: 35,
1317
- useDoublePayments: false
1350
+ useDoublePayments: false,
1351
+ district: undefined,
1352
+ isPropertyNew: undefined,
1353
+ prospectAge: undefined
1318
1354
  };
1319
1355
  const math = new MathService(true, 20);
1320
1356
  const offerService = new OfferService(math);
@@ -1335,33 +1371,33 @@ describe('offerService', () => {
1335
1371
  creditInsuranceFee: 0,
1336
1372
  gf: 19.8,
1337
1373
  gp: 11,
1338
- lifeInsuranceFee: 0.77092587,
1374
+ lifeInsuranceFee: 0.77103,
1339
1375
  propertyInsuranceFee: 0.4004,
1340
1376
  unemploymentInsuranceFee: 0,
1341
- creditAmount: 1976.7330000000002,
1377
+ creditAmount: 1977,
1342
1378
  credituAmount: 1976.7330000000002,
1343
1379
  approvedAmount: 1980,
1344
1380
  approvedAmountFinanceCharge: 2733.0574039923,
1345
- creditInsurancePremium: 131.733000002,
1346
- installment: 10.143838051,
1381
+ creditInsurancePremium: 131.7507933565,
1382
+ installment: 10.1452081929,
1347
1383
  unitInstallment: 0.0051316177,
1348
1384
  approvedAmountIncomeDividend: 2003.5069485162,
1349
- backEndRatio: 0.4224900071,
1385
+ backEndRatio: 0.42253502109999996,
1350
1386
  approvedAmountLoanToValue: 1980,
1351
- financingAmount: 1845.0000000278,
1352
- frontEndRatio: 0.3454861354,
1353
- loanToValueCredit: 0.898515,
1354
- loanToValueHome: 0.8386363635999999,
1355
- totalFee: 13.837150601000001,
1356
- creditFee: 11.315163921,
1387
+ financingAmount: 1845.2492066732998,
1388
+ frontEndRatio: 0.3455311493,
1389
+ loanToValueCredit: 0.8986363636,
1390
+ loanToValueHome: 0.8387496394,
1391
+ totalFee: 13.838624872899999,
1392
+ creditFee: 11.3166381929,
1357
1393
  propertyValue: 2200,
1358
1394
  monthlyInterestRate: 0.0035947364096048,
1359
1395
  amountRequestedByClient: 1845,
1360
1396
  operationalExpensesFee: 0,
1361
1397
  percentageOperationalExpensesFinanced: 19.8,
1362
- operationalExpenses: 26.755466000000002,
1398
+ operationalExpenses: 26.756,
1363
1399
  creditInsuranceFactor: 0.0714,
1364
- financingRatio: 1
1400
+ financingRatio: 1.0001350714000001
1365
1401
  };
1366
1402
  const params: OfferParams = {
1367
1403
  maximumBackendRatio: 0.55, // Máximo de CF (L alpha)
@@ -1423,7 +1459,10 @@ describe('offerService', () => {
1423
1459
  numberOfGraceMonths: 0, // Meses de gracias(N)
1424
1460
  operationalExpensesFinancing: OperationalExpensesFinancing.DEBTOR,
1425
1461
  clientAge: 35,
1426
- useDoublePayments: false
1462
+ useDoublePayments: false,
1463
+ district: undefined,
1464
+ isPropertyNew: undefined,
1465
+ prospectAge: undefined
1427
1466
  };
1428
1467
  const math = new MathService(true, 20);
1429
1468
  const offerService = new OfferService(math);
@@ -1444,33 +1483,33 @@ describe('offerService', () => {
1444
1483
  creditInsuranceFee: 0,
1445
1484
  gf: 19.8,
1446
1485
  gp: 11,
1447
- lifeInsuranceFee: 0.6894459,
1486
+ lifeInsuranceFee: 0.68952,
1448
1487
  propertyInsuranceFee: 0.4004,
1449
1488
  unemploymentInsuranceFee: 0,
1450
- creditAmount: 1767.8099999734,
1489
+ creditAmount: 1768,
1451
1490
  credituAmount: 1976.7330000000002,
1452
1491
  approvedAmount: 1767.8099999734,
1453
1492
  approvedAmountFinanceCharge: 2611.0147948526,
1454
- creditInsurancePremium: 117.81,
1455
- installment: 9.5279763405,
1493
+ creditInsurancePremium: 117.82266193939999,
1494
+ installment: 9.5290003848,
1456
1495
  unitInstallment: 0.0053897061,
1457
1496
  approvedAmountIncomeDividend: 3047.3668578061,
1458
- backEndRatio: 0.4011980591,
1497
+ backEndRatio: 0.40123158870000003,
1459
1498
  approvedAmountLoanToValue: 1767.8099999734,
1460
- financingAmount: 1650.0000000000002,
1461
- frontEndRatio: 0.3241941873,
1462
- loanToValueCredit: 0.80355,
1499
+ financingAmount: 1650.1773380872,
1500
+ frontEndRatio: 0.32422771699999997,
1501
+ loanToValueCredit: 0.8036363636,
1463
1502
  loanToValueHome: 0.75,
1464
- totalFee: 13.139808920499998,
1465
- creditFee: 10.617822240499999,
1503
+ totalFee: 13.140907064799999,
1504
+ creditFee: 10.618920384800001,
1466
1505
  propertyValue: 2200,
1467
1506
  monthlyInterestRate: 0.003962491754522,
1468
1507
  amountRequestedByClient: 1845,
1469
1508
  operationalExpensesFee: 0,
1470
1509
  percentageOperationalExpensesFinanced: 19.8,
1471
- operationalExpenses: 26.3376199999,
1510
+ operationalExpenses: 26.337999999999997,
1472
1511
  creditInsuranceFactor: 0.0714,
1473
- financingRatio: 0.8943089431
1512
+ financingRatio: 0.8944050613000001
1474
1513
  };
1475
1514
  const params: OfferParams = {
1476
1515
  maximumBackendRatio: 0.55, // Máximo de CF (L alpha)
@@ -1532,7 +1571,10 @@ describe('offerService', () => {
1532
1571
  numberOfGraceMonths: 0, // Meses de gracias(N)
1533
1572
  operationalExpensesFinancing: OperationalExpensesFinancing.DEBTOR,
1534
1573
  clientAge: 0,
1535
- useDoublePayments: false
1574
+ useDoublePayments: false,
1575
+ district: undefined,
1576
+ isPropertyNew: undefined,
1577
+ prospectAge: undefined
1536
1578
  };
1537
1579
  const math = new MathService(true, 20);
1538
1580
  const offerService = new OfferService(math);
@@ -1553,33 +1595,33 @@ describe('offerService', () => {
1553
1595
  creditInsuranceFee: 0,
1554
1596
  gf: 18.8,
1555
1597
  gp: 10,
1556
- lifeInsuranceFee: 0.3133845,
1598
+ lifeInsuranceFee: 0.313365,
1557
1599
  propertyInsuranceFee: 0.364,
1558
1600
  unemploymentInsuranceFee: 0,
1559
- creditAmount: 1607.0999999758,
1601
+ creditAmount: 1607,
1560
1602
  credituAmount: 1762.4530000000002,
1561
1603
  approvedAmount: 1607.0999999758,
1562
1604
  approvedAmountFinanceCharge: 1608.3313023417,
1563
- creditInsurancePremium: 107.10000000000001,
1564
- installment: 7.965997103299999,
1605
+ creditInsurancePremium: 107.0933358239,
1606
+ installment: 7.9655014282,
1565
1607
  unitInstallment: 0.0049567526,
1566
1608
  approvedAmountIncomeDividend: 1608.3313023417,
1567
- backEndRatio: 0.5495966518000001,
1609
+ backEndRatio: 0.549563894,
1568
1610
  approvedAmountLoanToValue: 1607.0999999758,
1569
- financingAmount: 1500,
1570
- frontEndRatio: 0.5495966518000001,
1571
- loanToValueCredit: 0.80355,
1572
- loanToValueHome: 0.75,
1573
- totalFee: 8.643381603299998,
1574
- creditFee: 8.643381603299998,
1611
+ financingAmount: 1499.9066642003,
1612
+ frontEndRatio: 0.549563894,
1613
+ loanToValueCredit: 0.8035,
1614
+ loanToValueHome: 0.7499533321,
1615
+ totalFee: 8.6428664282,
1616
+ creditFee: 8.6428664282,
1575
1617
  propertyValue: 2000,
1576
1618
  monthlyInterestRate: 0.0035947364096048,
1577
1619
  amountRequestedByClient: 1645,
1578
1620
  operationalExpensesFee: 0,
1579
1621
  percentageOperationalExpensesFinanced: 18.8,
1580
- operationalExpenses: 25.016199999999998,
1622
+ operationalExpenses: 25.016,
1581
1623
  creditInsuranceFactor: 0.0714,
1582
- financingRatio: 0.9118541032999999
1624
+ financingRatio: 0.9117973643
1583
1625
  };
1584
1626
  const params: OfferParams = {
1585
1627
  maximumBackendRatio: 0.55, // Máximo de CF (L alpha)
@@ -1641,7 +1683,10 @@ describe('offerService', () => {
1641
1683
  numberOfGraceMonths: 0, // Meses de gracias(N)
1642
1684
  operationalExpensesFinancing: OperationalExpensesFinancing.DEBTOR,
1643
1685
  clientAge: null,
1644
- useDoublePayments: false
1686
+ useDoublePayments: false,
1687
+ district: undefined,
1688
+ isPropertyNew: undefined,
1689
+ prospectAge: undefined
1645
1690
  };
1646
1691
  const math = new MathService(true, 20);
1647
1692
  const offerService = new OfferService(math);
@@ -1662,25 +1707,25 @@ describe('offerService', () => {
1662
1707
  creditInsuranceFee: 0,
1663
1708
  gf: 1495,
1664
1709
  gp: 0,
1665
- lifeInsuranceFee: 175.01982498,
1710
+ lifeInsuranceFee: 175.02,
1666
1711
  propertyInsuranceFee: 30.555525,
1667
1712
  unemploymentInsuranceFee: 0,
1668
- creditAmount: 199999.80000000002,
1713
+ creditAmount: 200000,
1669
1714
  credituAmount: closeTo(200000.00000000003, 6) as any, // 200000.00000000003
1670
1715
  approvedAmount: 199999.80000000002,
1671
1716
  approvedAmountFinanceCharge: 221752.09972869532, // 259219.6004185969
1672
1717
  creditInsurancePremium: 0,
1673
- installment: 1826.7129732852002,
1718
+ installment: 1826.7148000000002,
1674
1719
  unitInstallment: 0.009133574,
1675
1720
  approvedAmountIncomeDividend: 271708.7673152308, // 299184.9344878252
1676
- backEndRatio: 0.5064576647, // 0.4422342406
1721
+ backEndRatio: 0.506458065,
1677
1722
  approvedAmountLoanToValue: 199999.80000000002,
1678
- financingAmount: 199999.80000000002,
1679
- frontEndRatio: 0.4064576647, // 0.3695069679
1680
- loanToValueCredit: 0.9,
1723
+ financingAmount: 200000.00000000006,
1724
+ frontEndRatio: 0.406458065,
1725
+ loanToValueCredit: 0.9000008999999999,
1681
1726
  loanToValueHome: 0.9,
1682
- totalFee: 2532.2883232652, // 2432.2883232652
1683
- creditFee: 2032.2883232652,
1727
+ totalFee: 2532.290325,
1728
+ creditFee: 2032.290325,
1684
1729
  propertyValue: 222222,
1685
1730
  monthlyInterestRate: 0.008734593820043001,
1686
1731
  amountRequestedByClient: closeTo(200000.00000000003, 6) as any, // 200000.00000000003
@@ -1688,7 +1733,7 @@ describe('offerService', () => {
1688
1733
  percentageOperationalExpensesFinanced: 1495,
1689
1734
  operationalExpenses: 1495,
1690
1735
  creditInsuranceFactor: 0,
1691
- financingRatio: 0.999999
1736
+ financingRatio: 1
1692
1737
  };
1693
1738
  const params: OfferParams = {
1694
1739
  maximumBackendRatio: 0.55, // Máximo de CF (L alpha)
@@ -1750,7 +1795,10 @@ describe('offerService', () => {
1750
1795
  numberOfGraceMonths: 0, // Meses de gracias(N)
1751
1796
  operationalExpensesFinancing: OperationalExpensesFinancing.DEBTOR,
1752
1797
  clientAge: undefined,
1753
- useDoublePayments: false
1798
+ useDoublePayments: false,
1799
+ district: undefined,
1800
+ isPropertyNew: undefined,
1801
+ prospectAge: undefined
1754
1802
  };
1755
1803
  const math = new MathService(true, 20);
1756
1804
  const offerService = new OfferService(math);