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.
- package/microservice/channels.constants.d.ts +1 -0
- package/microservice/channels.constants.js +1 -0
- package/microservice/channels.constants.ts +1 -0
- package/microservice/events.constants.d.ts +7 -0
- package/microservice/events.constants.js +7 -0
- package/microservice/events.constants.ts +8 -0
- package/microservice/queues.constants.d.ts +6 -0
- package/microservice/queues.constants.js +6 -0
- package/microservice/queues.constants.ts +6 -0
- package/models/AllocatedBankTransaction.model.ts +3 -1
- package/models/BankIntegrationTransaction.model.d.ts +2 -0
- package/models/BankIntegrationTransaction.model.js +6 -0
- package/models/BankIntegrationTransaction.model.ts +8 -0
- package/models/UploadedBankTransaction.model.d.ts +17 -2
- package/models/UploadedBankTransaction.model.js +5 -0
- package/models/UploadedBankTransaction.model.ts +26 -2
- package/models/_index.d.ts +6 -6
- package/package.json +1 -1
- package/services/loan-transactions.service.d.ts +1 -1
- package/services/quickbooks.service.ts +1 -6
- package/services/rabbit.service.d.ts +2 -1
- package/services/rabbit.service.js +1 -1
- package/services/rabbit.service.ts +3 -1
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -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 {
|
|
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;
|
|
@@ -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
|
|
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
|
-
|
|
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
|
-
|
|
37
|
-
|
|
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);
|
package/models/_index.d.ts
CHANGED
|
@@ -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
|
@@ -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[]
|
|
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 {
|
|
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):
|
|
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
|
-
|
|
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
|
-
|
|
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
|
}
|