gemcap-be-common 1.3.107 → 1.3.109
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 +1 -1
- package/services/loan-transactions.service.js +7 -7
- package/services/loan-transactions.service.ts +7 -8
- package/tsconfig.tsbuildinfo +1 -1
- package/services/crm-prospects.service.d.ts +0 -4
- package/services/crm-prospects.service.js +0 -67
- package/services/crm-prospects.service.ts +0 -79
package/package.json
CHANGED
|
@@ -266,12 +266,9 @@ class LoanTransactionsService {
|
|
|
266
266
|
earliestTransactionIds.set(productId, { transactionId, date });
|
|
267
267
|
}
|
|
268
268
|
});
|
|
269
|
-
const
|
|
270
|
-
.
|
|
271
|
-
|
|
272
|
-
await Promise.all(earliestTransactionIdsList.map(async (transactionId) => {
|
|
273
|
-
setTimeout(async () => await this.recalculateBalanceQueued(null, transactionId));
|
|
274
|
-
}));
|
|
269
|
+
for (const [productId, values] of earliestTransactionIds) {
|
|
270
|
+
await this.recalculateBalanceQueued(productId, values.transactionId);
|
|
271
|
+
}
|
|
275
272
|
}
|
|
276
273
|
async normalizeLoanTransaction(transaction, userId) {
|
|
277
274
|
transaction.effectiveDate = await this.calculateEffectiveDate(transaction);
|
|
@@ -468,7 +465,10 @@ class LoanTransactionsService {
|
|
|
468
465
|
await recalcFloatedBalance();
|
|
469
466
|
}
|
|
470
467
|
async recalculateBalanceQueued(productId, transactionId) {
|
|
471
|
-
await this.mainQueueService.sendTaskToQueue({
|
|
468
|
+
await this.mainQueueService.sendTaskToQueue({
|
|
469
|
+
data: { productId, transactionId },
|
|
470
|
+
pattern: 'recalc#BALANCES',
|
|
471
|
+
}, 'goat_recalc');
|
|
472
472
|
}
|
|
473
473
|
async recalculateBalance(transactionId) {
|
|
474
474
|
const startTransaction = await LoanTransaction_model_1.LoanTransaction.findById(transactionId).lean();
|
|
@@ -319,13 +319,9 @@ export class LoanTransactionsService {
|
|
|
319
319
|
}
|
|
320
320
|
});
|
|
321
321
|
|
|
322
|
-
const
|
|
323
|
-
.
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
await Promise.all(earliestTransactionIdsList.map(async (transactionId) => {
|
|
327
|
-
setTimeout(async () => await this.recalculateBalanceQueued(null, transactionId));
|
|
328
|
-
}));
|
|
322
|
+
for (const [productId, values] of earliestTransactionIds) {
|
|
323
|
+
await this.recalculateBalanceQueued(productId, values.transactionId);
|
|
324
|
+
}
|
|
329
325
|
}
|
|
330
326
|
|
|
331
327
|
async normalizeLoanTransaction(transaction: ILoanTransactionDoc, userId: string) {
|
|
@@ -534,7 +530,10 @@ export class LoanTransactionsService {
|
|
|
534
530
|
}
|
|
535
531
|
|
|
536
532
|
async recalculateBalanceQueued(productId: string, transactionId: string) {
|
|
537
|
-
await this.mainQueueService.sendTaskToQueue({
|
|
533
|
+
await this.mainQueueService.sendTaskToQueue({
|
|
534
|
+
data: { productId, transactionId },
|
|
535
|
+
pattern: 'recalc#BALANCES',
|
|
536
|
+
}, 'goat_recalc');
|
|
538
537
|
}
|
|
539
538
|
|
|
540
539
|
async recalculateBalance(transactionId: string) {
|