gemcap-be-common 1.5.12 → 1.5.14

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.14",
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;
@@ -188,6 +189,7 @@ class LoanStatementService {
188
189
  let orderIndex = 0;
189
190
  for (const charge of charges) {
190
191
  if (charge.applyFrom.getTime() > statementDate.getTime()) {
192
+ console.debug('skipping', { charge, statementDate });
191
193
  return;
192
194
  }
193
195
  const statementDateFormat = (0, dayjs_1.default)(statementDate).format('YYYY-MM-DD');
@@ -292,8 +294,8 @@ class LoanStatementService {
292
294
  return fee;
293
295
  };
294
296
  fee = checkMinAmount(fee);
297
+ console.debug({ charge, statementDate, fee, isAfter: (0, dayjs_1.default)(statementDate).isSameOrAfter((0, dayjs_1.default)(charge.applyFrom)) });
295
298
  if (fee !== null && fee > 0) {
296
- console.debug({ charge, statementDate });
297
299
  if ((0, dayjs_1.default)(statementDate).isSameOrAfter((0, dayjs_1.default)(charge.applyFrom))) {
298
300
  const newStatement = {
299
301
  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;
@@ -229,6 +231,7 @@ export class LoanStatementService {
229
231
  let orderIndex = 0;
230
232
  for (const charge of charges) {
231
233
  if (charge.applyFrom.getTime() > statementDate.getTime()) {
234
+ console.debug('skipping', { charge, statementDate });
232
235
  return;
233
236
  }
234
237
  const statementDateFormat = dayjs(statementDate).format('YYYY-MM-DD');
@@ -339,8 +342,9 @@ export class LoanStatementService {
339
342
 
340
343
  fee = checkMinAmount(fee);
341
344
 
345
+ console.debug({ charge, statementDate, fee, isAfter: dayjs(statementDate).isSameOrAfter(dayjs(charge.applyFrom)) });
346
+
342
347
  if (fee !== null && fee > 0) {
343
- console.debug({ charge, statementDate });
344
348
  if (dayjs(statementDate).isSameOrAfter(dayjs(charge.applyFrom))) {
345
349
  const newStatement: ILoanStatementTransaction = {
346
350
  order: orderIndex,