gemcap-be-common 1.4.95 → 1.4.97
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/models/BorrowerNote.model.d.ts +5 -0
- package/models/BorrowerNote.model.js +9 -0
- package/models/BorrowerNote.model.ts +25 -11
- package/models/CashAllocationProduct.model.d.ts +18 -30
- package/models/CashAllocationProduct.model.js +10 -6
- package/models/CashAllocationProduct.model.ts +18 -12
- package/models/_index.d.ts +3 -3
- package/package.json +1 -1
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -37,6 +37,11 @@ export interface IBorrowerNote {
|
|
|
37
37
|
attachments: IBorrowerNoteAttachment[];
|
|
38
38
|
createdBy: string;
|
|
39
39
|
updatedBy?: string;
|
|
40
|
+
source?: {
|
|
41
|
+
type: 'manual' | 'email';
|
|
42
|
+
emailFrom?: string;
|
|
43
|
+
emailTo?: string;
|
|
44
|
+
};
|
|
40
45
|
}
|
|
41
46
|
export interface IBorrowerNoteDoc extends IBorrowerNote, Document {
|
|
42
47
|
_id: mongoose.Types.ObjectId;
|
|
@@ -53,6 +53,15 @@ exports.BorrowerNoteSchema = new mongoose_1.default.Schema({
|
|
|
53
53
|
type: String,
|
|
54
54
|
},
|
|
55
55
|
attachments: [BorrowerNoteAttachmentSchema],
|
|
56
|
+
source: {
|
|
57
|
+
type: {
|
|
58
|
+
type: String,
|
|
59
|
+
enum: ['manual', 'email'],
|
|
60
|
+
default: 'manual'
|
|
61
|
+
},
|
|
62
|
+
emailFrom: { type: String },
|
|
63
|
+
emailTo: { type: String },
|
|
64
|
+
},
|
|
56
65
|
}, {
|
|
57
66
|
timestamps: true,
|
|
58
67
|
versionKey: false,
|
|
@@ -3,20 +3,25 @@ import mongoose, { Model } from 'mongoose';
|
|
|
3
3
|
import { MODEL_NAMES } from './_models';
|
|
4
4
|
|
|
5
5
|
export interface IBorrowerNoteAttachment {
|
|
6
|
-
fileId: string
|
|
7
|
-
fileName: string
|
|
8
|
-
filePath: string
|
|
9
|
-
mimeType: string
|
|
10
|
-
size: number
|
|
6
|
+
fileId: string;
|
|
7
|
+
fileName: string;
|
|
8
|
+
filePath: string;
|
|
9
|
+
mimeType: string;
|
|
10
|
+
size: number;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
export interface IBorrowerNote {
|
|
14
|
-
borrowerId: mongoose.Types.ObjectId
|
|
15
|
-
subjectId: mongoose.Types.ObjectId
|
|
16
|
-
text: string
|
|
17
|
-
attachments: IBorrowerNoteAttachment[]
|
|
18
|
-
createdBy: string
|
|
19
|
-
updatedBy?: string
|
|
14
|
+
borrowerId: mongoose.Types.ObjectId;
|
|
15
|
+
subjectId: mongoose.Types.ObjectId;
|
|
16
|
+
text: string;
|
|
17
|
+
attachments: IBorrowerNoteAttachment[];
|
|
18
|
+
createdBy: string;
|
|
19
|
+
updatedBy?: string;
|
|
20
|
+
source?: {
|
|
21
|
+
type: 'manual' | 'email';
|
|
22
|
+
emailFrom?: string;
|
|
23
|
+
emailTo?: string;
|
|
24
|
+
};
|
|
20
25
|
}
|
|
21
26
|
|
|
22
27
|
export interface IBorrowerNoteDoc extends IBorrowerNote, Document {
|
|
@@ -98,6 +103,15 @@ export const BorrowerNoteSchema = new mongoose.Schema<IBorrowerNoteDoc>({
|
|
|
98
103
|
type: String,
|
|
99
104
|
},
|
|
100
105
|
attachments: [BorrowerNoteAttachmentSchema],
|
|
106
|
+
source: {
|
|
107
|
+
type: {
|
|
108
|
+
type: String,
|
|
109
|
+
enum: ['manual', 'email'],
|
|
110
|
+
default: 'manual'
|
|
111
|
+
},
|
|
112
|
+
emailFrom: { type: String },
|
|
113
|
+
emailTo: { type: String },
|
|
114
|
+
},
|
|
101
115
|
}, {
|
|
102
116
|
timestamps: true,
|
|
103
117
|
versionKey: false,
|
|
@@ -50,64 +50,52 @@ export declare const AccountSchema: {
|
|
|
50
50
|
of: mongoose.Schema<any, mongoose.Model<any, any, any, any, any, any>, {}, {}, {}, {}, mongoose.DefaultSchemaOptions, {
|
|
51
51
|
accountId1: {
|
|
52
52
|
type: typeof Schema.Types.Mixed;
|
|
53
|
-
required:
|
|
53
|
+
required: false;
|
|
54
54
|
validate: {
|
|
55
|
-
validator: (value:
|
|
56
|
-
message: (props:
|
|
57
|
-
value: mongoose.Types.ObjectId | 'BANK';
|
|
58
|
-
}) => string;
|
|
55
|
+
validator: (value: mongoose.Types.ObjectId | 'BANK' | null) => boolean;
|
|
56
|
+
message: (props: any) => string;
|
|
59
57
|
};
|
|
60
58
|
};
|
|
61
59
|
accountId2: {
|
|
62
60
|
type: typeof Schema.Types.Mixed;
|
|
63
|
-
required:
|
|
61
|
+
required: false;
|
|
64
62
|
validate: {
|
|
65
|
-
validator: (value:
|
|
66
|
-
message: (props:
|
|
67
|
-
value: mongoose.Types.ObjectId | 'BANK';
|
|
68
|
-
}) => string;
|
|
63
|
+
validator: (value: mongoose.Types.ObjectId | 'BANK' | null) => boolean;
|
|
64
|
+
message: (props: any) => string;
|
|
69
65
|
};
|
|
70
66
|
};
|
|
71
67
|
}, mongoose.Document<unknown, {}, mongoose.FlatRecord<{
|
|
72
68
|
accountId1: {
|
|
73
69
|
type: typeof Schema.Types.Mixed;
|
|
74
|
-
required:
|
|
70
|
+
required: false;
|
|
75
71
|
validate: {
|
|
76
|
-
validator: (value:
|
|
77
|
-
message: (props:
|
|
78
|
-
value: mongoose.Types.ObjectId | 'BANK';
|
|
79
|
-
}) => string;
|
|
72
|
+
validator: (value: mongoose.Types.ObjectId | 'BANK' | null) => boolean;
|
|
73
|
+
message: (props: any) => string;
|
|
80
74
|
};
|
|
81
75
|
};
|
|
82
76
|
accountId2: {
|
|
83
77
|
type: typeof Schema.Types.Mixed;
|
|
84
|
-
required:
|
|
78
|
+
required: false;
|
|
85
79
|
validate: {
|
|
86
|
-
validator: (value:
|
|
87
|
-
message: (props:
|
|
88
|
-
value: mongoose.Types.ObjectId | 'BANK';
|
|
89
|
-
}) => string;
|
|
80
|
+
validator: (value: mongoose.Types.ObjectId | 'BANK' | null) => boolean;
|
|
81
|
+
message: (props: any) => string;
|
|
90
82
|
};
|
|
91
83
|
};
|
|
92
84
|
}>> & mongoose.FlatRecord<{
|
|
93
85
|
accountId1: {
|
|
94
86
|
type: typeof Schema.Types.Mixed;
|
|
95
|
-
required:
|
|
87
|
+
required: false;
|
|
96
88
|
validate: {
|
|
97
|
-
validator: (value:
|
|
98
|
-
message: (props:
|
|
99
|
-
value: mongoose.Types.ObjectId | 'BANK';
|
|
100
|
-
}) => string;
|
|
89
|
+
validator: (value: mongoose.Types.ObjectId | 'BANK' | null) => boolean;
|
|
90
|
+
message: (props: any) => string;
|
|
101
91
|
};
|
|
102
92
|
};
|
|
103
93
|
accountId2: {
|
|
104
94
|
type: typeof Schema.Types.Mixed;
|
|
105
|
-
required:
|
|
95
|
+
required: false;
|
|
106
96
|
validate: {
|
|
107
|
-
validator: (value:
|
|
108
|
-
message: (props:
|
|
109
|
-
value: mongoose.Types.ObjectId | 'BANK';
|
|
110
|
-
}) => string;
|
|
97
|
+
validator: (value: mongoose.Types.ObjectId | 'BANK' | null) => boolean;
|
|
98
|
+
message: (props: any) => string;
|
|
111
99
|
};
|
|
112
100
|
};
|
|
113
101
|
}> & {
|
|
@@ -31,22 +31,26 @@ exports.AccountSchema = {
|
|
|
31
31
|
of: new mongoose_1.Schema({
|
|
32
32
|
accountId1: {
|
|
33
33
|
type: mongoose_1.Schema.Types.Mixed,
|
|
34
|
-
required:
|
|
34
|
+
required: false,
|
|
35
35
|
validate: {
|
|
36
36
|
validator: function (value) {
|
|
37
|
-
return
|
|
37
|
+
return (value === null ||
|
|
38
|
+
mongoose_1.default.isValidObjectId(value) ||
|
|
39
|
+
value === 'BANK');
|
|
38
40
|
},
|
|
39
|
-
message: (props) => `${props.value} is not a valid ObjectId
|
|
41
|
+
message: (props) => `${props.value} is not a valid ObjectId, "BANK", or null`,
|
|
40
42
|
},
|
|
41
43
|
},
|
|
42
44
|
accountId2: {
|
|
43
45
|
type: mongoose_1.Schema.Types.Mixed,
|
|
44
|
-
required:
|
|
46
|
+
required: false,
|
|
45
47
|
validate: {
|
|
46
48
|
validator: function (value) {
|
|
47
|
-
return
|
|
49
|
+
return (value === null ||
|
|
50
|
+
mongoose_1.default.isValidObjectId(value) ||
|
|
51
|
+
value === 'BANK');
|
|
48
52
|
},
|
|
49
|
-
message: (props) => `${props.value} is not a valid ObjectId
|
|
53
|
+
message: (props) => `${props.value} is not a valid ObjectId, "BANK", or null`,
|
|
50
54
|
},
|
|
51
55
|
},
|
|
52
56
|
}),
|
|
@@ -32,26 +32,32 @@ export const AccountSchema = {
|
|
|
32
32
|
of: new Schema({
|
|
33
33
|
accountId1: {
|
|
34
34
|
type: Schema.Types.Mixed,
|
|
35
|
-
required:
|
|
35
|
+
required: false,
|
|
36
36
|
validate: {
|
|
37
|
-
validator: function(value:
|
|
38
|
-
return
|
|
37
|
+
validator: function (value: mongoose.Types.ObjectId | 'BANK' | null) {
|
|
38
|
+
return (
|
|
39
|
+
value === null ||
|
|
40
|
+
mongoose.isValidObjectId(value) ||
|
|
41
|
+
value === 'BANK'
|
|
42
|
+
);
|
|
39
43
|
},
|
|
40
|
-
message: (props:
|
|
41
|
-
value
|
|
42
|
-
}) => `${props.value} is not a valid ObjectId or "BANK"`,
|
|
44
|
+
message: (props: any) =>
|
|
45
|
+
`${props.value} is not a valid ObjectId, "BANK", or null`,
|
|
43
46
|
},
|
|
44
47
|
},
|
|
45
48
|
accountId2: {
|
|
46
49
|
type: Schema.Types.Mixed,
|
|
47
|
-
required:
|
|
50
|
+
required: false,
|
|
48
51
|
validate: {
|
|
49
|
-
validator: function(value:
|
|
50
|
-
return
|
|
52
|
+
validator: function (value: mongoose.Types.ObjectId | 'BANK' | null) {
|
|
53
|
+
return (
|
|
54
|
+
value === null ||
|
|
55
|
+
mongoose.isValidObjectId(value) ||
|
|
56
|
+
value === 'BANK'
|
|
57
|
+
);
|
|
51
58
|
},
|
|
52
|
-
message: (props:
|
|
53
|
-
value
|
|
54
|
-
}) => `${props.value} is not a valid ObjectId or "BANK"`,
|
|
59
|
+
message: (props: any) =>
|
|
60
|
+
`${props.value} is not a valid ObjectId, "BANK", or null`,
|
|
55
61
|
},
|
|
56
62
|
},
|
|
57
63
|
}),
|
package/models/_index.d.ts
CHANGED
|
@@ -31,8 +31,8 @@ export declare const allSchemas: {
|
|
|
31
31
|
createdAt: NativeDate;
|
|
32
32
|
updatedAt: NativeDate;
|
|
33
33
|
} & {
|
|
34
|
-
bbcSheetId: import("mongoose").Types.ObjectId;
|
|
35
34
|
order: number;
|
|
35
|
+
bbcSheetId: import("mongoose").Types.ObjectId;
|
|
36
36
|
apDate: Date;
|
|
37
37
|
amount: number;
|
|
38
38
|
__v?: number;
|
|
@@ -45,8 +45,8 @@ export declare const allSchemas: {
|
|
|
45
45
|
createdAt: NativeDate;
|
|
46
46
|
updatedAt: NativeDate;
|
|
47
47
|
} & {
|
|
48
|
-
bbcSheetId: import("mongoose").Types.ObjectId;
|
|
49
48
|
order: number;
|
|
49
|
+
bbcSheetId: import("mongoose").Types.ObjectId;
|
|
50
50
|
apDate: Date;
|
|
51
51
|
amount: number;
|
|
52
52
|
__v?: number;
|
|
@@ -59,8 +59,8 @@ export declare const allSchemas: {
|
|
|
59
59
|
createdAt: NativeDate;
|
|
60
60
|
updatedAt: NativeDate;
|
|
61
61
|
} & {
|
|
62
|
-
bbcSheetId: import("mongoose").Types.ObjectId;
|
|
63
62
|
order: number;
|
|
63
|
+
bbcSheetId: import("mongoose").Types.ObjectId;
|
|
64
64
|
apDate: Date;
|
|
65
65
|
amount: number;
|
|
66
66
|
__v?: number;
|