gemcap-be-common 1.5.27 → 1.5.29
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.
|
@@ -302,6 +302,7 @@ export interface IProspect extends IProspectBase, IProspectExternalNew {
|
|
|
302
302
|
};
|
|
303
303
|
closingPoints: number;
|
|
304
304
|
expectedLoanYield: number;
|
|
305
|
+
depositRequested: number;
|
|
305
306
|
state: string;
|
|
306
307
|
contacts: IProspectContact[];
|
|
307
308
|
underwriterIds: mongoose.Types.ObjectId[];
|
package/models/Prospect.model.js
CHANGED
|
@@ -455,6 +455,7 @@ exports.ProspectValidationSchema = joi_1.default.object({
|
|
|
455
455
|
industryId: joi_1.default.string().required(),
|
|
456
456
|
status: joi_1.default.string().valid(...Object.values(EProspectStatus)).required(),
|
|
457
457
|
probability: joi_1.default.number().required(),
|
|
458
|
+
depositRequested: joi_1.default.number().required(),
|
|
458
459
|
revolver: joi_1.default.object({
|
|
459
460
|
commitment: joi_1.default.number(),
|
|
460
461
|
expected: joi_1.default.number(),
|
|
@@ -625,6 +626,9 @@ exports.ProspectSchema = new mongoose_1.default.Schema({
|
|
|
625
626
|
expectedLoanYield: {
|
|
626
627
|
type: Number,
|
|
627
628
|
},
|
|
629
|
+
depositRequested: {
|
|
630
|
+
type: Number,
|
|
631
|
+
},
|
|
628
632
|
keyDates: {
|
|
629
633
|
lastContact: {
|
|
630
634
|
type: Date,
|
package/models/Prospect.model.ts
CHANGED
|
@@ -559,6 +559,7 @@ export interface IProspect extends IProspectBase, IProspectExternalNew {
|
|
|
559
559
|
},
|
|
560
560
|
closingPoints: number;
|
|
561
561
|
expectedLoanYield: number;
|
|
562
|
+
depositRequested: number;
|
|
562
563
|
state: string;
|
|
563
564
|
contacts: IProspectContact[];
|
|
564
565
|
underwriterIds: mongoose.Types.ObjectId[];
|
|
@@ -639,6 +640,7 @@ export const ProspectValidationSchema = Joi.object({
|
|
|
639
640
|
industryId: Joi.string().required(),
|
|
640
641
|
status: Joi.string().valid(...Object.values(EProspectStatus)).required(),
|
|
641
642
|
probability: Joi.number().required(),
|
|
643
|
+
depositRequested: Joi.number().required(),
|
|
642
644
|
revolver: Joi.object({
|
|
643
645
|
commitment: Joi.number(),
|
|
644
646
|
expected: Joi.number(),
|
|
@@ -815,6 +817,9 @@ export const ProspectSchema = new mongoose.Schema<IProspect, ProspectModel>(
|
|
|
815
817
|
expectedLoanYield: {
|
|
816
818
|
type: Number,
|
|
817
819
|
},
|
|
820
|
+
depositRequested: {
|
|
821
|
+
type: Number,
|
|
822
|
+
},
|
|
818
823
|
keyDates: {
|
|
819
824
|
lastContact: {
|
|
820
825
|
type: Date,
|
package/package.json
CHANGED
|
@@ -306,6 +306,7 @@ class ReportsService {
|
|
|
306
306
|
return await this.uploadsService.convertDataToFile([{ portfolio: reportToCovert }]);
|
|
307
307
|
}
|
|
308
308
|
async generateBankPortfolioSummary(borrowerIds, date, { useSignedBBC, useStoredBalance, } = { useSignedBBC: true, useStoredBalance: false }) {
|
|
309
|
+
const dateForBalance = dayjs_1.default.utc(date).endOf('day').toDate();
|
|
309
310
|
const productsGrouped = await Promise.all(borrowerIds.map(async (borrowerId) => {
|
|
310
311
|
const borrowerData = await this.getBorrowerAndProducts(borrowerId, date, useSignedBBC, false);
|
|
311
312
|
if (!borrowerData) {
|
|
@@ -341,7 +342,7 @@ class ReportsService {
|
|
|
341
342
|
startDate: product.startDate,
|
|
342
343
|
maturityDate: product.maturityDate,
|
|
343
344
|
NAISC: NAISCCode,
|
|
344
|
-
...(await this.getProductBalances(product._id.toString(), isRevolver,
|
|
345
|
+
...(await this.getProductBalances(product._id.toString(), isRevolver, dateForBalance)),
|
|
345
346
|
};
|
|
346
347
|
if (!summaries) {
|
|
347
348
|
return {
|
|
@@ -366,12 +367,12 @@ class ReportsService {
|
|
|
366
367
|
loanTermBalance: 0,
|
|
367
368
|
netTermAvailability: 0,
|
|
368
369
|
participantBalance: 0,
|
|
369
|
-
...(await this.getProductBalances(product._id.toString(), isRevolver,
|
|
370
|
+
...(await this.getProductBalances(product._id.toString(), isRevolver, dateForBalance)),
|
|
370
371
|
...productMainData,
|
|
371
372
|
};
|
|
372
373
|
}
|
|
373
374
|
else {
|
|
374
|
-
const balances = await this.getProductBalances(product._id.toString(), isRevolver,
|
|
375
|
+
const balances = await this.getProductBalances(product._id.toString(), isRevolver, dateForBalance);
|
|
375
376
|
if (useStoredBalance) {
|
|
376
377
|
const bbc = await this.collateralsService.getLatestBBC(borrowerId, date);
|
|
377
378
|
if (bbc) {
|
|
@@ -405,6 +405,7 @@ export class ReportsService {
|
|
|
405
405
|
useSignedBBC,
|
|
406
406
|
useStoredBalance,
|
|
407
407
|
} = { useSignedBBC: true, useStoredBalance: false }) {
|
|
408
|
+
const dateForBalance = dayjs.utc(date).endOf('day').toDate();
|
|
408
409
|
const productsGrouped = await Promise.all(borrowerIds.map(async (borrowerId) => {
|
|
409
410
|
const borrowerData = await this.getBorrowerAndProducts(borrowerId, date, useSignedBBC, false);
|
|
410
411
|
if (!borrowerData) {
|
|
@@ -444,7 +445,7 @@ export class ReportsService {
|
|
|
444
445
|
startDate: product.startDate,
|
|
445
446
|
maturityDate: product.maturityDate,
|
|
446
447
|
NAISC: NAISCCode,
|
|
447
|
-
...(await this.getProductBalances(product._id.toString(), isRevolver,
|
|
448
|
+
...(await this.getProductBalances(product._id.toString(), isRevolver, dateForBalance)),
|
|
448
449
|
};
|
|
449
450
|
if (!summaries) {
|
|
450
451
|
return {
|
|
@@ -470,12 +471,12 @@ export class ReportsService {
|
|
|
470
471
|
loanTermBalance: 0,
|
|
471
472
|
netTermAvailability: 0,
|
|
472
473
|
participantBalance: 0,
|
|
473
|
-
...(await this.getProductBalances(product._id.toString(), isRevolver,
|
|
474
|
+
...(await this.getProductBalances(product._id.toString(), isRevolver, dateForBalance)),
|
|
474
475
|
...productMainData,
|
|
475
476
|
} as IBankReportData;
|
|
476
477
|
} else {
|
|
477
478
|
|
|
478
|
-
const balances = await this.getProductBalances(product._id.toString(), isRevolver,
|
|
479
|
+
const balances = await this.getProductBalances(product._id.toString(), isRevolver, dateForBalance);
|
|
479
480
|
if (useStoredBalance) {
|
|
480
481
|
const bbc = await this.collateralsService.getLatestBBC(borrowerId, date);
|
|
481
482
|
if (bbc) {
|