gemcap-be-common 1.4.253 → 1.4.255

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.
@@ -1,5 +1,6 @@
1
1
  export declare const MESSAGE_CHANNELS: {
2
2
  readonly AI: "ai.exchange";
3
+ readonly AUTH: "auth.exchange";
3
4
  readonly COMPLIANCE: "compliance.exchange";
4
5
  readonly CRM: "crm.exchange";
5
6
  readonly FINANCE: "finance.exchange";
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.MESSAGE_CHANNELS = void 0;
4
4
  exports.MESSAGE_CHANNELS = {
5
5
  AI: 'ai.exchange',
6
+ AUTH: 'auth.exchange',
6
7
  COMPLIANCE: 'compliance.exchange',
7
8
  CRM: 'crm.exchange',
8
9
  FINANCE: 'finance.exchange',
@@ -1,5 +1,6 @@
1
1
  export const MESSAGE_CHANNELS = {
2
2
  AI: 'ai.exchange',
3
+ AUTH: 'auth.exchange',
3
4
  COMPLIANCE: 'compliance.exchange',
4
5
  CRM: 'crm.exchange',
5
6
  FINANCE: 'finance.exchange',
@@ -8,6 +8,13 @@ export declare const EVENT_KEYS: {
8
8
  readonly COMPLIANCE_FIND_MATCH_REQUESTED: "ai.compliance.find-match.requested";
9
9
  readonly PORTFOLIO_NOTE_SUMMARY_REQUESTED: "ai.portfolio.note.summary.requested";
10
10
  };
11
+ /**
12
+ * ========= AUTH DOMAIN EVENTS =========
13
+ */
14
+ readonly auth: {
15
+ readonly PASSWORD_RESET_BY_ADMIN_REQUESTED: "auth.password.reset-by-admin.requested";
16
+ readonly PASSWORD_UPDATE_BY_USER_REQUESTED: "auth.password.update-by-user.requested";
17
+ };
11
18
  /**
12
19
  * ========= COMPLIANCE DOMAIN EVENTS =========
13
20
  */
@@ -11,6 +11,13 @@ exports.EVENT_KEYS = {
11
11
  COMPLIANCE_FIND_MATCH_REQUESTED: 'ai.compliance.find-match.requested',
12
12
  PORTFOLIO_NOTE_SUMMARY_REQUESTED: 'ai.portfolio.note.summary.requested',
13
13
  },
14
+ /**
15
+ * ========= AUTH DOMAIN EVENTS =========
16
+ */
17
+ auth: {
18
+ PASSWORD_RESET_BY_ADMIN_REQUESTED: 'auth.password.reset-by-admin.requested',
19
+ PASSWORD_UPDATE_BY_USER_REQUESTED: 'auth.password.update-by-user.requested',
20
+ },
14
21
  /**
15
22
  * ========= COMPLIANCE DOMAIN EVENTS =========
16
23
  */
@@ -9,6 +9,14 @@ export const EVENT_KEYS = {
9
9
  PORTFOLIO_NOTE_SUMMARY_REQUESTED: 'ai.portfolio.note.summary.requested',
10
10
  },
11
11
 
12
+ /**
13
+ * ========= AUTH DOMAIN EVENTS =========
14
+ */
15
+ auth: {
16
+ PASSWORD_RESET_BY_ADMIN_REQUESTED: 'auth.password.reset-by-admin.requested',
17
+ PASSWORD_UPDATE_BY_USER_REQUESTED: 'auth.password.update-by-user.requested',
18
+ },
19
+
12
20
  /**
13
21
  * ========= COMPLIANCE DOMAIN EVENTS =========
14
22
  */
@@ -13,6 +13,12 @@ export declare const QUEUES: {
13
13
  };
14
14
  };
15
15
  };
16
+ readonly auth: {
17
+ readonly password: {
18
+ readonly resetByAdmin: "auth.password.reset-by-admin";
19
+ readonly updateByUser: "auth.password.update-by-user";
20
+ };
21
+ };
16
22
  readonly compliance: {
17
23
  readonly summaryReady: "compliance.summary.ready";
18
24
  readonly findMatchReady: "compliance.find-match.ready";
@@ -16,6 +16,12 @@ exports.QUEUES = {
16
16
  },
17
17
  }
18
18
  },
19
+ auth: {
20
+ password: {
21
+ resetByAdmin: 'auth.password.reset-by-admin',
22
+ updateByUser: 'auth.password.update-by-user',
23
+ }
24
+ },
19
25
  compliance: {
20
26
  summaryReady: 'compliance.summary.ready',
21
27
  findMatchReady: 'compliance.find-match.ready',
@@ -13,6 +13,12 @@ export const QUEUES = {
13
13
  },
14
14
  }
