gemcap-be-common 1.5.18 → 1.5.19
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 +1 -1
- package/services/compliance-borrowers.service.d.ts +1 -1
- package/services/loan-payments.service.d.ts +1 -1
- package/services/loan-payments.service.js +3 -3
- package/services/loan-payments.service.ts +3 -3
- package/services/loan-statement.service.d.ts +1 -1
- package/services/loan-statement.service.js +2 -2
- package/services/loan-statement.service.ts +2 -2
- package/tsconfig.tsbuildinfo +1 -1
package/package.json
CHANGED
|
@@ -45,7 +45,7 @@ export declare class ComplianceBorrowersService {
|
|
|
45
45
|
};
|
|
46
46
|
};
|
|
47
47
|
getFullComplianceBorrowerById(complianceBorrowerId: string): Promise<any>;
|
|
48
|
-
getAllBorrowersShortened(userAccess: IUserAccess): Promise<(Pick<IComplianceBorrowerWithBorrower, "
|
|
48
|
+
getAllBorrowersShortened(userAccess: IUserAccess): Promise<(Pick<IComplianceBorrowerWithBorrower, "items" | "borrower" | "fundingStatus"> | {
|
|
49
49
|
items: {
|
|
50
50
|
instances: any[];
|
|
51
51
|
item: import("../models/ComplianceItem.model").IComplianceItemDocument;
|
|
@@ -79,7 +79,7 @@ export declare class LoanPaymentsService {
|
|
|
79
79
|
success: boolean;
|
|
80
80
|
message: string;
|
|
81
81
|
}>;
|
|
82
|
-
getExpectedPayments(userId: string): Promise<any[] | {
|
|
82
|
+
getExpectedPayments(userId: string, forDate: Date): Promise<any[] | {
|
|
83
83
|
borrowers: {
|
|
84
84
|
borrowerId: string;
|
|
85
85
|
borrowerTitle: string;
|
|
@@ -400,7 +400,7 @@ class LoanPaymentsService {
|
|
|
400
400
|
console.error(e);
|
|
401
401
|
}
|
|
402
402
|
}
|
|
403
|
-
async getExpectedPayments(userId) {
|
|
403
|
+
async getExpectedPayments(userId, forDate) {
|
|
404
404
|
const user = await this.usersService.getUserById(userId);
|
|
405
405
|
if (!user) {
|
|
406
406
|
return [];
|
|
@@ -411,7 +411,7 @@ class LoanPaymentsService {
|
|
|
411
411
|
.filter((borrower) => borrower.active)
|
|
412
412
|
.map(async (borrower) => {
|
|
413
413
|
const loanStatementService = this.getLoanStatementService();
|
|
414
|
-
const dueAmounts = await loanStatementService.getBorrowerProductTotals(borrower._id.toString());
|
|
414
|
+
const dueAmounts = await loanStatementService.getBorrowerProductTotals(borrower._id.toString(), forDate);
|
|
415
415
|
return {
|
|
416
416
|
borrowerId: borrower._id.toString(),
|
|
417
417
|
borrowerTitle: borrower.name,
|
|
@@ -442,7 +442,7 @@ class LoanPaymentsService {
|
|
|
442
442
|
const borrowerProducts = await this.loanChargesService.getLoanProducts(borrower._id.toString());
|
|
443
443
|
const revolverProduct = borrowerProducts.find((product) => product.type === loan_types_enum_1.ELoanTypes.REVOLVER && (0, date_helper_1.isProductActive)(product.startDate, product.deactivationDate, selectedDate));
|
|
444
444
|
const loanStatementService = this.getLoanStatementService();
|
|
445
|
-
const dueAmounts = await loanStatementService.getBorrowerProductTotals(borrower._id.toString());
|
|
445
|
+
const dueAmounts = await loanStatementService.getBorrowerProductTotals(borrower._id.toString(), selectedDate);
|
|
446
446
|
if (dueAmounts.total === 0) {
|
|
447
447
|
console.log('no payment for this borrower');
|
|
448
448
|
return;
|
|
@@ -447,7 +447,7 @@ export class LoanPaymentsService {
|
|
|
447
447
|
}
|
|
448
448
|
}
|
|
449
449
|
|
|
450
|
-
async getExpectedPayments(userId: string) {
|
|
450
|
+
async getExpectedPayments(userId: string, forDate: Date) {
|
|
451
451
|
const user = await this.usersService.getUserById(userId);
|
|
452
452
|
if (!user) {
|
|
453
453
|
return [];
|
|
@@ -458,7 +458,7 @@ export class LoanPaymentsService {
|
|
|
458
458
|
.filter((borrower) => borrower.active)
|
|
459
459
|
.map(async (borrower) => {
|
|
460
460
|
const loanStatementService = this.getLoanStatementService();
|
|
461
|
-
const dueAmounts = await loanStatementService.getBorrowerProductTotals(borrower._id.toString());
|
|
461
|
+
const dueAmounts = await loanStatementService.getBorrowerProductTotals(borrower._id.toString(), forDate);
|
|
462
462
|
return {
|
|
463
463
|
borrowerId: borrower._id.toString(),
|
|
464
464
|
borrowerTitle: borrower.name,
|
|
@@ -493,7 +493,7 @@ export class LoanPaymentsService {
|
|
|
493
493
|
const borrowerProducts = await this.loanChargesService.getLoanProducts(borrower._id.toString());
|
|
494
494
|
const revolverProduct = borrowerProducts.find((product) => product.type === ELoanTypes.REVOLVER && isProductActive(product.startDate, product.deactivationDate, selectedDate));
|
|
495
495
|
const loanStatementService = this.getLoanStatementService();
|
|
496
|
-
const dueAmounts = await loanStatementService.getBorrowerProductTotals(borrower._id.toString());
|
|
496
|
+
const dueAmounts = await loanStatementService.getBorrowerProductTotals(borrower._id.toString(), selectedDate);
|
|
497
497
|
if (dueAmounts.total === 0) {
|
|
498
498
|
console.log('no payment for this borrower');
|
|
499
499
|
return;
|
|
@@ -173,7 +173,7 @@ export declare class LoanStatementService {
|
|
|
173
173
|
}>;
|
|
174
174
|
private getOutstandingStatements;
|
|
175
175
|
getOutstandingStatementsExcel(borrowerIds: string[], selectedDate: Date, fullMonth: boolean): Promise<any>;
|
|
176
|
-
getBorrowerProductTotals(borrowerId: string): Promise<{
|
|
176
|
+
getBorrowerProductTotals(borrowerId: string, forDate: Date): Promise<{
|
|
177
177
|
productTotals: {
|
|
178
178
|
[productId: string]: number;
|
|
179
179
|
};
|
|
@@ -889,8 +889,8 @@ class LoanStatementService {
|
|
|
889
889
|
});
|
|
890
890
|
return await this.uploadsService.convertDataToFile([{ data: [...header, ...onlyData] }]);
|
|
891
891
|
}
|
|
892
|
-
async getBorrowerProductTotals(borrowerId) {
|
|
893
|
-
return await this.getBorrowerComplianceData(borrowerId,
|
|
892
|
+
async getBorrowerProductTotals(borrowerId, forDate) {
|
|
893
|
+
return await this.getBorrowerComplianceData(borrowerId, forDate);
|
|
894
894
|
}
|
|
895
895
|
async getProductsTotals(productIds) {
|
|
896
896
|
const totals = {};
|
|
@@ -992,8 +992,8 @@ export class LoanStatementService {
|
|
|
992
992
|
return await this.uploadsService.convertDataToFile([{ data: [...header, ...onlyData] }]);
|
|
993
993
|
}
|
|
994
994
|
|
|
995
|
-
async getBorrowerProductTotals(borrowerId: string) {
|
|
996
|
-
return await this.getBorrowerComplianceData(borrowerId,
|
|
995
|
+
async getBorrowerProductTotals(borrowerId: string, forDate: Date) {
|
|
996
|
+
return await this.getBorrowerComplianceData(borrowerId, forDate);
|
|
997
997
|
}
|
|
998
998
|
|
|
999
999
|
async getProductsTotals(productIds: string[]) {
|