gemcap-be-common 1.4.189 → 1.4.191
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/FinancialIndexes.model.d.ts +19 -7
- package/models/FinancialIndexes.model.ts +17 -2
- package/models/LoanCharges.model.d.ts +3 -3
- package/models/LoanCharges.model.ts +3 -3
- package/models/LoanProducts.model.d.ts +4 -4
- package/models/LoanProducts.model.ts +4 -4
- package/models/TermLoan.model.d.ts +10 -10
- package/models/TermLoan.model.ts +4 -4
- package/models/TermLoanCalculated.model.d.ts +28 -11
- package/models/TermLoanCalculated.model.ts +23 -2
- package/models/TermLoanSettings.model.d.ts +18 -5
- package/models/TermLoanSettings.model.ts +18 -2
- package/models/_index.d.ts +6 -6
- package/package.json +1 -1
- package/services/borrowers.service.d.ts +2 -2
- package/services/brokers.service.d.ts +2 -2
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -22,44 +22,56 @@
|
|
|
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
|
import { EFinancialIndex } from '../services/financial-indexes.service';
|
|
27
27
|
export interface IFinancialIndex {
|
|
28
28
|
name: EFinancialIndex;
|
|
29
29
|
date: Date;
|
|
30
30
|
value: number;
|
|
31
31
|
}
|
|
32
|
-
export interface IFinancialIndexDoc extends IFinancialIndex, Document {
|
|
32
|
+
export interface IFinancialIndexDoc extends IFinancialIndex, mongoose.Document {
|
|
33
|
+
_id: mongoose.Types.ObjectId;
|
|
34
|
+
createdAt: Date;
|
|
35
|
+
updatedAt: Date;
|
|
36
|
+
}
|
|
37
|
+
export interface IFinancialIndexLean extends IFinancialIndex {
|
|
38
|
+
_id: mongoose.Types.ObjectId;
|
|
39
|
+
createdAt: Date;
|
|
40
|
+
updatedAt: Date;
|
|
33
41
|
}
|
|
42
|
+
export interface IFinancialIndexPlain {
|
|
43
|
+
_id: string;
|
|
44
|
+
}
|
|
45
|
+
export type TFinancialIndexModel = mongoose.Model<IFinancialIndex>;
|
|
34
46
|
export declare const FinancialIndexSchema: mongoose.Schema<any, mongoose.Model<any, any, any, any, any, any>, {}, {}, {}, {}, {
|
|
35
47
|
timestamps: true;
|
|
36
48
|
}, {
|
|
37
49
|
createdAt: NativeDate;
|
|
38
50
|
updatedAt: NativeDate;
|
|
39
51
|
} & {
|
|
40
|
-
date: Date;
|
|
41
52
|
name: string;
|
|
53
|
+
date: Date;
|
|
42
54
|
value: number;
|
|
43
55
|
__v?: number;
|
|
44
56
|
}, mongoose.Document<unknown, {}, mongoose.FlatRecord<{
|
|
45
57
|
createdAt: NativeDate;
|
|
46
58
|
updatedAt: NativeDate;
|
|
47
59
|
} & {
|
|
48
|
-
date: Date;
|
|
49
60
|
name: string;
|
|
61
|
+
date: Date;
|
|
50
62
|
value: number;
|
|
51
63
|
__v?: number;
|
|
52
64
|
}>> & mongoose.FlatRecord<{
|
|
53
65
|
createdAt: NativeDate;
|
|
54
66
|
updatedAt: NativeDate;
|
|
55
67
|
} & {
|
|
56
|
-
date: Date;
|
|
57
68
|
name: string;
|
|
69
|
+
date: Date;
|
|
58
70
|
value: number;
|
|
59
71
|
__v?: number;
|
|
60
72
|
}> & {
|
|
61
73
|
_id: mongoose.Types.ObjectId;
|
|
62
74
|
}>;
|
|
63
|
-
export declare const FinancialIndexesModel: mongoose.Model<IFinancialIndexDoc, {}, {}, {}, mongoose.Document<unknown, {}, IFinancialIndexDoc> & IFinancialIndexDoc & {
|
|
75
|
+
export declare const FinancialIndexesModel: mongoose.Model<IFinancialIndexDoc, {}, {}, {}, mongoose.Document<unknown, {}, IFinancialIndexDoc> & IFinancialIndexDoc & Required<{
|
|
64
76
|
_id: mongoose.Types.ObjectId;
|
|
65
|
-
}
|
|
77
|
+
}>, any>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import mongoose
|
|
1
|
+
import mongoose from 'mongoose';
|
|
2
2
|
|
|
3
3
|
import { MODEL_NAMES } from './_models';
|
|
4
4
|
import { EFinancialIndex } from '../services/financial-indexes.service';
|
|
@@ -9,9 +9,24 @@ export interface IFinancialIndex {
|
|
|
9
9
|
value: number;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
export interface IFinancialIndexDoc extends IFinancialIndex, Document {
|
|
12
|
+
export interface IFinancialIndexDoc extends IFinancialIndex, mongoose.Document {
|
|
13
|
+
_id: mongoose.Types.ObjectId;
|
|
14
|
+
createdAt: Date;
|
|
15
|
+
updatedAt: Date;
|
|
13
16
|
}
|
|
14
17
|
|
|
18
|
+
export interface IFinancialIndexLean extends IFinancialIndex {
|
|
19
|
+
_id: mongoose.Types.ObjectId;
|
|
20
|
+
createdAt: Date;
|
|
21
|
+
updatedAt: Date;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export interface IFinancialIndexPlain {
|
|
25
|
+
_id: string;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export type TFinancialIndexModel = mongoose.Model<IFinancialIndex>;
|
|
29
|
+
|
|
15
30
|
export const FinancialIndexSchema = new mongoose.Schema(
|
|
16
31
|
{
|
|
17
32
|
name: {
|
|
@@ -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
|
import Joi from 'joi';
|
|
27
27
|
import { EChargeCalculationBasis, EChargeFrequencies } from '../enums/loan-types.enum';
|
|
28
28
|
import { ELoanChargeType } from '../enums/loan-charge-type.enum';
|
|
@@ -51,7 +51,7 @@ export interface ILoanChargeWithId extends ILoanCharge {
|
|
|
51
51
|
_id: mongoose.Types.ObjectId;
|
|
52
52
|
}
|
|
53
53
|
export type ILoanChargeView = Omit<ILoanChargeWithId, 'borrowerId' | 'order'>;
|
|
54
|
-
export interface ILoanChargeDoc extends ILoanCharge, Document {
|
|
54
|
+
export interface ILoanChargeDoc extends ILoanCharge, mongoose.Document {
|
|
55
55
|
_id: mongoose.Types.ObjectId;
|
|
56
56
|
createdAt: Date;
|
|
57
57
|
updatedAt: Date;
|
|
@@ -66,7 +66,7 @@ export interface ILoanChargePlain extends Omit<ILoanCharge, 'borrowerId' | 'prod
|
|
|
66
66
|
borrowerId: string;
|
|
67
67
|
productId: string;
|
|
68
68
|
}
|
|
69
|
-
export type TLoanChargeModel = Model<ILoanCharge>;
|
|
69
|
+
export type TLoanChargeModel = mongoose.Model<ILoanCharge>;
|
|
70
70
|
export declare const defaultChargeList: ILoanChargeView[];
|
|
71
71
|
export declare const LoanChargeSchema: mongoose.Schema<any, mongoose.Model<any, any, any, any, any, any>, {}, {}, {}, {}, {
|
|
72
72
|
timestamps: true;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import mongoose
|
|
1
|
+
import mongoose from 'mongoose';
|
|
2
2
|
import Joi from 'joi';
|
|
3
3
|
|
|
4
4
|
import { EChargeCalculationBasis, EChargeFrequencies } from '../enums/loan-types.enum';
|
|
@@ -48,7 +48,7 @@ export interface ILoanChargeWithId extends ILoanCharge {
|
|
|
48
48
|
|
|
49
49
|
export type ILoanChargeView = Omit<ILoanChargeWithId, 'borrowerId' | 'order'>
|
|
50
50
|
|
|
51
|
-
export interface ILoanChargeDoc extends ILoanCharge, Document {
|
|
51
|
+
export interface ILoanChargeDoc extends ILoanCharge, mongoose.Document {
|
|
52
52
|
_id: mongoose.Types.ObjectId;
|
|
53
53
|
createdAt: Date;
|
|
54
54
|
updatedAt: Date;
|
|
@@ -66,7 +66,7 @@ export interface ILoanChargePlain extends Omit<ILoanCharge, 'borrowerId' | 'prod
|
|
|
66
66
|
productId: string;
|
|
67
67
|
}
|
|
68
68
|
|
|
69
|
-
export type TLoanChargeModel = Model<ILoanCharge>;
|
|
69
|
+
export type TLoanChargeModel = mongoose.Model<ILoanCharge>;
|
|
70
70
|
|
|
71
71
|
export const defaultChargeList: ILoanChargeView[] = [
|
|
72
72
|
{
|
|
@@ -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
|
import { ELoanTypes } from '../enums/loan-types.enum';
|
|
27
27
|
export interface ILoanProduct {
|
|
28
28
|
borrowerId: mongoose.Types.ObjectId;
|
|
@@ -48,7 +48,7 @@ export interface ILoanProduct {
|
|
|
48
48
|
calculationRequired: boolean;
|
|
49
49
|
deactivationDate?: Date;
|
|
50
50
|
}
|
|
51
|
-
export interface ILoanProductDoc extends ILoanProduct, Document {
|
|
51
|
+
export interface ILoanProductDoc extends ILoanProduct, mongoose.Document {
|
|
52
52
|
_id: mongoose.Types.ObjectId;
|
|
53
53
|
createdAt: Date;
|
|
54
54
|
updatedAt: Date;
|
|
@@ -70,9 +70,9 @@ export interface ILoanProductViewWithBalances extends ILoanProductView {
|
|
|
70
70
|
balance: number;
|
|
71
71
|
floatedBalance: number;
|
|
72
72
|
}
|
|
73
|
-
export interface ILoanProductDoc extends ILoanProduct, Document {
|
|
73
|
+
export interface ILoanProductDoc extends ILoanProduct, mongoose.Document {
|
|
74
74
|
}
|
|
75
|
-
export type TLoanProductModel = Model<ILoanProduct>;
|
|
75
|
+
export type TLoanProductModel = mongoose.Model<ILoanProduct>;
|
|
76
76
|
export declare const LoanProductSchema: mongoose.Schema<any, mongoose.Model<any, any, any, any, any, any>, {}, {}, {}, {}, {
|
|
77
77
|
timestamps: true;
|
|
78
78
|
}, {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import mongoose
|
|
1
|
+
import mongoose from 'mongoose';
|
|
2
2
|
|
|
3
3
|
import { MODEL_NAMES } from './_models';
|
|
4
4
|
import { ELoanTypes } from '../enums/loan-types.enum';
|
|
@@ -28,7 +28,7 @@ export interface ILoanProduct {
|
|
|
28
28
|
deactivationDate?: Date;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
export interface ILoanProductDoc extends ILoanProduct, Document {
|
|
31
|
+
export interface ILoanProductDoc extends ILoanProduct, mongoose.Document {
|
|
32
32
|
_id: mongoose.Types.ObjectId;
|
|
33
33
|
createdAt: Date;
|
|
34
34
|
updatedAt: Date;
|
|
@@ -56,10 +56,10 @@ export interface ILoanProductViewWithBalances extends ILoanProductView {
|
|
|
56
56
|
floatedBalance: number;
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
-
export interface ILoanProductDoc extends ILoanProduct, Document {
|
|
59
|
+
export interface ILoanProductDoc extends ILoanProduct, mongoose.Document {
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
-
export type TLoanProductModel = Model<ILoanProduct>;
|
|
62
|
+
export type TLoanProductModel = mongoose.Model<ILoanProduct>;
|
|
63
63
|
|
|
64
64
|
export const LoanProductSchema = new mongoose.Schema(
|
|
65
65
|
{
|
|
@@ -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
|
import { ITermLoanSettingsOnly } from './TermLoanSettings.model';
|
|
27
27
|
export declare enum ETermLoanStatus {
|
|
28
28
|
NEW = "NEW",
|
|
@@ -44,7 +44,7 @@ export interface ITermLoan {
|
|
|
44
44
|
lastCalculated: Date;
|
|
45
45
|
calculationStatus: ETermLoanStatus;
|
|
46
46
|
}
|
|
47
|
-
export interface ITermLoanDoc extends ITermLoan, Document {
|
|
47
|
+
export interface ITermLoanDoc extends ITermLoan, mongoose.Document {
|
|
48
48
|
_id: mongoose.Types.ObjectId;
|
|
49
49
|
createdAt: Date;
|
|
50
50
|
updatedAt: Date;
|
|
@@ -62,9 +62,9 @@ export interface ITermLoanView extends ITermLoan {
|
|
|
62
62
|
_id: mongoose.Types.ObjectId;
|
|
63
63
|
settings: ITermLoanSettingsOnly;
|
|
64
64
|
}
|
|
65
|
-
export interface ITermLoanDoc extends ITermLoan, Document {
|
|
65
|
+
export interface ITermLoanDoc extends ITermLoan, mongoose.Document {
|
|
66
66
|
}
|
|
67
|
-
export type TTermLoanModel = Model<ITermLoan>;
|
|
67
|
+
export type TTermLoanModel = mongoose.Model<ITermLoan>;
|
|
68
68
|
export declare const TermLoanSchema: mongoose.Schema<any, mongoose.Model<any, any, any, any, any, any>, {}, {}, {}, {}, {
|
|
69
69
|
timestamps: true;
|
|
70
70
|
}, {
|
|
@@ -72,14 +72,14 @@ export declare const TermLoanSchema: mongoose.Schema<any, mongoose.Model<any, an
|
|
|
72
72
|
updatedAt: NativeDate;
|
|
73
73
|
} & {
|
|
74
74
|
productId: mongoose.Types.ObjectId;
|
|
75
|
+
actual: boolean;
|
|
76
|
+
lastCalculated: Date;
|
|
75
77
|
loanStartDate: Date;
|
|
76
78
|
initialBalance: number;
|
|
77
79
|
interestRate: number;
|
|
78
80
|
adminRate: number;
|
|
79
81
|
primeRate: number;
|
|
80
|
-
actual: boolean;
|
|
81
82
|
isMismatched: boolean;
|
|
82
|
-
lastCalculated: Date;
|
|
83
83
|
calculationStatus: string;
|
|
84
84
|
__v?: number;
|
|
85
85
|
}, mongoose.Document<unknown, {}, mongoose.FlatRecord<{
|
|
@@ -87,14 +87,14 @@ export declare const TermLoanSchema: mongoose.Schema<any, mongoose.Model<any, an
|
|
|
87
87
|
updatedAt: NativeDate;
|
|
88
88
|
} & {
|
|
89
89
|
productId: mongoose.Types.ObjectId;
|
|
90
|
+
actual: boolean;
|
|
91
|
+
lastCalculated: Date;
|
|
90
92
|
loanStartDate: Date;
|
|
91
93
|
initialBalance: number;
|
|
92
94
|
interestRate: number;
|
|
93
95
|
adminRate: number;
|
|
94
96
|
primeRate: number;
|
|
95
|
-
actual: boolean;
|
|
96
97
|
isMismatched: boolean;
|
|
97
|
-
lastCalculated: Date;
|
|
98
98
|
calculationStatus: string;
|
|
99
99
|
__v?: number;
|
|
100
100
|
}>> & mongoose.FlatRecord<{
|
|
@@ -102,14 +102,14 @@ export declare const TermLoanSchema: mongoose.Schema<any, mongoose.Model<any, an
|
|
|
102
102
|
updatedAt: NativeDate;
|
|
103
103
|
} & {
|
|
104
104
|
productId: mongoose.Types.ObjectId;
|
|
105
|
+
actual: boolean;
|
|
106
|
+
lastCalculated: Date;
|
|
105
107
|
loanStartDate: Date;
|
|
106
108
|
initialBalance: number;
|
|
107
109
|
interestRate: number;
|
|
108
110
|
adminRate: number;
|
|
109
111
|
primeRate: number;
|
|
110
|
-
actual: boolean;
|
|
111
112
|
isMismatched: boolean;
|
|
112
|
-
lastCalculated: Date;
|
|
113
113
|
calculationStatus: string;
|
|
114
114
|
__v?: number;
|
|
115
115
|
}> & {
|
package/models/TermLoan.model.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import mongoose
|
|
1
|
+
import mongoose from 'mongoose';
|
|
2
2
|
|
|
3
3
|
import { MODEL_NAMES } from './_models';
|
|
4
4
|
import { ITermLoanSettingsOnly } from './TermLoanSettings.model';
|
|
@@ -38,7 +38,7 @@ export interface ITermLoan {
|
|
|
38
38
|
calculationStatus: ETermLoanStatus;
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
-
export interface ITermLoanDoc extends ITermLoan, Document {
|
|
41
|
+
export interface ITermLoanDoc extends ITermLoan, mongoose.Document {
|
|
42
42
|
_id: mongoose.Types.ObjectId;
|
|
43
43
|
createdAt: Date;
|
|
44
44
|
updatedAt: Date;
|
|
@@ -60,10 +60,10 @@ export interface ITermLoanView extends ITermLoan {
|
|
|
60
60
|
settings: ITermLoanSettingsOnly;
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
-
export interface ITermLoanDoc extends ITermLoan, Document {
|
|
63
|
+
export interface ITermLoanDoc extends ITermLoan, mongoose.Document {
|
|
64
64
|
}
|
|
65
65
|
|
|
66
|
-
export type TTermLoanModel = Model<ITermLoan>;
|
|
66
|
+
export type TTermLoanModel = mongoose.Model<ITermLoan>;
|
|
67
67
|
|
|
68
68
|
export const TermLoanSchema = new mongoose.Schema(
|
|
69
69
|
{
|
|
@@ -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 ITermCalculatedDaily {
|
|
27
27
|
day: string;
|
|
28
28
|
interestRate: number;
|
|
@@ -49,26 +49,43 @@ export interface ITermLoanCalculated {
|
|
|
49
49
|
disbursements: number;
|
|
50
50
|
dailyResults: ITermCalculatedDaily[];
|
|
51
51
|
}
|
|
52
|
-
export interface ITermLoanCalculatedDoc extends ITermLoanCalculated, Document {
|
|
52
|
+
export interface ITermLoanCalculatedDoc extends ITermLoanCalculated, mongoose.Document {
|
|
53
|
+
_id: mongoose.Types.ObjectId;
|
|
54
|
+
createdAt: Date;
|
|
55
|
+
updatedAt: Date;
|
|
56
|
+
}
|
|
57
|
+
export interface ITermLoanCalculatedLean extends ITermLoanCalculated {
|
|
58
|
+
_id: mongoose.Types.ObjectId;
|
|
59
|
+
createdAt: Date;
|
|
60
|
+
updatedAt: Date;
|
|
61
|
+
}
|
|
62
|
+
export interface ITermLoanCalculatedPlain extends Omit<ITermLoanCalculated, 'termLoanId' | 'payments'> {
|
|
63
|
+
_id: string;
|
|
64
|
+
termLoanId: string;
|
|
65
|
+
payments: {
|
|
66
|
+
amount: number;
|
|
67
|
+
paymentId: string;
|
|
68
|
+
}[];
|
|
53
69
|
}
|
|
70
|
+
export type TTermLoanCalculatedModel = mongoose.Model<ITermLoanCalculated>;
|
|
54
71
|
export declare const TermLoanCalculatedSchema: mongoose.Schema<any, mongoose.Model<any, any, any, any, any, any>, {}, {}, {}, {}, {
|
|
55
72
|
timestamps: true;
|
|
56
73
|
}, {
|
|
57
74
|
createdAt: NativeDate;
|
|
58
75
|
updatedAt: NativeDate;
|
|
59
76
|
} & {
|
|
60
|
-
interestRate: number;
|
|
61
77
|
termLoanId: mongoose.Types.ObjectId;
|
|
78
|
+
payments: any[];
|
|
62
79
|
relevantStatement: string;
|
|
63
80
|
openingBalance: number;
|
|
64
81
|
monthlyInterest: number;
|
|
65
82
|
monthlyPrincipal: number;
|
|
66
83
|
closingBalance: number;
|
|
67
84
|
adminFee: number;
|
|
85
|
+
interestRate: number;
|
|
68
86
|
interestDaily: number;
|
|
69
87
|
gracePeriod: boolean;
|
|
70
88
|
amortization: boolean;
|
|
71
|
-
payments: any[];
|
|
72
89
|
disbursements: number;
|
|
73
90
|
dailyResults: mongoose.Types.DocumentArray<{
|
|
74
91
|
interestRate: number;
|
|
@@ -76,24 +93,24 @@ export declare const TermLoanCalculatedSchema: mongoose.Schema<any, mongoose.Mod
|
|
|
76
93
|
interest: number;
|
|
77
94
|
paymentDate: boolean;
|
|
78
95
|
}>;
|
|
79
|
-
__v?: number;
|
|
80
96
|
paymentDueDate?: Date;
|
|
97
|
+
__v?: number;
|
|
81
98
|
}, mongoose.Document<unknown, {}, mongoose.FlatRecord<{
|
|
82
99
|
createdAt: NativeDate;
|
|
83
100
|
updatedAt: NativeDate;
|
|
84
101
|
} & {
|
|
85
|
-
interestRate: number;
|
|
86
102
|
termLoanId: mongoose.Types.ObjectId;
|
|
103
|
+
payments: any[];
|
|
87
104
|
relevantStatement: string;
|
|
88
105
|
openingBalance: number;
|
|
89
106
|
monthlyInterest: number;
|
|
90
107
|
monthlyPrincipal: number;
|
|
91
108
|
closingBalance: number;
|
|
92
109
|
adminFee: number;
|
|
110
|
+
interestRate: number;
|
|
93
111
|
interestDaily: number;
|
|
94
112
|
gracePeriod: boolean;
|
|
95
113
|
amortization: boolean;
|
|
96
|
-
payments: any[];
|
|
97
114
|
disbursements: number;
|
|
98
115
|
dailyResults: mongoose.Types.DocumentArray<{
|
|
99
116
|
interestRate: number;
|
|
@@ -101,24 +118,24 @@ export declare const TermLoanCalculatedSchema: mongoose.Schema<any, mongoose.Mod
|
|
|
101
118
|
interest: number;
|
|
102
119
|
paymentDate: boolean;
|
|
103
120
|
}>;
|
|
104
|
-
__v?: number;
|
|
105
121
|
paymentDueDate?: Date;
|
|
122
|
+
__v?: number;
|
|
106
123
|
}>> & mongoose.FlatRecord<{
|
|
107
124
|
createdAt: NativeDate;
|
|
108
125
|
updatedAt: NativeDate;
|
|
109
126
|
} & {
|
|
110
|
-
interestRate: number;
|
|
111
127
|
termLoanId: mongoose.Types.ObjectId;
|
|
128
|
+
payments: any[];
|
|
112
129
|
relevantStatement: string;
|
|
113
130
|
openingBalance: number;
|
|
114
131
|
monthlyInterest: number;
|
|
115
132
|
monthlyPrincipal: number;
|
|
116
133
|
closingBalance: number;
|
|
117
134
|
adminFee: number;
|
|
135
|
+
interestRate: number;
|
|
118
136
|
interestDaily: number;
|
|
119
137
|
gracePeriod: boolean;
|
|
120
138
|
amortization: boolean;
|
|
121
|
-
payments: any[];
|
|
122
139
|
disbursements: number;
|
|
123
140
|
dailyResults: mongoose.Types.DocumentArray<{
|
|
124
141
|
interestRate: number;
|
|
@@ -126,8 +143,8 @@ export declare const TermLoanCalculatedSchema: mongoose.Schema<any, mongoose.Mod
|
|
|
126
143
|
interest: number;
|
|
127
144
|
paymentDate: boolean;
|
|
128
145
|
}>;
|
|
129
|
-
__v?: number;
|
|
130
146
|
paymentDueDate?: Date;
|
|
147
|
+
__v?: number;
|
|
131
148
|
}> & {
|
|
132
149
|
_id: mongoose.Types.ObjectId;
|
|
133
150
|
}>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import mongoose
|
|
1
|
+
import mongoose from 'mongoose';
|
|
2
|
+
|
|
2
3
|
import { MODEL_NAMES } from './_models';
|
|
3
4
|
|
|
4
5
|
export interface ITermCalculatedDaily {
|
|
@@ -29,9 +30,29 @@ export interface ITermLoanCalculated {
|
|
|
29
30
|
dailyResults: ITermCalculatedDaily[];
|
|
30
31
|
}
|
|
31
32
|
|
|
32
|
-
export interface ITermLoanCalculatedDoc extends ITermLoanCalculated, Document {
|
|
33
|
+
export interface ITermLoanCalculatedDoc extends ITermLoanCalculated, mongoose.Document {
|
|
34
|
+
_id: mongoose.Types.ObjectId;
|
|
35
|
+
createdAt: Date;
|
|
36
|
+
updatedAt: Date;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export interface ITermLoanCalculatedLean extends ITermLoanCalculated {
|
|
40
|
+
_id: mongoose.Types.ObjectId;
|
|
41
|
+
createdAt: Date;
|
|
42
|
+
updatedAt: Date;
|
|
33
43
|
}
|
|
34
44
|
|
|
45
|
+
export interface ITermLoanCalculatedPlain extends Omit<ITermLoanCalculated, 'termLoanId' | 'payments'> {
|
|
46
|
+
_id: string;
|
|
47
|
+
termLoanId: string;
|
|
48
|
+
payments: {
|
|
49
|
+
amount: number;
|
|
50
|
+
paymentId: string;
|
|
51
|
+
}[];
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export type TTermLoanCalculatedModel = mongoose.Model<ITermLoanCalculated>;
|
|
55
|
+
|
|
35
56
|
export const TermLoanCalculatedSchema = new mongoose.Schema(
|
|
36
57
|
{
|
|
37
58
|
termLoanId: {
|
|
@@ -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 declare const TERM_LOAN_SETTINGS_FIELDS: string[];
|
|
27
27
|
export interface ITermLoanSettingsOnly {
|
|
28
28
|
termMonths: number;
|
|
@@ -33,39 +33,52 @@ export interface ITermLoanSettingsOnly {
|
|
|
33
33
|
export interface ITermLoanSettings extends ITermLoanSettingsOnly {
|
|
34
34
|
termLoanId: mongoose.Types.ObjectId;
|
|
35
35
|
}
|
|
36
|
-
export interface ITermLoanSettingsDoc extends ITermLoanSettings, Document {
|
|
36
|
+
export interface ITermLoanSettingsDoc extends ITermLoanSettings, mongoose.Document {
|
|
37
|
+
_id: mongoose.Types.ObjectId;
|
|
38
|
+
createdAt: Date;
|
|
39
|
+
updatedAt: Date;
|
|
40
|
+
}
|
|
41
|
+
export interface ITermLoanSettingsLean extends ITermLoanSettings {
|
|
42
|
+
_id: mongoose.Types.ObjectId;
|
|
43
|
+
createdAt: Date;
|
|
44
|
+
updatedAt: Date;
|
|
37
45
|
}
|
|
46
|
+
export interface ITermLoanSettingsPlain extends Omit<ITermLoanSettings, 'termLoanId'> {
|
|
47
|
+
_id: string;
|
|
48
|
+
termLoanId: string;
|
|
49
|
+
}
|
|
50
|
+
export type TTermLoanSettingsModel = mongoose.Model<ITermLoanSettings>;
|
|
38
51
|
export declare const TermLoanSettingsSchema: mongoose.Schema<any, mongoose.Model<any, any, any, any, any, any>, {}, {}, {}, {}, {
|
|
39
52
|
timestamps: true;
|
|
40
53
|
}, {
|
|
41
54
|
createdAt: NativeDate;
|
|
42
55
|
updatedAt: NativeDate;
|
|
43
56
|
} & {
|
|
44
|
-
termLoanId: mongoose.Types.ObjectId;
|
|
45
57
|
termMonths: number;
|
|
46
58
|
amortizationProfileMonths: number;
|
|
47
59
|
gracePeriodMonths: number;
|
|
48
60
|
principalDueDay: number;
|
|
61
|
+
termLoanId: mongoose.Types.ObjectId;
|
|
49
62
|
__v?: number;
|
|
50
63
|
}, mongoose.Document<unknown, {}, mongoose.FlatRecord<{
|
|
51
64
|
createdAt: NativeDate;
|
|
52
65
|
updatedAt: NativeDate;
|
|
53
66
|
} & {
|
|
54
|
-
termLoanId: mongoose.Types.ObjectId;
|
|
55
67
|
termMonths: number;
|
|
56
68
|
amortizationProfileMonths: number;
|
|
57
69
|
gracePeriodMonths: number;
|
|
58
70
|
principalDueDay: number;
|
|
71
|
+
termLoanId: mongoose.Types.ObjectId;
|
|
59
72
|
__v?: number;
|
|
60
73
|
}>> & mongoose.FlatRecord<{
|
|
61
74
|
createdAt: NativeDate;
|
|
62
75
|
updatedAt: NativeDate;
|
|
63
76
|
} & {
|
|
64
|
-
termLoanId: mongoose.Types.ObjectId;
|
|
65
77
|
termMonths: number;
|
|
66
78
|
amortizationProfileMonths: number;
|
|
67
79
|
gracePeriodMonths: number;
|
|
68
80
|
principalDueDay: number;
|
|
81
|
+
termLoanId: mongoose.Types.ObjectId;
|
|
69
82
|
__v?: number;
|
|
70
83
|
}> & {
|
|
71
84
|
_id: mongoose.Types.ObjectId;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import mongoose
|
|
1
|
+
import mongoose from 'mongoose';
|
|
2
2
|
import { MODEL_NAMES } from './_models';
|
|
3
3
|
|
|
4
4
|
export const TERM_LOAN_SETTINGS_FIELDS = [
|
|
@@ -19,9 +19,25 @@ export interface ITermLoanSettings extends ITermLoanSettingsOnly {
|
|
|
19
19
|
termLoanId: mongoose.Types.ObjectId;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
export interface ITermLoanSettingsDoc extends ITermLoanSettings, Document {
|
|
22
|
+
export interface ITermLoanSettingsDoc extends ITermLoanSettings, mongoose.Document {
|
|
23
|
+
_id: mongoose.Types.ObjectId;
|
|
24
|
+
createdAt: Date;
|
|
25
|
+
updatedAt: Date;
|
|
23
26
|
}
|
|
24
27
|
|
|
28
|
+
export interface ITermLoanSettingsLean extends ITermLoanSettings {
|
|
29
|
+
_id: mongoose.Types.ObjectId;
|
|
30
|
+
createdAt: Date;
|
|
31
|
+
updatedAt: Date;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export interface ITermLoanSettingsPlain extends Omit<ITermLoanSettings, 'termLoanId'> {
|
|
35
|
+
_id: string;
|
|
36
|
+
termLoanId: string;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export type TTermLoanSettingsModel = mongoose.Model<ITermLoanSettings>;
|
|
40
|
+
|
|
25
41
|
export const TermLoanSettingsSchema = new mongoose.Schema(
|
|
26
42
|
{
|
|
27
43
|
termLoanId: {
|
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
|
-
|
|
34
|
+
amount: number;
|
|
35
35
|
bbcSheetId: import("mongoose").Types.ObjectId;
|
|
36
|
+
order: number;
|
|
36
37
|
apDate: Date;
|
|
37
|
-
amount: number;
|
|
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
|
-
|
|
48
|
+
amount: number;
|
|
49
49
|
bbcSheetId: import("mongoose").Types.ObjectId;
|
|
50
|
+
order: number;
|
|
50
51
|
apDate: Date;
|
|
51
|
-
amount: number;
|
|
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
|
-
|
|
62
|
+
amount: number;
|
|
63
63
|
bbcSheetId: import("mongoose").Types.ObjectId;
|
|
64
|
+
order: number;
|
|
64
65
|
apDate: Date;
|
|
65
|
-
amount: number;
|
|
66
66
|
__v?: number;
|
|
67
67
|
poNumber?: string;
|
|
68
68
|
customerName?: string;
|
package/package.json
CHANGED
|
@@ -84,10 +84,10 @@ export declare class BorrowerService {
|
|
|
84
84
|
getBorrowerCodesMap(): Promise<Map<string, string>>;
|
|
85
85
|
getBorrowerStatementDetails(borrowers: IBorrowerDoc[]): Promise<{
|
|
86
86
|
[x: string]: {
|
|
87
|
+
SELECTED_PERIOD?: boolean;
|
|
88
|
+
ENTIRE_LOAN?: boolean;
|
|
87
89
|
LAST_MONTH?: boolean;
|
|
88
90
|
CURRENT_MONTH?: boolean;
|
|
89
|
-
ENTIRE_LOAN?: boolean;
|
|
90
|
-
SELECTED_PERIOD?: boolean;
|
|
91
91
|
TERM_LOAN?: boolean;
|
|
92
92
|
};
|
|
93
93
|
}>;
|
|
@@ -46,9 +46,9 @@ export declare class BrokersService {
|
|
|
46
46
|
getAllProductBrokers(): Promise<(import("mongoose").FlattenMaps<import("../models/ProductBroker.model").IProductBrokerDoc> & {
|
|
47
47
|
_id: import("mongoose").Types.ObjectId;
|
|
48
48
|
})[]>;
|
|
49
|
-
getBorrowerBrokers(borrowerId: string): Promise<
|
|
49
|
+
getBorrowerBrokers(borrowerId: string): Promise<(import("mongoose").FlattenMaps<import("../models/ProductBroker.model").IProductBrokerDoc> & {
|
|
50
50
|
_id: import("mongoose").Types.ObjectId;
|
|
51
|
-
})[]>;
|
|
51
|
+
})[] | BrokerView[]>;
|
|
52
52
|
getProductBrokers(productId: string): Promise<import("../models/ProductBroker.model").IProductBrokerDocWithBroker[]>;
|
|
53
53
|
getTotalShares(borrowerId: string, brokers: IProductBrokerView[], replaceNames?: boolean): Promise<ProductTotal>;
|
|
54
54
|
getTotals(borrowerId: string): Promise<BrokerTotalView[]>;
|