15
15
  },
16
+ auth: {
17
+ password: {
18
+ resetByAdmin: 'auth.password.reset-by-admin',
19
+ updateByUser: 'auth.password.update-by-user',
20
+ }
21
+ },
16
22
  compliance: {
17
23
  summaryReady: 'compliance.summary.ready',
18
24
  findMatchReady: 'compliance.find-match.ready',
@@ -1,6 +1,8 @@
1
1
  import mongoose, { Model } from 'mongoose';
2
2
 
3
- import { IUploadedBankTransactionWithInfo } from './UploadedBankTransaction.model';
3
+ import {
4
+ IUploadedBankTransactionWithInfo,
5
+ } from './UploadedBankTransaction.model';
4
6
  import { AccountSchema } from './CashAllocationProduct.model';
5
7
  import { MODEL_NAMES } from './_models';
6
8
 
@@ -33,6 +33,8 @@ export interface IBankIntegrationTransaction {
33
33
  status: string;
34
34
  rawPayload: string;
35
35
  syncedAt: Date;
36
+ text: string;
37
+ description: string;
36
38
  }
37
39
  export type TBankIntegrationTransactionCreate = Omit<IBankIntegrationTransaction, 'accountId'> & {
38
40
  accountId: string;
@@ -32,6 +32,12 @@ exports.BankIntegrationTransactionSchema = new mongoose_1.default.Schema({
32
32
  rawPayload: {
33
33
  type: String,
34
34
  },
35
+ text: {
36
+ type: String,
37
+ },
38
+ description: {
39
+ type: String,
40
+ },
35
41
  syncedAt: {
36
42
  type: Date,
37
43
  },
@@ -12,6 +12,8 @@ export interface IBankIntegrationTransaction {
12
12
  status: string;
13
13
  rawPayload: string;
14
14
  syncedAt: Date;
15
+ text: string;
16
+ description: string;
15
17
  }
16
18
 
17
19
  export type TBankIntegrationTransactionCreate = Omit<IBankIntegrationTransaction, 'accountId'> & {
@@ -66,6 +68,12 @@ export const BankIntegrationTransactionSchema = new mongoose.Schema<IBankIntegra
66
68
  rawPayload: {
67
69
  type: String,
68
70
  },
71
+ text: {
72
+ type: String,
73
+ },
74
+ description: {
75
+ type: String,
76
+ },
69
77
  syncedAt: {
70
78
  type: Date,
71
79
  },
@@ -22,7 +22,7 @@
22
22
  /// <reference types="mongoose/types/validation" />
23
23
  /// <reference types="mongoose/types/virtuals" />
24
24
  /// <reference types="mongoose/types/inferschematype" />
25
- import mongoose, { Model } from 'mongoose';
25
+ import mongoose from 'mongoose';
26
26
  export interface ISplitTransaction {
27
27
  _id?: mongoose.Types.ObjectId;
28
28
  reference: string;
@@ -46,12 +46,27 @@ export interface IUploadedBankTransaction {
46
46
  isConverted: boolean;
47
47
  loanTransactionIds?: mongoose.Types.ObjectId[];
48
48
  splitTransactions: ISplitTransaction[];
49
+ bankIntegrationTransactionId?: mongoose.Types.ObjectId;
50
+ }
51
+ export type IUploadedBankTransactionDoc = mongoose.HydratedDocument<IUploadedBankTransaction>;
52
+ export interface IUploadedBankTransactionWithMemo extends IUploadedBankTransaction {
53
+ splitMemo: string;
49
54
  }
50
55
  export interface IUploadedBankTransactionWithInfo extends IUploadedBankTransaction {
51
56
  hasMatch: boolean;
52
57
  canSplit: boolean;
53
58
  }
54
- type UploadedBankTransactionModel = Model<IUploadedBankTransaction>;
59
+ export interface IUploadedBankTransactionLean extends IUploadedBankTransaction {
60
+ _id: mongoose.Types.ObjectId;
61
+ createdAt: Date;
62
+ updatedAt: Date;
63
+ }
64
+ export interface IUploadedBankTransactionPlain extends Omit<IUploadedBankTransaction, '_id' | 'loanTransactionIds' | 'bankIntegrationTransactionId'> {
65
+ _id: string;
66
+ loanTransactionIds: string[];
67
+ bankIntegrationTransactionId: string;
68
+ }
69
+ type UploadedBankTransactionModel = mongoose.Model<IUploadedBankTransaction>;
55
70
  export declare const UploadedBankTransactionSchema: mongoose.Schema<IUploadedBankTransaction, UploadedBankTransactionModel, {}, {}, {}, {}, mongoose.DefaultSchemaOptions, IUploadedBankTransaction, mongoose.Document<unknown, {}, mongoose.FlatRecord<IUploadedBankTransaction>> & mongoose.FlatRecord<IUploadedBankTransaction> & Required<{
56
71
  _id: mongoose.Types.ObjectId;
57
72
  }>>;
@@ -74,5 +74,10 @@ exports.UploadedBankTransactionSchema = new mongoose_1.default.Schema({
74
74
  required: false,
75
75
  }],
76
76
  splitTransactions: [SplitTransactionSchema],
77
+ bankIntegrationTransactionId: {
78
+ type: mongoose_1.default.Schema.Types.ObjectId,
79
+ ref: _models_1.MODEL_NAMES.bankIntegrationTransactions,
80
+ required: false,
81
+ },
77
82
  }, { timestamps: { createdAt: true, updatedAt: false } });
78
83
  exports.UploadedBankTransaction = mongoose_1.default.model(_models_1.MODEL_NAMES.uploadedBankTransactions, exports.UploadedBankTransactionSchema);
@@ -26,6 +26,13 @@ export interface IUploadedBankTransaction {
26
26
  isConverted: boolean;
27
27
  loanTransactionIds?: mongoose.Types.ObjectId[];
28
28
  splitTransactions: ISplitTransaction[];
29
+ bankIntegrationTransactionId?: mongoose.Types.ObjectId;
30
+ }
31
+
32
+ export type IUploadedBankTransactionDoc = mongoose.HydratedDocument<IUploadedBankTransaction>;
33
+
34
+ export interface IUploadedBankTransactionWithMemo extends IUploadedBankTransaction {
35
+ splitMemo: string;
29
36
  }
30
37
 
31
38
  export interface IUploadedBankTransactionWithInfo extends IUploadedBankTransaction {
@@ -33,8 +40,20 @@ export interface IUploadedBankTransactionWithInfo extends IUploadedBankTransacti
33
40
  canSplit: boolean;
34
41
  }
35
42
 
36
- type UploadedBankTransactionModel = Model<IUploadedBankTransaction>;
37
- type SplitTransactionModel = Model<ISplitTransaction>;
43
+ export interface IUploadedBankTransactionLean extends IUploadedBankTransaction {
44
+ _id: mongoose.Types.ObjectId;
45
+ createdAt: Date;
46
+ updatedAt: Date;
47
+ }
48
+
49
+ export interface IUploadedBankTransactionPlain extends Omit<IUploadedBankTransaction, '_id' | 'loanTransactionIds' | 'bankIntegrationTransactionId'> {
50
+ _id: string;
51
+ loanTransactionIds: string[];
52
+ bankIntegrationTransactionId: string;
53
+ }
54
+
55
+ type UploadedBankTransactionModel = mongoose.Model<IUploadedBankTransaction>;
56
+ type SplitTransactionModel = mongoose.Model<ISplitTransaction>;
38
57
 
39
58
  const SplitTransactionSchema = new mongoose.Schema<ISplitTransaction, SplitTransactionModel>({
40
59
  reference: {
@@ -105,6 +124,11 @@ export const UploadedBankTransactionSchema = new mongoose.Schema<IUploadedBankTr
105
124
  required: false,
106
125
  }],
107
126
  splitTransactions: [SplitTransactionSchema],
127
+ bankIntegrationTransactionId: {
128
+ type: mongoose.Schema.Types.ObjectId,
129
+ ref: MODEL_NAMES.bankIntegrationTransactions,
130
+ required: false,
131
+ },
108
132
  }, { timestamps: { createdAt: true, updatedAt: false } });
109
133
 
110
134
  export const UploadedBankTransaction = mongoose.model<IUploadedBankTransaction, UploadedBankTransactionModel>(MODEL_NAMES.uploadedBankTransactions, UploadedBankTransactionSchema);
@@ -31,10 +31,10 @@ export declare const allSchemas: {
31
31
  createdAt: NativeDate;
32
32
  updatedAt: NativeDate;
33
33
  } & {
34
- bbcSheetId: import("mongoose").Types.ObjectId;
35
34
  order: number;
36
- apDate: Date;
37
35
  amount: number;
36
+ bbcSheetId: import("mongoose").Types.ObjectId;
37
+ apDate: Date;
38
38
  __v?: number;
39
39
  poNumber?: string;
40
40
  customerName?: string;
@@ -45,10 +45,10 @@ export declare const allSchemas: {
45
45
  createdAt: NativeDate;
46
46
  updatedAt: NativeDate;
47
47
  } & {
48
- bbcSheetId: import("mongoose").Types.ObjectId;
49
48
  order: number;
50
- apDate: Date;
51
49
  amount: number;
50
+ bbcSheetId: import("mongoose").Types.ObjectId;
51
+ apDate: Date;
52
52
  __v?: number;
53
53
  poNumber?: string;
54
54
  customerName?: string;
@@ -59,10 +59,10 @@ export declare const allSchemas: {
59
59
  createdAt: NativeDate;
60
60
  updatedAt: NativeDate;
61
61
  } & {
62
- bbcSheetId: import("mongoose").Types.ObjectId;
63
62
  order: number;
64
- apDate: Date;
65
63
  amount: number;
64
+ bbcSheetId: import("mongoose").Types.ObjectId;
65
+ apDate: Date;
66
66
  __v?: number;
67
67
  poNumber?: string;
68
68
  customerName?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gemcap-be-common",
3
- "version": "1.4.253",
3
+ "version": "1.4.255",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -155,7 +155,7 @@ export declare class LoanTransactionsService {
155
155
  getTransactionReport(transactionIds: string[], borrowerId: string, effectiveDate: Date): Promise<{
156
156
  transactionIdsToMark: string[];
157
157
  transactions: {
158
- [x: string]: (string | number | string[] | Date)[];
158
+ [x: string]: (string | number | Date | string[])[];
159
159
  }[];
160
160
  }>;
161
161
  getBorrowerIdsForFile(transactionFileId: string): Promise<{
@@ -13,7 +13,7 @@ import { EChargeType } from '../db/reports.db';
13
13
  import { IBankView } from '../models/Banks.model';
14
14
  import { IQuickbooksAccount, QuickbooksAccount } from '../models/QuickbooksAccount.model';
15
15
  import { IQuickbooksUploadItem } from '../classes/quickbook-item';
16
- import { IUploadedBankTransaction } from '../models/UploadedBankTransaction.model';
16
+ import { IUploadedBankTransactionWithMemo } from '../models/UploadedBankTransaction.model';
17
17
  import { BanksService } from './banks.service';
18
18
  import { BankUploadedTransactionsService } from './bank-uploaded-transactions.service';
19
19
  import { BorrowersDB } from './borrowers.db';
@@ -51,11 +51,6 @@ interface IQBOReportTransaction {
51
51
  class: string;
52
52
  }
53
53
 
54
-
55
- interface IUploadedBankTransactionWithMemo extends IUploadedBankTransaction {
56
- splitMemo: string;
57
- }
58
-
59
54
  const headersIIF: IQBReportTransaction[] = [
60
55
  {
61
56
  service: '!TRNS',
@@ -1,6 +1,7 @@
1
+ import { TTaskEnvelope } from '../microservice/task-envelope.type';
1
2
  export declare class RabbitService {
2
3
  private connection;
3
4
  private channel;
4
5
  init(): Promise<void>;
5
- publish(exchange: string, routingKey: string, payload: unknown): Promise<void>;
6
+ publish(exchange: string, routingKey: string, payload: TTaskEnvelope<unknown>): void;
6
7
  }
@@ -42,7 +42,7 @@ class RabbitService {
42
42
  this.channel = await this.connection.createChannel();
43
43
  console.log('RabbitMQ connected');
44
44
  }
45
- async publish(exchange, routingKey, payload) {
45
+ publish(exchange, routingKey, payload) {
46
46
  if (!this.channel) {
47
47
  throw new Error('RabbitMQ channel is not initialized');
48
48
  }
@@ -1,5 +1,7 @@
1
1
  import * as amqp from 'amqplib';
2
2
 
3
+ import { TTaskEnvelope } from '../microservice/task-envelope.type';
4
+
3
5
  const { NODE_ENV } = process.env;
4
6
 
5
7
  export class RabbitService {
@@ -25,7 +27,7 @@ export class RabbitService {
25
27
  console.log('RabbitMQ connected');
26
28
  }
27
29
 
28
- async publish(exchange: string, routingKey: string, payload: unknown) {
30
+ publish(exchange: string, routingKey: string, payload: TTaskEnvelope<unknown>) {
29
31
  if (!this.channel) {
30
32
  throw new Error('RabbitMQ channel is not initialized');
31
33
  }