creditu-common-library 1.2.21 → 1.2.22

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.
@@ -19,8 +19,9 @@ var AmortizationService = /** @class */ (function () {
19
19
  // const condition1 = previousBalance * inflationaryUpperBound > IPCAupdate;
20
20
  var condition1 = this.math.multiply(previousBalance, inflationaryUpperBound) > this.math.subtract(IPCAupdate, amortizationDiff); // IPCAupdate - amortizationDiff
21
21
  if (!condition1) {
22
- // return this.math.round(this.math.subtract(this.math.multiply(previousBalance, inflationaryUpperBound), amortizationDiff), 2);
23
- return this.math.round(this.math.multiply(previousBalance, inflationaryUpperBound), 2);
22
+ // se reestablece el dia 25-03-2022 tras reunion con thais y el equipo, volviendo a resta la diferencia de amortizacion para este caso.
23
+ return this.math.round(this.math.subtract(this.math.multiply(previousBalance, inflationaryUpperBound), amortizationDiff), 2);
24
+ // return this.math.round(this.math.multiply(previousBalance, inflationaryUpperBound), 2);
24
25
  }
25
26
  return this.math.subtract(IPCAupdate, amortizationDiff);
26
27
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "creditu-common-library",
3
- "version": "1.2.21",
3
+ "version": "1.2.22",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "files": [
@@ -81,16 +81,16 @@ describe('installment-service for german method', () => {
81
81
  interestDiff: 1.56,
82
82
  interestIUB: 330.09,
83
83
  monthlyPayment: 205.268043176,
84
- monthlyPaymentWithInsurances: 875.20713637,
84
+ monthlyPaymentWithInsurances: 872.89713637,
85
85
  amortization: -123.261956824,
86
86
  amortizationDiff: 1.71,
87
87
  amortizationIUB: 361.70713637,
88
88
  postponedInflationaryUpdate: 483.259093194,
89
- amortizationIPCA: 129.6,
89
+ amortizationIPCA: 127.89,
90
90
  debtorLifeInsuranceFee: 44.21,
91
91
  codebtorLifeInsuranceFee: 0,
92
- propertyInsuranceFee: 9.6,
93
- monthlyPaymentWithLate: 875.20713637,
92
+ propertyInsuranceFee: 9,
93
+ monthlyPaymentWithLate: 872.89713637,
94
94
  lateCharges: 0,
95
95
  lateDays: 0,
96
96
  lateInterest: 0
@@ -103,7 +103,7 @@ describe('installment-service for german method', () => {
103
103
  const annualRate = 0.075;
104
104
  const debtorLifeInsuranceRate = new CreditInsuranceRate(0.00017);
105
105
  const inflationaryUpperBound = 0.001;
106
- const propertyAmount = 160000;
106
+ const propertyAmount = 150000;
107
107
  const propertyInsuranceRate = new CreditInsuranceRate(0.00003);
108
108
  const IPCAmap = {
109
109
  '2021-12-23': 0.0125,
@@ -126,7 +126,7 @@ describe('installment-service for german method', () => {
126
126
  propertyInsuranceRate
127
127
  };
128
128
  const result = service.getTotalMonthlyPayment(inputs, params);
129
- // console.log('file: installment.service.spec.ts ~ line 124 ~ result', result);
129
+ // console.log('file: installment.service.spec.ts ~ line 129 ~ result', result);
130
130
  expect(result).toEqual(expectedResult);
131
131
  });
132
132
  it('(WEDSON (Case 1 inflationaryUpperBound) should return the calculated installment', () => {
@@ -584,16 +584,16 @@ describe('installment-service for german method', () => {
584
584
  interestDiff: 7.24,
585
585
  interestIUB: 788.49,
586
586
  monthlyPayment: 592.5150255281,
587
- monthlyPaymentWithInsurances: 1824.9678071913,
587
+ monthlyPaymentWithInsurances: 1821.3378071913,
588
588
  amortizationIUB: 363.3378071913,
589
589
  amortization: -188.7349744719,
590
590
  amortizationDiff: 3.33,
591
591
  postponedInflationaryUpdate: 548.7427816632,
592
- amortizationIPCA: 646.2,
592
+ amortizationIPCA: 642.87,
593
593
  debtorLifeInsuranceFee: 22.14,
594
- propertyInsuranceFee: 4.8,
594
+ propertyInsuranceFee: 4.5,
595
595
  codebtorLifeInsuranceFee: 0,
596
- monthlyPaymentWithLate: 1824.9678071913,
596
+ monthlyPaymentWithLate: 1821.3378071913,
597
597
  lateCharges: 0,
598
598
  lateDays: 0,
599
599
  lateInterest: 0
@@ -601,11 +601,11 @@ describe('installment-service for german method', () => {
601
601
  const amortizationMethod = AmortizationMethod.GERMAN;
602
602
  const paymentNumber = new PaymentNumber(2);
603
603
  const numberOfMonths = new NumberOfMonths(360);
604
- const previousBalance = new PreviousBalance(129240);
604
+ const previousBalance = new PreviousBalance(129240.00);
605
605
  const annualRate = 0.075;
606
606
  const debtorLifeInsuranceRate = new CreditInsuranceRate(0.00017);
607
607
  const inflationaryUpperBound = 0.005;
608
- const propertyAmount = 160000;
608
+ const propertyAmount = 150000;
609
609
  const propertyInsuranceRate = new CreditInsuranceRate(0.00003);
610
610
  const IPCAmap = {
611
611
  '2021-01-05': 0.0095,
@@ -804,6 +804,7 @@ describe('installment-service for german method', () => {
804
804
  const result = service.getTotalMonthlyPayment(inputs, params);
805
805
  expect(result).toEqual(expectedResult);
806
806
  });
807
+ // anda bien
807
808
  it('WEDSON (Case internal backend) should return the calculated installment without dueLate', () => {
808
809
  const expectedResult = {
809
810
  IPCAByDates: [
@@ -906,16 +907,16 @@ describe('installment-service for german method', () => {
906
907
  interestDiff: 7.24,
907
908
  interestIUB: 788.49,
908
909
  monthlyPayment: 592.5150255281,
909
- monthlyPaymentWithInsurances: 1824.9678071913,
910
+ monthlyPaymentWithInsurances: 1821.3378071913,
910
911
  amortizationIUB: 363.3378071913,
911
912
  amortization: -188.7349744719,
912
913
  amortizationDiff: 3.33,
913
914
  postponedInflationaryUpdate: 548.7427816632,
914
- amortizationIPCA: 646.2,
915
+ amortizationIPCA: 642.87,
915
916
  debtorLifeInsuranceFee: 22.14,
916
- propertyInsuranceFee: 4.8,
917
+ propertyInsuranceFee: 4.5,
917
918
  codebtorLifeInsuranceFee: 0,
918
- monthlyPaymentWithLate: 1824.9678071913,
919
+ monthlyPaymentWithLate: 1821.3378071913,
919
920
  lateCharges: 0,
920
921
  lateDays: 0,
921
922
  lateInterest: 0
@@ -928,7 +929,7 @@ describe('installment-service for german method', () => {
928
929
  const annualRate = 0.075;
929
930
  const debtorLifeInsuranceRate = new CreditInsuranceRate(0.00017);
930
931
  const inflationaryUpperBound = 0.005;
931
- const propertyAmount = 160000;
932
+ const propertyAmount = 150000;
932
933
  const propertyInsuranceRate = new CreditInsuranceRate(0.00003);
933
934
  const IPCAmap = { '2022-01-05': 0.0095, '2022-02-05': 0.0073 };
934
935
  const inputs: DebtInputs = {
@@ -1313,7 +1314,7 @@ describe('installment-service for french method', () => {
1313
1314
  expect(result).toEqual(expectedResult);
1314
1315
  });
1315
1316
  // Falla en el cálculo de la amortizationIPC
1316
- it.skip('Sylvio (inflationaryUpperBound 0.0036, installment 1) should return the calculated installment', () => {
1317
+ it('Sylvio (inflationaryUpperBound 0.0036, installment 1) should return the calculated installment', () => {
1317
1318
  const expectedResult = {
1318
1319
  IPCAByDates: [
1319
1320
  { date: '2022-01-19', ipca: 0.0095, dailyIPCA: 0.0003050516 },
@@ -1337,29 +1338,29 @@ describe('installment-service for french method', () => {
1337
1338
  ],
1338
1339
  balanceValues: {
1339
1340
  balances: [
1340
- 1110063.303319699, 1110401.929906478,
1341
- 1110740.6597918393, 1111079.493007294,
1341
+ 1110063.303319699, 1110401.929906478,
1342
+ 1110740.6597918393, 1111079.493007294,
1342
1343
  1111418.4295843632, 1111757.4695545775,
1343
- 1112096.6129494773, 1112435.859800612,
1344
- 1112775.2101395417, 1113114.663997835,
1345
- 1113454.221407071, 1113793.882398838,
1344
+ 1112096.6129494773, 1112435.859800612,
1345
+ 1112775.2101395417, 1113114.663997835,
1346
+ 1113454.221407071, 1113793.882398838,
1346
1347
  1114083.2471632792, 1114372.6871049756,
1347
1348
  1114662.2022434582, 1114951.7925982631,
1348
- 1115241.458188932
1349
+ 1115241.458188932
1349
1350
  ],
1350
1351
  balanceMonetaryUpdateValues: [
1351
- 338.5233196986, 338.626586779,
1352
+ 338.5233196986, 338.626586779,
1352
1353
  338.7298853611, 338.8332154546,
1353
1354
  338.9365770691, 339.0399702142,
1354
1355
  339.1433948996, 339.2468511348,
1355
1356
  339.3503389296, 339.4538582934,
1356
- 339.557409236, 339.660991767,
1357
+ 339.557409236, 339.660991767,
1357
1358
  289.3647644411, 289.4399416963,
1358
1359
  289.5151384826, 289.5903548051,
1359
1360
  289.6655906688
1360
1361
  ],
1361
1362
  balanceUpperBoundMonetaryUpdateValues: [
1362
- 128.647286516, 128.6865305766,
1363
+ 128.647286516, 128.6865305766,
1363
1364
  128.7257866087, 128.7650546158,
1364
1365
  128.8043346018, 128.8436265701,
1365
1366
  128.8829305245, 128.9222464687,
@@ -1378,23 +1379,30 @@ describe('installment-service for french method', () => {
1378
1379
  210.5171429598, 210.5813615511,
1379
1380
  160.2457582775, 146.4486938228,
1380
1381
  146.4867413399, 146.5247987418,
1381
- 146.562866031
1382
+ 146.562866031
1382
1383
  ]
1383
1384
  },
1384
1385
  balanceInflationaryUpdated: 1115241.458188932,
1385
- balanceAfter: 1110381.427286398,
1386
+ balanceAfter: 1110377.1280783976,
1386
1387
  ipcaUpdate: 5516.6781889309,
1387
1388
  dailyRate: 0.0002009109,
1388
- interest: 3696.98,
1389
- monthlyPayment: 8557.0109025334,
1390
- // monthlyPaymentWithInsurances: 8785.6909025334,
1391
- monthlyPaymentWithInsurances: 9034.23,
1392
- amortization: 869.3209025334,
1393
- // amortizationIPCA: 3990.71,
1394
- amortizationIPCA: 4010.57,
1395
- debtorLifeInsuranceFee: 189.59,
1396
- propertyInsuranceFee: 39.09,
1397
- codebtorLifeInsuranceFee: 0
1389
+ interest: 3678.69,
1390
+ interestDiff: 18.29,
1391
+ interestIUB: 3696.98,
1392
+ monthlyPayment: 3026.3419216025,
1393
+ monthlyPaymentWithInsurances: 9013.8809025334,
1394
+ monthlyPaymentWithLate: 9013.8809025334,
1395
+ amortization: -652.3480783975,
1396
+ amortizationDiff: 4.3002021014,
1397
+ amortizationIUB: 869.3209025334,
1398
+ postponedInflationaryUpdate: 1517.3687788294997,
1399
+ amortizationIPCA: 3990.71,
1400
+ debtorLifeInsuranceFee: 378.69,
1401
+ codebtorLifeInsuranceFee: 0,
1402
+ propertyInsuranceFee: 78.18,
1403
+ lateDays: 0,
1404
+ lateInterest: 0,
1405
+ lateCharges: 0
1398
1406
  };
1399
1407
 
1400
1408
  const amortizationMethod = AmortizationMethod.FRENCH;
@@ -1402,10 +1410,10 @@ describe('installment-service for french method', () => {
1402
1410
  const numberOfMonths = new NumberOfMonths(360);
1403
1411
  const previousBalance = new PreviousBalance(1109724.78); //
1404
1412
  const annualRate = 0.0750;
1405
- const debtorLifeInsuranceRate = new CreditInsuranceRate(0.017);
1413
+ const debtorLifeInsuranceRate = new CreditInsuranceRate(0.00017);
1406
1414
  const inflationaryUpperBound = 0.0036;
1407
1415
  const propertyAmount = 1303000;
1408
- const propertyInsuranceRate = new CreditInsuranceRate(0.003);
1416
+ const propertyInsuranceRate = new CreditInsuranceRate(0.00003);
1409
1417
  const IPCAmap = { '2022-01-19': 0.0095, '2022-02-05': 0.0073 };
1410
1418
  const inputs: DebtInputs = {
1411
1419
  amortizationMethod,