gemcap-be-common 1.5.4 → 1.5.6
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/models/LoanProducts.model.d.ts +16 -16
- package/models/LoanProducts.model.ts +1 -1
- package/package.json +1 -1
- package/services/borrowers.service.d.ts +2 -2
- package/services/loan-transactions.service.d.ts +1 -1
- package/services/pdf.service.js +2 -1
- package/services/pdf.service.ts +3 -1
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -47,7 +47,7 @@ export interface ILoanProduct {
|
|
|
47
47
|
settlementCode: string;
|
|
48
48
|
isDefaultPaymentOrder: boolean;
|
|
49
49
|
calculationRequired: boolean;
|
|
50
|
-
deactivationDate?: Date;
|
|
50
|
+
deactivationDate?: Date | null;
|
|
51
51
|
}
|
|
52
52
|
export interface ILoanProductDoc extends ILoanProduct, mongoose.Document {
|
|
53
53
|
_id: mongoose.Types.ObjectId;
|
|
@@ -81,12 +81,12 @@ export declare const LoanProductSchema: mongoose.Schema<any, mongoose.Model<any,
|
|
|
81
81
|
createdAt: NativeDate;
|
|
82
82
|
updatedAt: NativeDate;
|
|
83
83
|
} & {
|
|
84
|
-
|
|
85
|
-
name: string;
|
|
84
|
+
borrowerId: mongoose.Types.ObjectId;
|
|
86
85
|
order: number;
|
|
87
86
|
active: boolean;
|
|
88
|
-
borrowerId: mongoose.Types.ObjectId;
|
|
89
87
|
code: string;
|
|
88
|
+
name: string;
|
|
89
|
+
type: string;
|
|
90
90
|
startDate: Date;
|
|
91
91
|
maturityDate: Date;
|
|
92
92
|
commitment: number;
|
|
@@ -94,25 +94,25 @@ export declare const LoanProductSchema: mongoose.Schema<any, mongoose.Model<any,
|
|
|
94
94
|
isFloatedBalanceActual: boolean;
|
|
95
95
|
isParticipant: boolean;
|
|
96
96
|
isDefaultPaymentOrder: boolean;
|
|
97
|
-
__v?: number;
|
|
98
|
-
settlementCode?: string;
|
|
99
97
|
masterCode?: string;
|
|
100
98
|
payoffDate?: Date;
|
|
101
99
|
minPercent?: number;
|
|
102
100
|
maxPercent?: number;
|
|
103
101
|
prepaymentDate?: Date;
|
|
104
102
|
prepaymentTerms?: string;
|
|
103
|
+
settlementCode?: string;
|
|
105
104
|
deactivationDate?: Date;
|
|
105
|
+
__v?: number;
|
|
106
106
|
}, mongoose.Document<unknown, {}, mongoose.FlatRecord<{
|
|
107
107
|
createdAt: NativeDate;
|
|
108
108
|
updatedAt: NativeDate;
|
|
109
109
|
} & {
|
|
110
|
-
|
|
111
|
-
name: string;
|
|
110
|
+
borrowerId: mongoose.Types.ObjectId;
|
|
112
111
|
order: number;
|
|
113
112
|
active: boolean;
|
|
114
|
-
borrowerId: mongoose.Types.ObjectId;
|
|
115
113
|
code: string;
|
|
114
|
+
name: string;
|
|
115
|
+
type: string;
|
|
116
116
|
startDate: Date;
|
|
117
117
|
maturityDate: Date;
|
|
118
118
|
commitment: number;
|
|
@@ -120,25 +120,25 @@ export declare const LoanProductSchema: mongoose.Schema<any, mongoose.Model<any,
|
|
|
120
120
|
isFloatedBalanceActual: boolean;
|
|
121
121
|
isParticipant: boolean;
|
|
122
122
|
isDefaultPaymentOrder: boolean;
|
|
123
|
-
__v?: number;
|
|
124
|
-
settlementCode?: string;
|
|
125
123
|
masterCode?: string;
|
|
126
124
|
payoffDate?: Date;
|
|
127
125
|
minPercent?: number;
|
|
128
126
|
maxPercent?: number;
|
|
129
127
|
prepaymentDate?: Date;
|
|
130
128
|
prepaymentTerms?: string;
|
|
129
|
+
settlementCode?: string;
|
|
131
130
|
deactivationDate?: Date;
|
|
131
|
+
__v?: number;
|
|
132
132
|
}>> & mongoose.FlatRecord<{
|
|
133
133
|
createdAt: NativeDate;
|
|
134
134
|
updatedAt: NativeDate;
|
|
135
135
|
} & {
|
|
136
|
-
|
|
137
|
-
name: string;
|
|
136
|
+
borrowerId: mongoose.Types.ObjectId;
|
|
138
137
|
order: number;
|
|
139
138
|
active: boolean;
|
|
140
|
-
borrowerId: mongoose.Types.ObjectId;
|
|
141
139
|
code: string;
|
|
140
|
+
name: string;
|
|
141
|
+
type: string;
|
|
142
142
|
startDate: Date;
|
|
143
143
|
maturityDate: Date;
|
|
144
144
|
commitment: number;
|
|
@@ -146,15 +146,15 @@ export declare const LoanProductSchema: mongoose.Schema<any, mongoose.Model<any,
|
|
|
146
146
|
isFloatedBalanceActual: boolean;
|
|
147
147
|
isParticipant: boolean;
|
|
148
148
|
isDefaultPaymentOrder: boolean;
|
|
149
|
-
__v?: number;
|
|
150
|
-
settlementCode?: string;
|
|
151
149
|
masterCode?: string;
|
|
152
150
|
payoffDate?: Date;
|
|
153
151
|
minPercent?: number;
|
|
154
152
|
maxPercent?: number;
|
|
155
153
|
prepaymentDate?: Date;
|
|
156
154
|
prepaymentTerms?: string;
|
|
155
|
+
settlementCode?: string;
|
|
157
156
|
deactivationDate?: Date;
|
|
157
|
+
__v?: number;
|
|
158
158
|
}> & {
|
|
159
159
|
_id: mongoose.Types.ObjectId;
|
|
160
160
|
}>;
|
|
@@ -26,7 +26,7 @@ export interface ILoanProduct {
|
|
|
26
26
|
settlementCode: string;
|
|
27
27
|
isDefaultPaymentOrder: boolean;
|
|
28
28
|
calculationRequired: boolean;
|
|
29
|
-
deactivationDate?: Date;
|
|
29
|
+
deactivationDate?: Date | null;
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
export interface ILoanProductDoc extends ILoanProduct, mongoose.Document {
|
package/package.json
CHANGED
|
@@ -84,10 +84,10 @@ export declare class BorrowerService {
|
|
|
84
84
|
getBorrowerCodesMap(): Promise<Map<string, string>>;
|
|
85
85
|
getBorrowerStatementDetails(borrowers: IBorrowerDoc[]): Promise<{
|
|
86
86
|
[x: string]: {
|
|
87
|
-
SELECTED_PERIOD?: boolean;
|
|
88
|
-
ENTIRE_LOAN?: boolean;
|
|
89
87
|
LAST_MONTH?: boolean;
|
|
90
88
|
CURRENT_MONTH?: boolean;
|
|
89
|
+
ENTIRE_LOAN?: boolean;
|
|
90
|
+
SELECTED_PERIOD?: boolean;
|
|
91
91
|
TERM_LOAN?: boolean;
|
|
92
92
|
};
|
|
93
93
|
}>;
|
|
@@ -155,7 +155,7 @@ export declare class LoanTransactionsService {
|
|
|
155
155
|
getTransactionReport(transactionIds: string[], borrowerId: string, effectiveDate: Date): Promise<{
|
|
156
156
|
transactionIdsToMark: string[];
|
|
157
157
|
transactions: {
|
|
158
|
-
[x: string]: (string | number | string[]
|
|
158
|
+
[x: string]: (string | number | Date | string[])[];
|
|
159
159
|
}[];
|
|
160
160
|
}>;
|
|
161
161
|
getBorrowerIdsForFile(transactionFileId: string): Promise<{
|
package/services/pdf.service.js
CHANGED
|
@@ -236,11 +236,12 @@ class PdfService {
|
|
|
236
236
|
}],
|
|
237
237
|
[{ text: 'Commitment amount' }, { text: (0, numbers_helper_1.formatNumbers)(product.commitment), alignment: 'right' }],
|
|
238
238
|
];
|
|
239
|
+
const endDate = dayjs_1.default.utc(product.deactivationDate).isBefore(dayjs_1.default.utc(end)) ? dayjs_1.default.utc(product.deactivationDate) : dayjs_1.default.utc(end);
|
|
239
240
|
const preparedStatementHeader = [
|
|
240
241
|
{ text: `STATEMENT FOR PRODUCT: ${product.name}`, bold: true },
|
|
241
242
|
{ text: `Client: ${borrower.code}`, bold: true },
|
|
242
243
|
{
|
|
243
|
-
text: `PERIOD FROM ${
|
|
244
|
+
text: `PERIOD FROM ${dayjs_1.default.utc(start).format(defaultDateFormat)} TO ${endDate.format(defaultDateFormat)}`,
|
|
244
245
|
bold: true,
|
|
245
246
|
},
|
|
246
247
|
{
|
package/services/pdf.service.ts
CHANGED
|
@@ -272,11 +272,13 @@ export class PdfService {
|
|
|
272
272
|
[{ text: 'Commitment amount' }, { text: formatNumbers(product.commitment), alignment: 'right' }],
|
|
273
273
|
];
|
|
274
274
|
|
|
275
|
+
const endDate = dayjs.utc(product.deactivationDate).isBefore(dayjs.utc(end)) ? dayjs.utc(product.deactivationDate) : dayjs.utc(end);
|
|
276
|
+
|
|
275
277
|
const preparedStatementHeader = [
|
|
276
278
|
{ text: `STATEMENT FOR PRODUCT: ${product.name}`, bold: true },
|
|
277
279
|
{ text: `Client: ${borrower.code}`, bold: true },
|
|
278
280
|
{
|
|
279
|
-
text: `PERIOD FROM ${dayjs(start
|
|
281
|
+
text: `PERIOD FROM ${dayjs.utc(start).format(defaultDateFormat)} TO ${endDate.format(defaultDateFormat)}`,
|
|
280
282
|
bold: true,
|
|
281
283
|
},
|
|
282
284
|
{
|