gemcap-be-common 1.4.177 → 1.4.178
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.
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
/// <reference types="mongoose/types/aggregate" />
|
|
2
|
+
/// <reference types="mongoose/types/callback" />
|
|
3
|
+
/// <reference types="mongoose/types/collection" />
|
|
4
|
+
/// <reference types="mongoose/types/connection" />
|
|
5
|
+
/// <reference types="mongoose/types/cursor" />
|
|
6
|
+
/// <reference types="mongoose/types/document" />
|
|
7
|
+
/// <reference types="mongoose/types/error" />
|
|
8
|
+
/// <reference types="mongoose/types/expressions" />
|
|
9
|
+
/// <reference types="mongoose/types/helpers" />
|
|
10
|
+
/// <reference types="mongoose/types/middlewares" />
|
|
11
|
+
/// <reference types="mongoose/types/indexes" />
|
|
12
|
+
/// <reference types="mongoose/types/models" />
|
|
13
|
+
/// <reference types="mongoose/types/mongooseoptions" />
|
|
14
|
+
/// <reference types="mongoose/types/pipelinestage" />
|
|
15
|
+
/// <reference types="mongoose/types/populate" />
|
|
16
|
+
/// <reference types="mongoose/types/query" />
|
|
17
|
+
/// <reference types="mongoose/types/schemaoptions" />
|
|
18
|
+
/// <reference types="mongoose/types/schematypes" />
|
|
19
|
+
/// <reference types="mongoose/types/session" />
|
|
20
|
+
/// <reference types="mongoose/types/types" />
|
|
21
|
+
/// <reference types="mongoose/types/utility" />
|
|
22
|
+
/// <reference types="mongoose/types/validation" />
|
|
23
|
+
/// <reference types="mongoose/types/virtuals" />
|
|
24
|
+
/// <reference types="mongoose/types/inferschematype" />
|
|
25
|
+
import mongoose, { Document } from 'mongoose';
|
|
26
|
+
import { IBorrowerItemDocument, IEmailRecipient } from './ComplianceItem.model';
|
|
27
|
+
export interface IComplianceNote {
|
|
28
|
+
note: string;
|
|
29
|
+
date: Date;
|
|
30
|
+
user?: string;
|
|
31
|
+
}
|
|
32
|
+
export interface IComplianceBorrowerDocument extends Document {
|
|
33
|
+
isVisible: boolean;
|
|
34
|
+
borrower: any;
|
|
35
|
+
complianceNotes?: IComplianceNote[];
|
|
36
|
+
borrowerNotes?: IComplianceNote[];
|
|
37
|
+
email?: string;
|
|
38
|
+
mainEmails?: IEmailRecipient[];
|
|
39
|
+
financialEmails?: IEmailRecipient[];
|
|
40
|
+
isEmailingActive?: boolean;
|
|
41
|
+
isDailyTransactionsEmailingActive?: boolean;
|
|
42
|
+
plaidAccessToken?: string;
|
|
43
|
+
fundingStatus?: string;
|
|
44
|
+
lastEmailSentAt?: Date;
|
|
45
|
+
items?: IBorrowerItemDocument[];
|
|
46
|
+
}
|
|
47
|
+
export interface IComplianceBorrowerDocumentFull extends Omit<IComplianceBorrowerDocument, 'items'> {
|
|
48
|
+
items: IBorrowerItemDocument[];
|
|
49
|
+
}
|
|
50
|
+
export declare const BorrowerComplianceSchema: mongoose.Schema<any, mongoose.Model<any, any, any, any, any, any>, {}, {}, {}, {}, {
|
|
51
|
+
timestamps: true;
|
|
52
|
+
}, {
|
|
53
|
+
createdAt: NativeDate;
|
|
54
|
+
updatedAt: NativeDate;
|
|
55
|
+
} & {
|
|
56
|
+
items: mongoose.Types.DocumentArray<{
|
|
57
|
+
createdAt: NativeDate;
|
|
58
|
+
updatedAt: NativeDate;
|
|
59
|
+
} & {
|
|
60
|
+
emailAddresses: mongoose.Types.DocumentArray<{
|
|
61
|
+
email?: string;
|
|
62
|
+
title?: string;
|
|
63
|
+
isActive?: boolean;
|
|
64
|
+
}>;
|
|
65
|
+
instances: mongoose.Types.DocumentArray<{
|
|
66
|
+
createdAt: NativeDate;
|
|
67
|
+
updatedAt: NativeDate;
|
|
68
|
+
} & {
|
|
69
|
+
files: mongoose.Types.DocumentArray<{
|
|
70
|
+
name: string;
|
|
71
|
+
fileId: string;
|
|
72
|
+
isFileNew?: boolean;
|
|
73
|
+
uploadedAt?: Date;
|
|
74
|
+
uploadedBy?: string;
|
|
75
|
+
}>;
|
|
76
|
+
nextDate?: Date;
|
|
77
|
+
submittedDate?: Date;
|
|
78
|
+
status?: string;
|
|
79
|
+
}>;
|
|
80
|
+
item?: mongoose.Types.ObjectId;
|
|
81
|
+
startDate?: Date;
|
|
82
|
+
frequency?: string;
|
|
83
|
+
}>;
|
|
84
|
+
borrower: mongoose.Types.ObjectId;
|
|
85
|
+
complianceNotes: mongoose.Types.DocumentArray<{
|
|
86
|
+
date: Date;
|
|
87
|
+
note: string;
|
|
88
|
+
user?: string;
|
|
89
|
+
}>;
|
|
90
|
+
borrowerNotes: mongoose.Types.DocumentArray<{
|
|
91
|
+
date: Date;
|
|
92
|
+
note: string;
|
|
93
|
+
user?: string;
|
|
94
|
+
}>;
|
|
95
|
+
mainEmails: mongoose.Types.DocumentArray<{
|
|
96
|
+
email?: string;
|
|
97
|
+
title?: string;
|
|
98
|
+
isActive?: boolean;
|
|
99
|
+
}>;
|
|
100
|
+
financialEmails: mongoose.Types.DocumentArray<{
|
|
101
|
+
email?: string;
|
|
102
|
+
title?: string;
|
|
103
|
+
isActive?: boolean;
|
|
104
|
+
}>;
|
|
105
|
+
isVisible?: boolean;
|
|
106
|
+
email?: string;
|
|
107
|
+
isEmailingActive?: boolean;
|
|
108
|
+
isDailyTransactionsEmailingActive?: boolean;
|
|
109
|
+
plaidAccessToken?: string;
|
|
110
|
+
fundingStatus?: string;
|
|
111
|
+
lastEmailSentAt?: Date;
|
|
112
|
+
__v?: number;
|
|
113
|
+
}, mongoose.Document<unknown, {}, mongoose.FlatRecord<{
|
|
114
|
+
createdAt: NativeDate;
|
|
115
|
+
updatedAt: NativeDate;
|
|
116
|
+
} & {
|
|
117
|
+
items: mongoose.Types.DocumentArray<{
|
|
118
|
+
createdAt: NativeDate;
|
|
119
|
+
updatedAt: NativeDate;
|
|
120
|
+
} & {
|
|
121
|
+
emailAddresses: mongoose.Types.DocumentArray<{
|
|
122
|
+
email?: string;
|
|
123
|
+
title?: string;
|
|
124
|
+
isActive?: boolean;
|
|
125
|
+
}>;
|
|
126
|
+
instances: mongoose.Types.DocumentArray<{
|
|
127
|
+
createdAt: NativeDate;
|
|
128
|
+
updatedAt: NativeDate;
|
|
129
|
+
} & {
|
|
130
|
+
files: mongoose.Types.DocumentArray<{
|
|
131
|
+
name: string;
|
|
132
|
+
fileId: string;
|
|
133
|
+
isFileNew?: boolean;
|
|
134
|
+
uploadedAt?: Date;
|
|
135
|
+
uploadedBy?: string;
|
|
136
|
+
}>;
|
|
137
|
+
nextDate?: Date;
|
|
138
|
+
submittedDate?: Date;
|
|
139
|
+
status?: string;
|
|
140
|
+
}>;
|
|
141
|
+
item?: mongoose.Types.ObjectId;
|
|
142
|
+
startDate?: Date;
|
|
143
|
+
frequency?: string;
|
|
144
|
+
}>;
|
|
145
|
+
borrower: mongoose.Types.ObjectId;
|
|
146
|
+
complianceNotes: mongoose.Types.DocumentArray<{
|
|
147
|
+
date: Date;
|
|
148
|
+
note: string;
|
|
149
|
+
user?: string;
|
|
150
|
+
}>;
|
|
151
|
+
borrowerNotes: mongoose.Types.DocumentArray<{
|
|
152
|
+
date: Date;
|
|
153
|
+
note: string;
|
|
154
|
+
user?: string;
|
|
155
|
+
}>;
|
|
156
|
+
mainEmails: mongoose.Types.DocumentArray<{
|
|
157
|
+
email?: string;
|
|
158
|
+
title?: string;
|
|
159
|
+
isActive?: boolean;
|
|
160
|
+
}>;
|
|
161
|
+
financialEmails: mongoose.Types.DocumentArray<{
|
|
162
|
+
email?: string;
|
|
163
|
+
title?: string;
|
|
164
|
+
isActive?: boolean;
|
|
165
|
+
}>;
|
|
166
|
+
isVisible?: boolean;
|
|
167
|
+
email?: string;
|
|
168
|
+
isEmailingActive?: boolean;
|
|
169
|
+
isDailyTransactionsEmailingActive?: boolean;
|
|
170
|
+
plaidAccessToken?: string;
|
|
171
|
+
fundingStatus?: string;
|
|
172
|
+
lastEmailSentAt?: Date;
|
|
173
|
+
__v?: number;
|
|
174
|
+
}>> & mongoose.FlatRecord<{
|
|
175
|
+
createdAt: NativeDate;
|
|
176
|
+
updatedAt: NativeDate;
|
|
177
|
+
} & {
|
|
178
|
+
items: mongoose.Types.DocumentArray<{
|
|
179
|
+
createdAt: NativeDate;
|
|
180
|
+
updatedAt: NativeDate;
|
|
181
|
+
} & {
|
|
182
|
+
emailAddresses: mongoose.Types.DocumentArray<{
|
|
183
|
+
email?: string;
|
|
184
|
+
title?: string;
|
|
185
|
+
isActive?: boolean;
|
|
186
|
+
}>;
|
|
187
|
+
instances: mongoose.Types.DocumentArray<{
|
|
188
|
+
createdAt: NativeDate;
|
|
189
|
+
updatedAt: NativeDate;
|
|
190
|
+
} & {
|
|
191
|
+
files: mongoose.Types.DocumentArray<{
|
|
192
|
+
name: string;
|
|
193
|
+
fileId: string;
|
|
194
|
+
isFileNew?: boolean;
|
|
195
|
+
uploadedAt?: Date;
|
|
196
|
+
uploadedBy?: string;
|
|
197
|
+
}>;
|
|
198
|
+
nextDate?: Date;
|
|
199
|
+
submittedDate?: Date;
|
|
200
|
+
status?: string;
|
|
201
|
+
}>;
|
|
202
|
+
item?: mongoose.Types.ObjectId;
|
|
203
|
+
startDate?: Date;
|
|
204
|
+
frequency?: string;
|
|
205
|
+
}>;
|
|
206
|
+
borrower: mongoose.Types.ObjectId;
|
|
207
|
+
complianceNotes: mongoose.Types.DocumentArray<{
|
|
208
|
+
date: Date;
|
|
209
|
+
note: string;
|
|
210
|
+
user?: string;
|
|
211
|
+
}>;
|
|
212
|
+
borrowerNotes: mongoose.Types.DocumentArray<{
|
|
213
|
+
date: Date;
|
|
214
|
+
note: string;
|
|
215
|
+
user?: string;
|
|
216
|
+
}>;
|
|
217
|
+
mainEmails: mongoose.Types.DocumentArray<{
|
|
218
|
+
email?: string;
|
|
219
|
+
title?: string;
|
|
220
|
+
isActive?: boolean;
|
|
221
|
+
}>;
|
|
222
|
+
financialEmails: mongoose.Types.DocumentArray<{
|
|
223
|
+
email?: string;
|
|
224
|
+
title?: string;
|
|
225
|
+
isActive?: boolean;
|
|
226
|
+
}>;
|
|
227
|
+
isVisible?: boolean;
|
|
228
|
+
email?: string;
|
|
229
|
+
isEmailingActive?: boolean;
|
|
230
|
+
isDailyTransactionsEmailingActive?: boolean;
|
|
231
|
+
plaidAccessToken?: string;
|
|
232
|
+
fundingStatus?: string;
|
|
233
|
+
lastEmailSentAt?: Date;
|
|
234
|
+
__v?: number;
|
|
235
|
+
}> & {
|
|
236
|
+
_id: mongoose.Types.ObjectId;
|
|
237
|
+
}>;
|
|
238
|
+
export declare const BorrowerCompliance: mongoose.Model<IComplianceBorrowerDocument, {}, {}, {}, mongoose.Document<unknown, {}, IComplianceBorrowerDocument> & IComplianceBorrowerDocument & {
|
|
239
|
+
_id: mongoose.Types.ObjectId;
|
|
240
|
+
}, any>;
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.BorrowerCompliance = exports.BorrowerComplianceSchema = void 0;
|
|
7
|
+
const mongoose_1 = __importDefault(require("mongoose"));
|
|
8
|
+
const _models_1 = require("./_models");
|
|
9
|
+
const mongooseLeanId = require('../plugins/id.plugin');
|
|
10
|
+
const BorrowerComplianceInstanceSchema = new mongoose_1.default.Schema({
|
|
11
|
+
nextDate: {
|
|
12
|
+
type: Date,
|
|
13
|
+
required: false,
|
|
14
|
+
},
|
|
15
|
+
submittedDate: {
|
|
16
|
+
type: Date,
|
|
17
|
+
required: false,
|
|
18
|
+
},
|
|
19
|
+
status: {
|
|
20
|
+
type: String,
|
|
21
|
+
trim: true,
|
|
22
|
+
required: false,
|
|
23
|
+
},
|
|
24
|
+
files: [{
|
|
25
|
+
fileId: {
|
|
26
|
+
type: String,
|
|
27
|
+
trim: true,
|
|
28
|
+
required: true,
|
|
29
|
+
},
|
|
30
|
+
name: {
|
|
31
|
+
type: String,
|
|
32
|
+
trim: true,
|
|
33
|
+
required: true,
|
|
34
|
+
},
|
|
35
|
+
isFileNew: {
|
|
36
|
+
type: Boolean,
|
|
37
|
+
required: false,
|
|
38
|
+
default: true,
|
|
39
|
+
},
|
|
40
|
+
uploadedAt: {
|
|
41
|
+
type: Date,
|
|
42
|
+
required: false,
|
|
43
|
+
},
|
|
44
|
+
uploadedBy: {
|
|
45
|
+
type: String,
|
|
46
|
+
required: false,
|
|
47
|
+
},
|
|
48
|
+
}]
|
|
49
|
+
}, { timestamps: true });
|
|
50
|
+
const BorrowerComplianceItemSchema = new mongoose_1.default.Schema({
|
|
51
|
+
item: {
|
|
52
|
+
type: mongoose_1.default.Schema.Types.ObjectId,
|
|
53
|
+
ref: _models_1.MODEL_NAMES.complianceItems,
|
|
54
|
+
required: false,
|
|
55
|
+
},
|
|
56
|
+
startDate: {
|
|
57
|
+
type: Date,
|
|
58
|
+
required: false,
|
|
59
|
+
},
|
|
60
|
+
frequency: {
|
|
61
|
+
type: String,
|
|
62
|
+
trim: true,
|
|
63
|
+
required: false,
|
|
64
|
+
},
|
|
65
|
+
emailAddresses: [{
|
|
66
|
+
email: {
|
|
67
|
+
type: String,
|
|
68
|
+
trim: true,
|
|
69
|
+
required: false,
|
|
70
|
+
},
|
|
71
|
+
title: {
|
|
72
|
+
type: String,
|
|
73
|
+
trim: true,
|
|
74
|
+
required: false,
|
|
75
|
+
},
|
|
76
|
+
isActive: {
|
|
77
|
+
type: Boolean,
|
|
78
|
+
required: false,
|
|
79
|
+
},
|
|
80
|
+
}],
|
|
81
|
+
instances: [BorrowerComplianceInstanceSchema]
|
|
82
|
+
}, { timestamps: true });
|
|
83
|
+
exports.BorrowerComplianceSchema = new mongoose_1.default.Schema({
|
|
84
|
+
isVisible: {
|
|
85
|
+
type: Boolean,
|
|
86
|
+
},
|
|
87
|
+
borrower: {
|
|
88
|
+
type: mongoose_1.default.Schema.Types.ObjectId,
|
|
89
|
+
ref: _models_1.MODEL_NAMES.borrowers,
|
|
90
|
+
required: true,
|
|
91
|
+
},
|
|
92
|
+
complianceNotes: [{
|
|
93
|
+
note: {
|
|
94
|
+
type: String,
|
|
95
|
+
trim: true,
|
|
96
|
+
required: true,
|
|
97
|
+
},
|
|
98
|
+
date: {
|
|
99
|
+
type: Date,
|
|
100
|
+
required: true,
|
|
101
|
+
},
|
|
102
|
+
user: {
|
|
103
|
+
type: String,
|
|
104
|
+
trim: true,
|
|
105
|
+
required: false,
|
|
106
|
+
},
|
|
107
|
+
}],
|
|
108
|
+
borrowerNotes: [{
|
|
109
|
+
note: {
|
|
110
|
+
type: String,
|
|
111
|
+
trim: true,
|
|
112
|
+
required: true,
|
|
113
|
+
},
|
|
114
|
+
date: {
|
|
115
|
+
type: Date,
|
|
116
|
+
required: true,
|
|
117
|
+
},
|
|
118
|
+
user: {
|
|
119
|
+
type: String,
|
|
120
|
+
trim: true,
|
|
121
|
+
required: false,
|
|
122
|
+
},
|
|
123
|
+
}],
|
|
124
|
+
email: {
|
|
125
|
+
type: String,
|
|
126
|
+
trim: true,
|
|
127
|
+
required: false,
|
|
128
|
+
},
|
|
129
|
+
mainEmails: [{
|
|
130
|
+
email: {
|
|
131
|
+
type: String,
|
|
132
|
+
trim: true,
|
|
133
|
+
required: false,
|
|
134
|
+
},
|
|
135
|
+
title: {
|
|
136
|
+
type: String,
|
|
137
|
+
trim: true,
|
|
138
|
+
required: false,
|
|
139
|
+
},
|
|
140
|
+
isActive: {
|
|
141
|
+
type: Boolean,
|
|
142
|
+
required: false,
|
|
143
|
+
},
|
|
144
|
+
}],
|
|
145
|
+
financialEmails: [{
|
|
146
|
+
email: {
|
|
147
|
+
type: String,
|
|
148
|
+
trim: true,
|
|
149
|
+
required: false,
|
|
150
|
+
},
|
|
151
|
+
title: {
|
|
152
|
+
type: String,
|
|
153
|
+
trim: true,
|
|
154
|
+
required: false,
|
|
155
|
+
},
|
|
156
|
+
isActive: {
|
|
157
|
+
type: Boolean,
|
|
158
|
+
required: false,
|
|
159
|
+
},
|
|
160
|
+
}],
|
|
161
|
+
isEmailingActive: {
|
|
162
|
+
type: Boolean,
|
|
163
|
+
required: false,
|
|
164
|
+
default: false,
|
|
165
|
+
},
|
|
166
|
+
isDailyTransactionsEmailingActive: {
|
|
167
|
+
type: Boolean,
|
|
168
|
+
required: false,
|
|
169
|
+
default: false,
|
|
170
|
+
},
|
|
171
|
+
plaidAccessToken: {
|
|
172
|
+
type: String,
|
|
173
|
+
trim: true,
|
|
174
|
+
required: false,
|
|
175
|
+
select: false,
|
|
176
|
+
},
|
|
177
|
+
fundingStatus: {
|
|
178
|
+
type: String,
|
|
179
|
+
trim: true,
|
|
180
|
+
required: false,
|
|
181
|
+
},
|
|
182
|
+
lastEmailSentAt: {
|
|
183
|
+
type: Date,
|
|
184
|
+
required: false,
|
|
185
|
+
},
|
|
186
|
+
items: [BorrowerComplianceItemSchema],
|
|
187
|
+
__v: { type: Number, select: false },
|
|
188
|
+
}, { timestamps: true });
|
|
189
|
+
exports.BorrowerComplianceSchema.plugin(mongooseLeanId);
|
|
190
|
+
exports.BorrowerCompliance = mongoose_1.default.model(_models_1.MODEL_NAMES.complianceBorrowers, exports.BorrowerComplianceSchema);
|