gemcap-be-common 1.3.118 → 1.3.120

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.
@@ -28,6 +28,10 @@ export declare const EventMap: {
28
28
  readonly notification: {
29
29
  readonly SEND_EMAIL: "notification#SEND_EMAIL";
30
30
  };
31
+ readonly recalc: {
32
+ readonly UNLOCK_PRODUCT_BALANCE: "unlock_recalc#BALANCES";
33
+ readonly PRODUCT_BALANCE: "recalc#BALANCES";
34
+ };
31
35
  };
32
36
  export type EventMapType = typeof EventMap;
33
37
  export type EventName = EventMapType[keyof EventMapType][keyof EventMapType[keyof EventMapType]];
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.EventMap = void 0;
4
4
  exports.EventMap = {
5
5
  bank_uploaded_transactions: {
6
- CREATE: 'bank_uploaded_transactions#CREATE'
6
+ CREATE: 'bank_uploaded_transactions#CREATE',
7
7
  },
8
8
  database: {
9
9
  BACKUP: 'database#BACKUP',
@@ -31,4 +31,8 @@ exports.EventMap = {
31
31
  notification: {
32
32
  SEND_EMAIL: 'notification#SEND_EMAIL',
33
33
  },
34
+ recalc: {
35
+ UNLOCK_PRODUCT_BALANCE: 'unlock_recalc#BALANCES',
36
+ PRODUCT_BALANCE: 'recalc#BALANCES',
37
+ },
34
38
  };
@@ -1,6 +1,6 @@
1
1
  export const EventMap = {
2
2
  bank_uploaded_transactions: {
3
- CREATE: 'bank_uploaded_transactions#CREATE'
3
+ CREATE: 'bank_uploaded_transactions#CREATE',
4
4
  },
5
5
  database: {
6
6
  BACKUP: 'database#BACKUP',
@@ -28,6 +28,10 @@ export const EventMap = {
28
28
  notification: {
29
29
  SEND_EMAIL: 'notification#SEND_EMAIL',
30
30
  },
31
+ recalc: {
32
+ UNLOCK_PRODUCT_BALANCE: 'unlock_recalc#BALANCES',
33
+ PRODUCT_BALANCE: 'recalc#BALANCES',
34
+ },
31
35
  } as const;
32
36
 
33
37
  export type EventMapType = typeof EventMap;
@@ -0,0 +1,7 @@
1
+ export declare const QueueMap: {
2
+ readonly main: "goat_ms_queue";
3
+ readonly main_delay: "goat_ms_queue_delay";
4
+ readonly legacy: "goat_ms_legacy_queue";
5
+ };
6
+ export type QueueMapType = typeof QueueMap;
7
+ export type QueueName = QueueMapType[keyof QueueMapType][keyof QueueMapType[keyof QueueMapType]];
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.QueueMap = void 0;
4
+ exports.QueueMap = {
5
+ main: 'goat_ms_queue', // goat_ms_queue + goat_recalc
6
+ main_delay: 'goat_ms_queue_delay', // goat_recalc_delay
7
+ legacy: 'goat_ms_legacy_queue', // goat_legacy_queue
8
+ };
@@ -0,0 +1,8 @@
1
+ export const QueueMap = {
2
+ main: 'goat_ms_queue', // goat_ms_queue + goat_recalc
3
+ main_delay: 'goat_ms_queue_delay', // goat_recalc_delay
4
+ legacy: 'goat_ms_legacy_queue', // goat_legacy_queue
5
+ } as const;
6
+
7
+ export type QueueMapType = typeof QueueMap;
8
+ export type QueueName = QueueMapType[keyof QueueMapType][keyof QueueMapType[keyof QueueMapType]];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gemcap-be-common",
3
- "version": "1.3.118",
3
+ "version": "1.3.120",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -23,6 +23,8 @@ const LoanPayment_model_1 = require("../models/LoanPayment.model");
23
23
  const loan_products_db_1 = require("../db/loan-products.db");
24
24
  const loan_transactions_db_1 = require("../db/loan-transactions.db");
25
25
  const LoanTransactionFile_model_1 = require("../models/LoanTransactionFile.model");
26
+ const event_map_1 = require("../microservice/event-map");
27
+ const queue_map_1 = require("../microservice/queue-map");
26
28
  class LoanTransactionsService {
27
29
  attachedFilesService;
28
30
  banksService;
@@ -467,8 +469,8 @@ class LoanTransactionsService {
467
469
  async recalculateBalanceQueued(productId, transactionId) {
468
470
  await this.mainQueueService.sendTaskToQueue({
469
471
  data: { productId, transactionId },
470
- pattern: 'recalc#BALANCES',
471
- }, 'goat_recalc');
472
+ pattern: event_map_1.EventMap.recalc.BALANCES,
473
+ }, queue_map_1.QueueMap.main);
472
474
  }
473
475
  async recalculateBalance(transactionId) {
474
476
  const startTransaction = await LoanTransaction_model_1.LoanTransaction.findById(transactionId).lean();
@@ -52,6 +52,8 @@ import { TermLoanService } from './term-loan.service';
52
52
  import { LockService } from './lock.service';
53
53
  import { PostponedTransactionsService } from './postponed-transactions.service';
54
54
  import { MainQueueService } from './main-queue.service';
55
+ import { EventMap } from '../microservice/event-map';
56
+ import { QueueMap } from '../microservice/queue-map';
55
57
 
56
58
  interface ILoanTransactionsServiceConfig {
57
59
  portfolioEmail: string;
@@ -532,8 +534,8 @@ export class LoanTransactionsService {
532
534
  async recalculateBalanceQueued(productId: string, transactionId: string) {
533
535
  await this.mainQueueService.sendTaskToQueue({
534
536
  data: { productId, transactionId },
535
- pattern: 'recalc#BALANCES',
536
- }, 'goat_recalc');
537
+ pattern: EventMap.recalc.BALANCES,
538
+ }, QueueMap.main);
537
539
  }
538
540
 
539
541
  async recalculateBalance(transactionId: string) {