gemcap-be-common 1.4.116 → 1.4.117

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.4.116",
3
+ "version": "1.4.117",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -777,6 +777,9 @@ class LoanStatementService {
777
777
  const borrower = await Borrower_model_1.BorrowerModel.findById(borrowerId).lean();
778
778
  const products = await this.loanChargesService.getLoanProducts(borrowerId);
779
779
  return await Promise.all(products.map(async (product) => {
780
+ if ((0, dayjs_1.default)(product.deactivationDate).isBefore((0, dayjs_1.default)(selectedDate))) {
781
+ return null;
782
+ }
780
783
  const relevantStatementEndMonth = fullMonth
781
784
  ? (0, dayjs_1.default)(selectedDate).utcOffset(0).startOf('month').subtract(1, 'seconds')
782
785
  : (0, dayjs_1.default)(selectedDate).utcOffset(0).endOf('month');
@@ -871,6 +871,9 @@ export class LoanStatementService {
871
871
  const borrower = await BorrowerModel.findById(borrowerId).lean();
872
872
  const products = await this.loanChargesService.getLoanProducts(borrowerId);
873
873
  return await Promise.all(products.map(async (product) => {
874
+ if (dayjs(product.deactivationDate).isBefore(dayjs(selectedDate))) {
875
+ return null;
876
+ }
874
877
  const relevantStatementEndMonth = fullMonth
875
878
  ? dayjs(selectedDate).utcOffset(0).startOf('month').subtract(1, 'seconds')
876
879
  : dayjs(selectedDate).utcOffset(0).endOf('month');