gemcap-be-common 1.5.85 → 1.5.87
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/Facility.model.d.ts +51 -0
- package/models/Facility.model.js +24 -0
- package/models/Facility.model.ts +50 -0
- package/models/LoanProducts.model.d.ts +18 -13
- package/models/LoanProducts.model.js +4 -0
- package/models/LoanProducts.model.ts +7 -1
- package/models/PostponedTransactions.model.d.ts +3 -3
- package/models/_index.d.ts +6 -6
- package/models/_models.d.ts +1 -0
- package/models/_models.js +1 -0
- package/models/_models.ts +1 -0
- package/package.json +1 -1
- package/services/quickbooks.service.d.ts +1 -1
- package/services/yield.service.js +1 -1
- package/services/yield.service.ts +1 -1
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/// <reference types="mongoose/types/types" />
|
|
2
|
+
/// <reference types="mongoose/types/models" />
|
|
3
|
+
/// <reference types="mongoose/types/schemaoptions" />
|
|
4
|
+
/// <reference types="mongoose/types/utility" />
|
|
5
|
+
/// <reference types="mongoose/types/document" />
|
|
6
|
+
/// <reference types="mongoose/types/aggregate" />
|
|
7
|
+
/// <reference types="mongoose/types/callback" />
|
|
8
|
+
/// <reference types="mongoose/types/collection" />
|
|
9
|
+
/// <reference types="mongoose/types/connection" />
|
|
10
|
+
/// <reference types="mongoose/types/cursor" />
|
|
11
|
+
/// <reference types="mongoose/types/document" />
|
|
12
|
+
/// <reference types="mongoose/types/error" />
|
|
13
|
+
/// <reference types="mongoose/types/expressions" />
|
|
14
|
+
/// <reference types="mongoose/types/helpers" />
|
|
15
|
+
/// <reference types="mongoose/types/middlewares" />
|
|
16
|
+
/// <reference types="mongoose/types/indexes" />
|
|
17
|
+
/// <reference types="mongoose/types/models" />
|
|
18
|
+
/// <reference types="mongoose/types/mongooseoptions" />
|
|
19
|
+
/// <reference types="mongoose/types/pipelinestage" />
|
|
20
|
+
/// <reference types="mongoose/types/populate" />
|
|
21
|
+
/// <reference types="mongoose/types/query" />
|
|
22
|
+
/// <reference types="mongoose/types/schemaoptions" />
|
|
23
|
+
/// <reference types="mongoose/types/schematypes" />
|
|
24
|
+
/// <reference types="mongoose/types/session" />
|
|
25
|
+
/// <reference types="mongoose/types/types" />
|
|
26
|
+
/// <reference types="mongoose/types/utility" />
|
|
27
|
+
/// <reference types="mongoose/types/validation" />
|
|
28
|
+
/// <reference types="mongoose/types/virtuals" />
|
|
29
|
+
/// <reference types="mongoose/types/inferschematype" />
|
|
30
|
+
import mongoose from 'mongoose';
|
|
31
|
+
export interface IFacility {
|
|
32
|
+
borrowerId: mongoose.Types.ObjectId;
|
|
33
|
+
name: string;
|
|
34
|
+
}
|
|
35
|
+
export type TFacilityDoc = mongoose.HydratedDocument<IFacility>;
|
|
36
|
+
export interface IFacilityLean extends IFacility {
|
|
37
|
+
_id: mongoose.Types.ObjectId;
|
|
38
|
+
createdAt: Date;
|
|
39
|
+
updatedAt: Date;
|
|
40
|
+
}
|
|
41
|
+
export interface IFacilityPlain extends Omit<IFacility, 'borrowerId'> {
|
|
42
|
+
_id: string;
|
|
43
|
+
borrowerId: string;
|
|
44
|
+
createdAt: Date;
|
|
45
|
+
updatedAt: Date;
|
|
46
|
+
}
|
|
47
|
+
export type TFacilityModel = mongoose.Model<IFacility>;
|
|
48
|
+
export declare const FacilitySchema: mongoose.Schema<IFacility, TFacilityModel, {}, {}, {}, {}, mongoose.DefaultSchemaOptions, IFacility, mongoose.Document<unknown, {}, mongoose.FlatRecord<IFacility>> & mongoose.FlatRecord<IFacility> & {
|
|
49
|
+
_id: mongoose.Types.ObjectId;
|
|
50
|
+
}>;
|
|
51
|
+
export declare const Facility: TFacilityModel;
|
|
@@ -0,0 +1,24 @@
|
|
|
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.Facility = exports.FacilitySchema = void 0;
|
|
7
|
+
const mongoose_1 = __importDefault(require("mongoose"));
|
|
8
|
+
const _models_1 = require("./_models");
|
|
9
|
+
exports.FacilitySchema = new mongoose_1.default.Schema({
|
|
10
|
+
borrowerId: {
|
|
11
|
+
type: mongoose_1.default.Schema.Types.ObjectId,
|
|
12
|
+
ref: _models_1.MODEL_NAMES.borrowers,
|
|
13
|
+
required: true,
|
|
14
|
+
},
|
|
15
|
+
name: {
|
|
16
|
+
type: 'String',
|
|
17
|
+
required: true,
|
|
18
|
+
},
|
|
19
|
+
}, {
|
|
20
|
+
timestamps: { createdAt: true, updatedAt: true },
|
|
21
|
+
versionKey: false,
|
|
22
|
+
});
|
|
23
|
+
exports.FacilitySchema.index({ borrowerId: 1, name: 1 }, { unique: true });
|
|
24
|
+
exports.Facility = mongoose_1.default.model(_models_1.MODEL_NAMES.facilities, exports.FacilitySchema);
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import mongoose from 'mongoose';
|
|
2
|
+
|
|
3
|
+
import { MODEL_NAMES } from './_models';
|
|
4
|
+
|
|
5
|
+
export interface IFacility {
|
|
6
|
+
borrowerId: mongoose.Types.ObjectId;
|
|
7
|
+
name: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export type TFacilityDoc = mongoose.HydratedDocument<IFacility>;
|
|
11
|
+
|
|
12
|
+
export interface IFacilityLean extends IFacility {
|
|
13
|
+
_id: mongoose.Types.ObjectId;
|
|
14
|
+
createdAt: Date;
|
|
15
|
+
updatedAt: Date;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface IFacilityPlain extends Omit<IFacility, 'borrowerId'> {
|
|
19
|
+
_id: string;
|
|
20
|
+
borrowerId: string;
|
|
21
|
+
createdAt: Date;
|
|
22
|
+
updatedAt: Date;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export type TFacilityModel = mongoose.Model<IFacility>;
|
|
26
|
+
|
|
27
|
+
export const FacilitySchema = new mongoose.Schema<IFacility, TFacilityModel>(
|
|
28
|
+
{
|
|
29
|
+
borrowerId: {
|
|
30
|
+
type: mongoose.Schema.Types.ObjectId,
|
|
31
|
+
ref: MODEL_NAMES.borrowers,
|
|
32
|
+
required: true,
|
|
33
|
+
},
|
|
34
|
+
name: {
|
|
35
|
+
type: 'String',
|
|
36
|
+
required: true,
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
timestamps: { createdAt: true, updatedAt: true },
|
|
41
|
+
versionKey: false,
|
|
42
|
+
},
|
|
43
|
+
);
|
|
44
|
+
|
|
45
|
+
FacilitySchema.index(
|
|
46
|
+
{ borrowerId: 1, name: 1 },
|
|
47
|
+
{ unique: true },
|
|
48
|
+
);
|
|
49
|
+
|
|
50
|
+
export const Facility = mongoose.model<IFacility, TFacilityModel>(MODEL_NAMES.facilities, FacilitySchema);
|
|
@@ -31,6 +31,7 @@ import { ELoanTypes } from '../enums/loan-types.enum';
|
|
|
31
31
|
import { IBorrowerLean } from './Borrower.model';
|
|
32
32
|
export interface ILoanProduct {
|
|
33
33
|
borrowerId: mongoose.Types.ObjectId;
|
|
34
|
+
facilityId?: mongoose.Types.ObjectId;
|
|
34
35
|
order: number;
|
|
35
36
|
active: boolean;
|
|
36
37
|
code: string;
|
|
@@ -64,10 +65,11 @@ export interface ILoanProductLean extends ILoanProduct {
|
|
|
64
65
|
createdAt: Date;
|
|
65
66
|
updatedAt: Date;
|
|
66
67
|
}
|
|
67
|
-
export interface ILoanProductPlain extends Omit<ILoanProduct, 'borrowerId' | 'masterLoanProductId'> {
|
|
68
|
+
export interface ILoanProductPlain extends Omit<ILoanProduct, 'borrowerId' | 'masterLoanProductId' | 'facilityId'> {
|
|
68
69
|
_id: string;
|
|
69
70
|
borrowerId: string;
|
|
70
71
|
masterLoanProductId: string;
|
|
72
|
+
facilityId: string;
|
|
71
73
|
}
|
|
72
74
|
export interface ILoanProductWithId extends ILoanProduct {
|
|
73
75
|
_id: mongoose.Types.ObjectId;
|
|
@@ -88,19 +90,19 @@ export declare const LoanProductSchema: mongoose.Schema<any, mongoose.Model<any,
|
|
|
88
90
|
updatedAt: NativeDate;
|
|
89
91
|
} & {
|
|
90
92
|
borrowerId: mongoose.Types.ObjectId;
|
|
91
|
-
|
|
92
|
-
name: string;
|
|
93
|
+
masterLoanProductId: mongoose.Types.ObjectId;
|
|
93
94
|
order: number;
|
|
94
95
|
active: boolean;
|
|
95
96
|
code: string;
|
|
97
|
+
name: string;
|
|
98
|
+
type: string;
|
|
96
99
|
startDate: Date;
|
|
97
100
|
maturityDate: Date;
|
|
98
101
|
commitment: number;
|
|
99
102
|
isBalanceActual: boolean;
|
|
100
103
|
isFloatedBalanceActual: boolean;
|
|
101
|
-
masterLoanProductId: mongoose.Types.ObjectId;
|
|
102
104
|
isDefaultPaymentOrder: boolean;
|
|
103
|
-
|
|
105
|
+
facilityId?: mongoose.Types.ObjectId;
|
|
104
106
|
masterCode?: string;
|
|
105
107
|
payoffDate?: Date;
|
|
106
108
|
isParticipant?: boolean;
|
|
@@ -110,24 +112,25 @@ export declare const LoanProductSchema: mongoose.Schema<any, mongoose.Model<any,
|
|
|
110
112
|
prepaymentTerms?: string;
|
|
111
113
|
settlementCode?: string;
|
|
112
114
|
deactivationDate?: Date;
|
|
115
|
+
__v?: number;
|
|
113
116
|
}, mongoose.Document<unknown, {}, mongoose.FlatRecord<{
|
|
114
117
|
createdAt: NativeDate;
|
|
115
118
|
updatedAt: NativeDate;
|
|
116
119
|
} & {
|
|
117
120
|
borrowerId: mongoose.Types.ObjectId;
|
|
118
|
-
|
|
119
|
-
name: string;
|
|
121
|
+
masterLoanProductId: mongoose.Types.ObjectId;
|
|
120
122
|
order: number;
|
|
121
123
|
active: boolean;
|
|
122
124
|
code: string;
|
|
125
|
+
name: string;
|
|
126
|
+
type: string;
|
|
123
127
|
startDate: Date;
|
|
124
128
|
maturityDate: Date;
|
|
125
129
|
commitment: number;
|
|
126
130
|
isBalanceActual: boolean;
|
|
127
131
|
isFloatedBalanceActual: boolean;
|
|
128
|
-
masterLoanProductId: mongoose.Types.ObjectId;
|
|
129
132
|
isDefaultPaymentOrder: boolean;
|
|
130
|
-
|
|
133
|
+
facilityId?: mongoose.Types.ObjectId;
|
|
131
134
|
masterCode?: string;
|
|
132
135
|
payoffDate?: Date;
|
|
133
136
|
isParticipant?: boolean;
|
|
@@ -137,24 +140,25 @@ export declare const LoanProductSchema: mongoose.Schema<any, mongoose.Model<any,
|
|
|
137
140
|
prepaymentTerms?: string;
|
|
138
141
|
settlementCode?: string;
|
|
139
142
|
deactivationDate?: Date;
|
|
143
|
+
__v?: number;
|
|
140
144
|
}>> & mongoose.FlatRecord<{
|
|
141
145
|
createdAt: NativeDate;
|
|
142
146
|
updatedAt: NativeDate;
|
|
143
147
|
} & {
|
|
144
148
|
borrowerId: mongoose.Types.ObjectId;
|
|
145
|
-
|
|
146
|
-
name: string;
|
|
149
|
+
masterLoanProductId: mongoose.Types.ObjectId;
|
|
147
150
|
order: number;
|
|
148
151
|
active: boolean;
|
|
149
152
|
code: string;
|
|
153
|
+
name: string;
|
|
154
|
+
type: string;
|
|
150
155
|
startDate: Date;
|
|
151
156
|
maturityDate: Date;
|
|
152
157
|
commitment: number;
|
|
153
158
|
isBalanceActual: boolean;
|
|
154
159
|
isFloatedBalanceActual: boolean;
|
|
155
|
-
masterLoanProductId: mongoose.Types.ObjectId;
|
|
156
160
|
isDefaultPaymentOrder: boolean;
|
|
157
|
-
|
|
161
|
+
facilityId?: mongoose.Types.ObjectId;
|
|
158
162
|
masterCode?: string;
|
|
159
163
|
payoffDate?: Date;
|
|
160
164
|
isParticipant?: boolean;
|
|
@@ -164,6 +168,7 @@ export declare const LoanProductSchema: mongoose.Schema<any, mongoose.Model<any,
|
|
|
164
168
|
prepaymentTerms?: string;
|
|
165
169
|
settlementCode?: string;
|
|
166
170
|
deactivationDate?: Date;
|
|
171
|
+
__v?: number;
|
|
167
172
|
}> & {
|
|
168
173
|
_id: mongoose.Types.ObjectId;
|
|
169
174
|
}>;
|
|
@@ -12,6 +12,10 @@ exports.LoanProductSchema = new mongoose_1.default.Schema({
|
|
|
12
12
|
ref: _models_1.MODEL_NAMES.borrowers,
|
|
13
13
|
required: true,
|
|
14
14
|
},
|
|
15
|
+
facilityId: {
|
|
16
|
+
type: mongoose_1.default.Schema.Types.ObjectId,
|
|
17
|
+
ref: _models_1.MODEL_NAMES.facilities,
|
|
18
|
+
},
|
|
15
19
|
order: {
|
|
16
20
|
type: Number,
|
|
17
21
|
required: true,
|
|
@@ -6,6 +6,7 @@ import { IBorrowerLean } from './Borrower.model';
|
|
|
6
6
|
|
|
7
7
|
export interface ILoanProduct {
|
|
8
8
|
borrowerId: mongoose.Types.ObjectId;
|
|
9
|
+
facilityId?: mongoose.Types.ObjectId;
|
|
9
10
|
order: number;
|
|
10
11
|
active: boolean;
|
|
11
12
|
code: string;
|
|
@@ -42,10 +43,11 @@ export interface ILoanProductLean extends ILoanProduct {
|
|
|
42
43
|
updatedAt: Date;
|
|
43
44
|
}
|
|
44
45
|
|
|
45
|
-
export interface ILoanProductPlain extends Omit<ILoanProduct, 'borrowerId' | 'masterLoanProductId'> {
|
|
46
|
+
export interface ILoanProductPlain extends Omit<ILoanProduct, 'borrowerId' | 'masterLoanProductId' | 'facilityId'> {
|
|
46
47
|
_id: string;
|
|
47
48
|
borrowerId: string;
|
|
48
49
|
masterLoanProductId: string;
|
|
50
|
+
facilityId: string;
|
|
49
51
|
}
|
|
50
52
|
|
|
51
53
|
export interface ILoanProductWithId extends ILoanProduct {
|
|
@@ -72,6 +74,10 @@ export const LoanProductSchema = new mongoose.Schema(
|
|
|
72
74
|
ref: MODEL_NAMES.borrowers,
|
|
73
75
|
required: true,
|
|
74
76
|
},
|
|
77
|
+
facilityId: {
|
|
78
|
+
type: mongoose.Schema.Types.ObjectId,
|
|
79
|
+
ref: MODEL_NAMES.facilities,
|
|
80
|
+
},
|
|
75
81
|
order: {
|
|
76
82
|
type: Number,
|
|
77
83
|
required: true,
|
|
@@ -56,18 +56,18 @@ export declare const PostponedTransactionSchema: mongoose.Schema<any, mongoose.M
|
|
|
56
56
|
timestamps: false;
|
|
57
57
|
}, {
|
|
58
58
|
productId: mongoose.Types.ObjectId;
|
|
59
|
-
transactionId: mongoose.Types.ObjectId;
|
|
60
59
|
postponedToDate: string;
|
|
60
|
+
transactionId: mongoose.Types.ObjectId;
|
|
61
61
|
__v?: number;
|
|
62
62
|
}, mongoose.Document<unknown, {}, mongoose.FlatRecord<{
|
|
63
63
|
productId: mongoose.Types.ObjectId;
|
|
64
|
-
transactionId: mongoose.Types.ObjectId;
|
|
65
64
|
postponedToDate: string;
|
|
65
|
+
transactionId: mongoose.Types.ObjectId;
|
|
66
66
|
__v?: number;
|
|
67
67
|
}>> & mongoose.FlatRecord<{
|
|
68
68
|
productId: mongoose.Types.ObjectId;
|
|
69
|
-
transactionId: mongoose.Types.ObjectId;
|
|
70
69
|
postponedToDate: string;
|
|
70
|
+
transactionId: mongoose.Types.ObjectId;
|
|
71
71
|
__v?: number;
|
|
72
72
|
}> & {
|
|
73
73
|
_id: mongoose.Types.ObjectId;
|
package/models/_index.d.ts
CHANGED
|
@@ -35,10 +35,10 @@ export declare const allSchemas: {
|
|
|
35
35
|
createdAt: NativeDate;
|
|
36
36
|
updatedAt: NativeDate;
|
|
37
37
|
} & {
|
|
38
|
-
bbcSheetId: import("mongoose").Types.ObjectId;
|
|
39
38
|
order: number;
|
|
40
|
-
apDate: Date;
|
|
41
39
|
amount: number;
|
|
40
|
+
bbcSheetId: import("mongoose").Types.ObjectId;
|
|
41
|
+
apDate: Date;
|
|
42
42
|
__v?: number;
|
|
43
43
|
poNumber?: string;
|
|
44
44
|
customerName?: string;
|
|
@@ -49,10 +49,10 @@ export declare const allSchemas: {
|
|
|
49
49
|
createdAt: NativeDate;
|
|
50
50
|
updatedAt: NativeDate;
|
|
51
51
|
} & {
|
|
52
|
-
bbcSheetId: import("mongoose").Types.ObjectId;
|
|
53
52
|
order: number;
|
|
54
|
-
apDate: Date;
|
|
55
53
|
amount: number;
|
|
54
|
+
bbcSheetId: import("mongoose").Types.ObjectId;
|
|
55
|
+
apDate: Date;
|
|
56
56
|
__v?: number;
|
|
57
57
|
poNumber?: string;
|
|
58
58
|
customerName?: string;
|
|
@@ -63,10 +63,10 @@ export declare const allSchemas: {
|
|
|
63
63
|
createdAt: NativeDate;
|
|
64
64
|
updatedAt: NativeDate;
|
|
65
65
|
} & {
|
|
66
|
-
bbcSheetId: import("mongoose").Types.ObjectId;
|
|
67
66
|
order: number;
|
|
68
|
-
apDate: Date;
|
|
69
67
|
amount: number;
|
|
68
|
+
bbcSheetId: import("mongoose").Types.ObjectId;
|
|
69
|
+
apDate: Date;
|
|
70
70
|
__v?: number;
|
|
71
71
|
poNumber?: string;
|
|
72
72
|
customerName?: string;
|
package/models/_models.d.ts
CHANGED
package/models/_models.js
CHANGED
|
@@ -70,6 +70,7 @@ exports.MODEL_NAMES = {
|
|
|
70
70
|
equipment: 'equipment',
|
|
71
71
|
earlyPayments: 'early_payments',
|
|
72
72
|
externalUserAccess: 'external_user_access',
|
|
73
|
+
facilities: 'facilities',
|
|
73
74
|
financialComplianceBorrowers: 'financialComplianceBorrowers',
|
|
74
75
|
financialComplianceSettings: 'financialComplianceSettings',
|
|
75
76
|
financialIndexes: 'financial_indexes',
|
package/models/_models.ts
CHANGED
|
@@ -67,6 +67,7 @@ export const MODEL_NAMES = {
|
|
|
67
67
|
equipment: 'equipment',
|
|
68
68
|
earlyPayments : 'early_payments',
|
|
69
69
|
externalUserAccess: 'external_user_access',
|
|
70
|
+
facilities: 'facilities',
|
|
70
71
|
financialComplianceBorrowers: 'financialComplianceBorrowers',
|
|
71
72
|
financialComplianceSettings: 'financialComplianceSettings',
|
|
72
73
|
financialIndexes: 'financial_indexes',
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/// <reference types="mongoose/types/types" />
|
|
2
1
|
/// <reference types="mongoose/types/document" />
|
|
2
|
+
/// <reference types="mongoose/types/types" />
|
|
3
3
|
/// <reference types="mongoose/types/aggregate" />
|
|
4
4
|
/// <reference types="mongoose/types/callback" />
|
|
5
5
|
/// <reference types="mongoose/types/collection" />
|
|
@@ -35,7 +35,7 @@ class YieldService {
|
|
|
35
35
|
}
|
|
36
36
|
async getCalculatedYieldTotalsForPeriod(productIds, periodStart, periodEnd) {
|
|
37
37
|
return Yield_model_1.YieldData.find({
|
|
38
|
-
productId: productIds.map((productId) => new mongoose_1.default.Types.ObjectId(productId)),
|
|
38
|
+
productId: { $in: productIds.map((productId) => new mongoose_1.default.Types.ObjectId(productId)) },
|
|
39
39
|
$or: [
|
|
40
40
|
{
|
|
41
41
|
year: periodStart.year,
|
|
@@ -41,7 +41,7 @@ export class YieldService {
|
|
|
41
41
|
|
|
42
42
|
async getCalculatedYieldTotalsForPeriod(productIds: string[], periodStart: ISelectedMonth, periodEnd: ISelectedMonth) {
|
|
43
43
|
return YieldData.find({
|
|
44
|
-
productId: productIds.map((productId) => new mongoose.Types.ObjectId(productId)),
|
|
44
|
+
productId: { $in: productIds.map((productId) => new mongoose.Types.ObjectId(productId)) },
|
|
45
45
|
$or: [
|
|
46
46
|
{
|
|
47
47
|
year: periodStart.year,
|