gemcap-be-common 1.5.55 → 1.5.57
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/enums/modules.enum.d.ts +2 -1
- package/enums/modules.enum.js +1 -0
- package/enums/modules.enum.ts +1 -0
- package/models/Borrower.model.d.ts +11 -12
- package/models/Borrower.model.ts +2 -2
- package/models/LoanProducts.model.d.ts +6 -6
- package/package.json +1 -1
- package/services/organizations.service.d.ts +3 -30
- package/services/organizations.service.js +3 -3
- package/services/organizations.service.ts +6 -6
- package/tsconfig.tsbuildinfo +1 -1
package/enums/modules.enum.d.ts
CHANGED
package/enums/modules.enum.js
CHANGED
package/enums/modules.enum.ts
CHANGED
|
@@ -23,7 +23,6 @@
|
|
|
23
23
|
/// <reference types="mongoose/types/virtuals" />
|
|
24
24
|
/// <reference types="mongoose/types/inferschematype" />
|
|
25
25
|
import mongoose, { Document, Model } from 'mongoose';
|
|
26
|
-
import { IOrganization } from './Organization.model';
|
|
27
26
|
interface ISchemaItem {
|
|
28
27
|
column: string;
|
|
29
28
|
databaseTitle: string;
|
|
@@ -39,7 +38,7 @@ export interface IBorrower {
|
|
|
39
38
|
title: string;
|
|
40
39
|
active: boolean;
|
|
41
40
|
accrualStatus: boolean;
|
|
42
|
-
organizationId:
|
|
41
|
+
organizationId: mongoose.Types.ObjectId;
|
|
43
42
|
schemas: IMapSchema[];
|
|
44
43
|
}
|
|
45
44
|
export interface IBorrowerDoc extends IBorrower, Document {
|
|
@@ -52,7 +51,7 @@ export interface IBorrowerLean extends IBorrower {
|
|
|
52
51
|
createdAt: Date;
|
|
53
52
|
updatedAt: Date;
|
|
54
53
|
}
|
|
55
|
-
export interface IBorrowerPlain extends IBorrower {
|
|
54
|
+
export interface IBorrowerPlain extends Omit<IBorrower, 'organizationId'> {
|
|
56
55
|
_id: string;
|
|
57
56
|
createdAt: Date;
|
|
58
57
|
updatedAt: Date;
|
|
@@ -64,12 +63,11 @@ export declare const BorrowerSchema: mongoose.Schema<any, mongoose.Model<any, an
|
|
|
64
63
|
createdAt: NativeDate;
|
|
65
64
|
updatedAt: NativeDate;
|
|
66
65
|
} & {
|
|
67
|
-
name: string;
|
|
68
|
-
active: boolean;
|
|
69
66
|
code: string;
|
|
67
|
+
name: string;
|
|
70
68
|
title: string;
|
|
69
|
+
active: boolean;
|
|
71
70
|
accrualStatus: boolean;
|
|
72
|
-
__v?: number;
|
|
73
71
|
organizationId?: mongoose.Types.ObjectId;
|
|
74
72
|
schemas?: mongoose.Types.DocumentArray<{
|
|
75
73
|
name: string;
|
|
@@ -79,16 +77,16 @@ export declare const BorrowerSchema: mongoose.Schema<any, mongoose.Model<any, an
|
|
|
79
77
|
databaseTitle: string;
|
|
80
78
|
}>;
|
|
81
79
|
}>;
|
|
80
|
+
__v?: number;
|
|
82
81
|
}, mongoose.Document<unknown, {}, mongoose.FlatRecord<{
|
|
83
82
|
createdAt: NativeDate;
|
|
84
83
|
updatedAt: NativeDate;
|
|
85
84
|
} & {
|
|
86
|
-
name: string;
|
|
87
|
-
active: boolean;
|
|
88
85
|
code: string;
|
|
86
|
+
name: string;
|
|
89
87
|
title: string;
|
|
88
|
+
active: boolean;
|
|
90
89
|
accrualStatus: boolean;
|
|
91
|
-
__v?: number;
|
|
92
90
|
organizationId?: mongoose.Types.ObjectId;
|
|
93
91
|
schemas?: mongoose.Types.DocumentArray<{
|
|
94
92
|
name: string;
|
|
@@ -98,16 +96,16 @@ export declare const BorrowerSchema: mongoose.Schema<any, mongoose.Model<any, an
|
|
|
98
96
|
databaseTitle: string;
|
|
99
97
|
}>;
|
|
100
98
|
}>;
|
|
99
|
+
__v?: number;
|
|
101
100
|
}>> & mongoose.FlatRecord<{
|
|
102
101
|
createdAt: NativeDate;
|
|
103
102
|
updatedAt: NativeDate;
|
|
104
103
|
} & {
|
|
105
|
-
name: string;
|
|
106
|
-
active: boolean;
|
|
107
104
|
code: string;
|
|
105
|
+
name: string;
|
|
108
106
|
title: string;
|
|
107
|
+
active: boolean;
|
|
109
108
|
accrualStatus: boolean;
|
|
110
|
-
__v?: number;
|
|
111
109
|
organizationId?: mongoose.Types.ObjectId;
|
|
112
110
|
schemas?: mongoose.Types.DocumentArray<{
|
|
113
111
|
name: string;
|
|
@@ -117,6 +115,7 @@ export declare const BorrowerSchema: mongoose.Schema<any, mongoose.Model<any, an
|
|
|
117
115
|
databaseTitle: string;
|
|
118
116
|
}>;
|
|
119
117
|
}>;
|
|
118
|
+
__v?: number;
|
|
120
119
|
}> & {
|
|
121
120
|
_id: mongoose.Types.ObjectId;
|
|
122
121
|
}>;
|
package/models/Borrower.model.ts
CHANGED
|
@@ -21,7 +21,7 @@ export interface IBorrower {
|
|
|
21
21
|
title: string;
|
|
22
22
|
active: boolean;
|
|
23
23
|
accrualStatus: boolean;
|
|
24
|
-
organizationId:
|
|
24
|
+
organizationId: mongoose.Types.ObjectId;
|
|
25
25
|
schemas: IMapSchema[];
|
|
26
26
|
}
|
|
27
27
|
|
|
@@ -37,7 +37,7 @@ export interface IBorrowerLean extends IBorrower {
|
|
|
37
37
|
updatedAt: Date;
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
-
export interface IBorrowerPlain extends IBorrower {
|
|
40
|
+
export interface IBorrowerPlain extends Omit<IBorrower, 'organizationId'> {
|
|
41
41
|
_id: string;
|
|
42
42
|
createdAt: Date;
|
|
43
43
|
updatedAt: Date;
|
|
@@ -81,12 +81,12 @@ export declare const LoanProductSchema: mongoose.Schema<any, mongoose.Model<any,
|
|
|
81
81
|
createdAt: NativeDate;
|
|
82
82
|
updatedAt: NativeDate;
|
|
83
83
|
} & {
|
|
84
|
+
code: string;
|
|
84
85
|
name: string;
|
|
86
|
+
active: boolean;
|
|
85
87
|
type: string;
|
|
86
88
|
order: number;
|
|
87
|
-
active: boolean;
|
|
88
89
|
borrowerId: mongoose.Types.ObjectId;
|
|
89
|
-
code: string;
|
|
90
90
|
startDate: Date;
|
|
91
91
|
maturityDate: Date;
|
|
92
92
|
commitment: number;
|
|
@@ -107,12 +107,12 @@ export declare const LoanProductSchema: mongoose.Schema<any, mongoose.Model<any,
|
|
|
107
107
|
createdAt: NativeDate;
|
|
108
108
|
updatedAt: NativeDate;
|
|
109
109
|
} & {
|
|
110
|
+
code: string;
|
|
110
111
|
name: string;
|
|
112
|
+
active: boolean;
|
|
111
113
|
type: string;
|
|
112
114
|
order: number;
|
|
113
|
-
active: boolean;
|
|
114
115
|
borrowerId: mongoose.Types.ObjectId;
|
|
115
|
-
code: string;
|
|
116
116
|
startDate: Date;
|
|
117
117
|
maturityDate: Date;
|
|
118
118
|
commitment: number;
|
|
@@ -133,12 +133,12 @@ export declare const LoanProductSchema: mongoose.Schema<any, mongoose.Model<any,
|
|
|
133
133
|
createdAt: NativeDate;
|
|
134
134
|
updatedAt: NativeDate;
|
|
135
135
|
} & {
|
|
136
|
+
code: string;
|
|
136
137
|
name: string;
|
|
138
|
+
active: boolean;
|
|
137
139
|
type: string;
|
|
138
140
|
order: number;
|
|
139
|
-
active: boolean;
|
|
140
141
|
borrowerId: mongoose.Types.ObjectId;
|
|
141
|
-
code: string;
|
|
142
142
|
startDate: Date;
|
|
143
143
|
maturityDate: Date;
|
|
144
144
|
commitment: number;
|
package/package.json
CHANGED
|
@@ -1,34 +1,7 @@
|
|
|
1
|
-
|
|
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" />
|
|
25
|
-
/// <reference types="mongoose/types/inferschematype" />
|
|
26
|
-
import { IOrganization } from '../models/Organization.model';
|
|
1
|
+
import { IOrganization, IOrganizationLean } from '../models/Organization.model';
|
|
27
2
|
export declare class OrganizationsService {
|
|
28
3
|
getOrganizations(): Promise<IOrganization[]>;
|
|
29
4
|
createInitialOrganizations(): Promise<void>;
|
|
30
|
-
getDefaultOrganization(): Promise<
|
|
31
|
-
|
|
32
|
-
}>;
|
|
33
|
-
getOrganizationForBorrower(borrowerId: string): Promise<IOrganization>;
|
|
5
|
+
getDefaultOrganization(): Promise<IOrganizationLean>;
|
|
6
|
+
getOrganizationForBorrower(borrowerId: string): Promise<IOrganizationLean>;
|
|
34
7
|
}
|
|
@@ -56,15 +56,15 @@ class OrganizationsService {
|
|
|
56
56
|
}));
|
|
57
57
|
}
|
|
58
58
|
async getDefaultOrganization() {
|
|
59
|
-
return Organization_model_1.Organization.findOne({ isDefault: true }).lean();
|
|
59
|
+
return Organization_model_1.Organization.findOne({ isDefault: true }).lean().exec();
|
|
60
60
|
}
|
|
61
61
|
async getOrganizationForBorrower(borrowerId) {
|
|
62
|
-
const borrower = await Borrower_model_1.BorrowerModel.findById(borrowerId).lean();
|
|
62
|
+
const borrower = await Borrower_model_1.BorrowerModel.findById(borrowerId).lean().exec();
|
|
63
63
|
const defaultOrganization = await this.getDefaultOrganization();
|
|
64
64
|
if (!borrower) {
|
|
65
65
|
return defaultOrganization;
|
|
66
66
|
}
|
|
67
|
-
const organization = await Organization_model_1.Organization.findById(borrower.organizationId).lean();
|
|
67
|
+
const organization = await Organization_model_1.Organization.findById(borrower.organizationId).lean().exec();
|
|
68
68
|
if (!organization) {
|
|
69
69
|
return defaultOrganization;
|
|
70
70
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { IOrganization, Organization } from '../models/Organization.model';
|
|
2
|
-
import { BorrowerModel } from '../models/Borrower.model';
|
|
1
|
+
import { IOrganization, IOrganizationLean, Organization } from '../models/Organization.model';
|
|
2
|
+
import { BorrowerModel, IBorrowerLean } from '../models/Borrower.model';
|
|
3
3
|
|
|
4
4
|
import { fieldsToUnset, removeFields } from '../helpers/main.helper';
|
|
5
5
|
import { IOrganizationEmail, OrganizationEmail, OrganizationEmailsType } from '../models/OrganizationEmails.model';
|
|
@@ -66,16 +66,16 @@ export class OrganizationsService {
|
|
|
66
66
|
}
|
|
67
67
|
|
|
68
68
|
async getDefaultOrganization() {
|
|
69
|
-
return Organization.findOne({ isDefault: true }).lean();
|
|
69
|
+
return Organization.findOne({ isDefault: true }).lean<IOrganizationLean>().exec();
|
|
70
70
|
}
|
|
71
71
|
|
|
72
|
-
async getOrganizationForBorrower(borrowerId: string)
|
|
73
|
-
const borrower = await BorrowerModel.findById(borrowerId).lean();
|
|
72
|
+
async getOrganizationForBorrower(borrowerId: string) {
|
|
73
|
+
const borrower = await BorrowerModel.findById(borrowerId).lean<IBorrowerLean>().exec();
|
|
74
74
|
const defaultOrganization = await this.getDefaultOrganization();
|
|
75
75
|
if (!borrower) {
|
|
76
76
|
return defaultOrganization;
|
|
77
77
|
}
|
|
78
|
-
const organization = await Organization.findById(borrower.organizationId).lean();
|
|
78
|
+
const organization = await Organization.findById(borrower.organizationId).lean<IOrganizationLean>().exec();
|
|
79
79
|
if (!organization) {
|
|
80
80
|
return defaultOrganization;
|
|
81
81
|
}
|