gemcap-be-common 1.3.124 → 1.3.126

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gemcap-be-common",
3
- "version": "1.3.124",
3
+ "version": "1.3.126",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -45,7 +45,7 @@ export declare class ComplianceBorrowersService {
45
45
  };
46
46
  };
47
47
  getFullComplianceBorrowerById(complianceBorrowerId: any): Promise<any>;
48
- getAllBorrowersShortened(userAccess: any): Promise<(Pick<IComplianceBorrowerDocument, "items" | "borrower" | "fundingStatus"> | {
48
+ getAllBorrowersShortened(userAccess: any): Promise<(Pick<IComplianceBorrowerDocument, "borrower" | "fundingStatus" | "items"> | {
49
49
  items: {
50
50
  instances: any[];
51
51
  item: import("../models/ComplianceItem.model").IComplianceItemDocument;
@@ -85,6 +85,8 @@ export declare class LoanPaymentsService {
85
85
  productTotals: {
86
86
  [productId: string]: number;
87
87
  };
88
+ revolverBalance: number;
89
+ termBalance: number;
88
90
  }[];
89
91
  isCalculated: boolean;
90
92
  }>;
@@ -415,6 +415,8 @@ class LoanPaymentsService {
415
415
  borrowerTitle: borrower.name,
416
416
  totalDue: dueAmounts.total,
417
417
  productTotals: dueAmounts.productTotals,
418
+ revolverBalance: dueAmounts.revolverBalance,
419
+ termBalance: dueAmounts.termBalance,
418
420
  };
419
421
  }));
420
422
  return { borrowers: borrowersData, isCalculated: !!isCalculated };
@@ -462,6 +462,8 @@ export class LoanPaymentsService {
462
462
  borrowerTitle: borrower.name,
463
463
  totalDue: dueAmounts.total,
464
464
  productTotals: dueAmounts.productTotals,
465
+ revolverBalance: dueAmounts.revolverBalance,
466
+ termBalance: dueAmounts.termBalance,
465
467
  };
466
468
  }),
467
469
  );
@@ -166,8 +166,8 @@ export declare class LoanStatementService {
166
166
  total: number;
167
167
  totalPaid: number;
168
168
  dueDate: any;
169
- balanceRevolver: number;
170
- balanceTerm: number;
169
+ revolverBalance: number;
170
+ termBalance: number;
171
171
  }>;
172
172
  private getOutstandingStatements;
173
173
  getOutstandingStatementsExcel(borrowerIds: string[], selectedDate: Date, fullMonth: boolean): Promise<any>;
@@ -178,8 +178,8 @@ export declare class LoanStatementService {
178
178
  total: number;
179
179
  totalPaid: number;
180
180
  dueDate: any;
181
- balanceRevolver: number;
182
- balanceTerm: number;
181
+ revolverBalance: number;
182
+ termBalance: number;
183
183
  }>;
184
184
  getProductsTotals(productIds: string[]): Promise<{
185
185
  [productId: string]: number;
@@ -723,18 +723,18 @@ class LoanStatementService {
723
723
  total: 0,
724
724
  totalPaid: 0,
725
725
  dueDate: null,
726
- balanceRevolver: 0,
727
- balanceTerm: 0,
726
+ revolverBalance: 0,
727
+ termBalance: 0,
728
728
  };
729
729
  await Promise.all(products.map(async (product) => {
730
730
  const lastTransaction = await this.loanTransactionsService.getLastTransactionForDate(product._id.toString(), end.toDate());
731
731
  if (lastTransaction) {
732
732
  switch (product.type) {
733
- case loan_types_enum_1.ELoanTypes.TERM: {
734
- data.balanceTerm = lastTransaction.balance ?? 0;
735
- }
736
733
  case loan_types_enum_1.ELoanTypes.REVOLVER: {
737
- data.balanceRevolver = lastTransaction.balance ?? 0;
734
+ data.revolverBalance = lastTransaction.balance ?? 0;
735
+ }
736
+ case loan_types_enum_1.ELoanTypes.TERM: {
737
+ data.termBalance = lastTransaction.balance ?? 0;
738
738
  }
739
739
  }
740
740
  }
@@ -816,18 +816,18 @@ export class LoanStatementService {
816
816
  total: 0,
817
817
  totalPaid: 0,
818
818
  dueDate: null,
819
- balanceRevolver: 0,
820
- balanceTerm: 0,
819
+ revolverBalance: 0,
820
+ termBalance: 0,
821
821
  };
822
822
  await Promise.all(products.map(async (product) => {
823
823
  const lastTransaction = await this.loanTransactionsService.getLastTransactionForDate(product._id.toString(), end.toDate());
824
824
  if (lastTransaction) {
825
825
  switch (product.type) {
826
- case ELoanTypes.TERM: {
827
- data.balanceTerm = lastTransaction.balance ?? 0;
828
- }
829
826
  case ELoanTypes.REVOLVER: {
830
- data.balanceRevolver = lastTransaction.balance ?? 0;
827
+ data.revolverBalance = lastTransaction.balance ?? 0;
828
+ }
829
+ case ELoanTypes.TERM: {
830
+ data.termBalance = lastTransaction.balance ?? 0;
831
831
  }
832
832
  }
833
833
  }