gemcap-be-common 1.5.149 → 1.5.151
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/microservice/events.constants.d.ts +4 -0
- package/microservice/events.constants.js +4 -0
- package/microservice/events.constants.ts +6 -0
- package/microservice/queues.constants.d.ts +3 -0
- package/microservice/queues.constants.js +3 -0
- package/microservice/queues.constants.ts +3 -0
- package/package.json +1 -1
- package/services/loan-transactions.service.js +2 -0
- package/services/loan-transactions.service.ts +3 -0
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -11,6 +11,10 @@ export declare const EVENT_KEYS: {
|
|
|
11
11
|
readonly MEMO_FILES_PREPARED: "ai.memo.files.prepared";
|
|
12
12
|
readonly MEMO_ANALYSIS_COMPLETED: "ai.memo.generation.completed";
|
|
13
13
|
readonly MEMO_ANALYSIS_FAILED: "ai.memo.generation.failed";
|
|
14
|
+
readonly ANALYSIS_REQUESTED: "ai.analysis.requested";
|
|
15
|
+
readonly ANALYSIS_FILES_PREPARED: "ai.analysis.files.prepared";
|
|
16
|
+
readonly ANALYSIS_COMPLETED: "ai.analysis.completed";
|
|
17
|
+
readonly ANALYSIS_FAILED: "ai.analysis.failed";
|
|
14
18
|
readonly JOB_CANCEL_REQUESTED: "ai.job.cancel.requested";
|
|
15
19
|
};
|
|
16
20
|
/**
|
|
@@ -14,6 +14,10 @@ exports.EVENT_KEYS = {
|
|
|
14
14
|
MEMO_FILES_PREPARED: 'ai.memo.files.prepared',
|
|
15
15
|
MEMO_ANALYSIS_COMPLETED: 'ai.memo.generation.completed',
|
|
16
16
|
MEMO_ANALYSIS_FAILED: 'ai.memo.generation.failed',
|
|
17
|
+
ANALYSIS_REQUESTED: 'ai.analysis.requested',
|
|
18
|
+
ANALYSIS_FILES_PREPARED: 'ai.analysis.files.prepared',
|
|
19
|
+
ANALYSIS_COMPLETED: 'ai.analysis.completed',
|
|
20
|
+
ANALYSIS_FAILED: 'ai.analysis.failed',
|
|
17
21
|
JOB_CANCEL_REQUESTED: 'ai.job.cancel.requested',
|
|
18
22
|
},
|
|
19
23
|
/**
|
|
@@ -11,6 +11,12 @@ export const EVENT_KEYS = {
|
|
|
11
11
|
MEMO_FILES_PREPARED: 'ai.memo.files.prepared',
|
|
12
12
|
MEMO_ANALYSIS_COMPLETED: 'ai.memo.generation.completed',
|
|
13
13
|
MEMO_ANALYSIS_FAILED: 'ai.memo.generation.failed',
|
|
14
|
+
|
|
15
|
+
ANALYSIS_REQUESTED: 'ai.analysis.requested',
|
|
16
|
+
ANALYSIS_FILES_PREPARED: 'ai.analysis.files.prepared',
|
|
17
|
+
ANALYSIS_COMPLETED: 'ai.analysis.completed',
|
|
18
|
+
ANALYSIS_FAILED: 'ai.analysis.failed',
|
|
19
|
+
|
|
14
20
|
JOB_CANCEL_REQUESTED: 'ai.job.cancel.requested',
|
|
15
21
|
},
|
|
16
22
|
|
package/package.json
CHANGED
|
@@ -542,6 +542,7 @@ class LoanTransactionsService {
|
|
|
542
542
|
floatedBalance = prevBeforeStart[0].floatedBalance || 0;
|
|
543
543
|
}
|
|
544
544
|
for (const tr of allTransactions) {
|
|
545
|
+
console.debug({ tr });
|
|
545
546
|
// regular balance recalculation
|
|
546
547
|
balance = new decimal_js_1.default(balance).add(tr.amount).toNumber();
|
|
547
548
|
// floatedBalance recalculation
|
|
@@ -559,6 +560,7 @@ class LoanTransactionsService {
|
|
|
559
560
|
}
|
|
560
561
|
await LoanTransaction_model_1.LoanTransaction.updateOne({ _id: tr._id }, { balance, floatedBalance });
|
|
561
562
|
}
|
|
563
|
+
console.debug('almost there');
|
|
562
564
|
await LoanProducts_model_1.LoanProduct.updateOne({ _id: startTransaction.productId }, { isBalanceActual: true, isFloatedBalanceActual: true });
|
|
563
565
|
}
|
|
564
566
|
async deleteLoanTransaction(transactionId, updateLoanPayment, userId = null) {
|
|
@@ -682,6 +682,7 @@ export class LoanTransactionsService {
|
|
|
682
682
|
}
|
|
683
683
|
|
|
684
684
|
for (const tr of allTransactions) {
|
|
685
|
+
console.debug({ tr })
|
|
685
686
|
// regular balance recalculation
|
|
686
687
|
balance = new Decimal(balance).add(tr.amount).toNumber();
|
|
687
688
|
|
|
@@ -705,6 +706,8 @@ export class LoanTransactionsService {
|
|
|
705
706
|
);
|
|
706
707
|
}
|
|
707
708
|
|
|
709
|
+
console.debug('almost there');
|
|
710
|
+
|
|
708
711
|
await LoanProduct.updateOne(
|
|
709
712
|
{ _id: startTransaction.productId },
|
|
710
713
|
{ isBalanceActual: true, isFloatedBalanceActual: true },
|