gemcap-be-common 1.5.12 → 1.5.13

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.5.12",
3
+ "version": "1.5.13",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -179,6 +179,7 @@ class LoanStatementService {
179
179
  await loanStatementEffectsService.saveMonthData(productId, statementDate);
180
180
  const charges = await this.loanChargesService.getLoanChargeForProduct(productId);
181
181
  const product = await this.loanChargesService.getLoanProductById(productId);
182
+ console.debug({ charges });
182
183
  // If product is already deactivated for this statement date (inclusive) — skip everything early
183
184
  if (product.deactivationDate && (0, dayjs_1.default)(statementDate).isSameOrAfter((0, dayjs_1.default)(product.deactivationDate))) {
184
185
  return;
@@ -292,8 +293,10 @@ class LoanStatementService {
292
293
  return fee;
293
294
  };
294
295
  fee = checkMinAmount(fee);
296
+ if (charge.chargeType === loan_charge_type_enum_1.ELoanChargeType.ADMIN_FEE) {
297
+ console.debug({ charge, statementDate, fee, isAfter: (0, dayjs_1.default)(statementDate).isSameOrAfter((0, dayjs_1.default)(charge.applyFrom)) });
298
+ }
295
299
  if (fee !== null && fee > 0) {
296
- console.debug({ charge, statementDate });
297
300
  if ((0, dayjs_1.default)(statementDate).isSameOrAfter((0, dayjs_1.default)(charge.applyFrom))) {
298
301
  const newStatement = {
299
302
  order: orderIndex,
@@ -219,6 +219,8 @@ export class LoanStatementService {
219
219
  const charges = await this.loanChargesService.getLoanChargeForProduct(productId);
220
220
  const product = await this.loanChargesService.getLoanProductById(productId);
221
221
 
222
+ console.debug({ charges });
223
+
222
224
  // If product is already deactivated for this statement date (inclusive) — skip everything early
223
225
  if (product.deactivationDate && dayjs(statementDate).isSameOrAfter(dayjs(product.deactivationDate))) {
224
226
  return;
@@ -339,8 +341,11 @@ export class LoanStatementService {
339
341
 
340
342
  fee = checkMinAmount(fee);
341
343
 
344
+ if (charge.chargeType === ELoanChargeType.ADMIN_FEE) {
345
+ console.debug({ charge, statementDate, fee, isAfter: dayjs(statementDate).isSameOrAfter(dayjs(charge.applyFrom)) });
346
+ }
347
+
342
348
  if (fee !== null && fee > 0) {
343
- console.debug({ charge, statementDate });
344
349
  if (dayjs(statementDate).isSameOrAfter(dayjs(charge.applyFrom))) {
345
350
  const newStatement: ILoanStatementTransaction = {
346
351
  order: orderIndex,