gemcap-be-common 1.5.122 → 1.5.125

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/db/groups.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export declare const getAPCustomerGroups: (borrowerId: any) => Promise<any[]>;
1
+ export declare const getAPCustomerGroups: (borrowerId: string) => Promise<any[]>;
2
2
  export declare const getMappedGroups: ({ group1, group2 }: {
3
3
  group1?: string;
4
4
  group2?: string;
package/db/groups.db.d.ts CHANGED
@@ -1,46 +1,12 @@
1
- /// <reference types="mongoose/types/document" />
2
- /// <reference types="mongoose/types/types" />
3
- /// <reference types="mongoose/types/models" />
4
- /// <reference types="mongoose/types/aggregate" />
5
- /// <reference types="mongoose/types/callback" />
6
- /// <reference types="mongoose/types/collection" />
7
- /// <reference types="mongoose/types/connection" />
8
- /// <reference types="mongoose/types/cursor" />
9
- /// <reference types="mongoose/types/document" />
10
- /// <reference types="mongoose/types/error" />
11
- /// <reference types="mongoose/types/expressions" />
12
- /// <reference types="mongoose/types/helpers" />
13
- /// <reference types="mongoose/types/middlewares" />
14
- /// <reference types="mongoose/types/indexes" />
15
- /// <reference types="mongoose/types/models" />
16
- /// <reference types="mongoose/types/mongooseoptions" />
17
- /// <reference types="mongoose/types/pipelinestage" />
18
- /// <reference types="mongoose/types/populate" />
19
- /// <reference types="mongoose/types/query" />
20
- /// <reference types="mongoose/types/schemaoptions" />
21
- /// <reference types="mongoose/types/schematypes" />
22
- /// <reference types="mongoose/types/session" />
23
- /// <reference types="mongoose/types/types" />
24
- /// <reference types="mongoose/types/utility" />
25
- /// <reference types="mongoose/types/validation" />
26
- /// <reference types="mongoose/types/virtuals" />
27
- /// <reference types="mongoose" />
28
- /// <reference types="mongoose/types/inferschematype" />
29
1
  export declare const groupsMap: {
30
2
  customers: {
31
- Model: import("mongoose").Model<import("../models/CustomerGroup.model").ICustomerGroupDocument, {}, {}, {}, import("mongoose").Document<unknown, {}, import("../models/CustomerGroup.model").ICustomerGroupDocument> & import("../models/CustomerGroup.model").ICustomerGroupDocument & {
32
- _id: import("mongoose").Types.ObjectId;
33
- }, any>;
3
+ Model: import("../models/CustomerGroup.model").TCustomerGroupModel;
34
4
  };
35
5
  categories: {
36
- Model: import("mongoose").Model<import("../models/CustomerGroup.model").ICustomerGroupDocument, {}, {}, {}, import("mongoose").Document<unknown, {}, import("../models/CustomerGroup.model").ICustomerGroupDocument> & import("../models/CustomerGroup.model").ICustomerGroupDocument & {
37
- _id: import("mongoose").Types.ObjectId;
38
- }, any>;
6
+ Model: import("../models/CategoryGroup.model").TCategoryGroupModel;
39
7
  };
40
8
  vendors: {
41
- Model: import("mongoose").Model<import("../models/CustomerGroup.model").ICustomerGroupDocument, {}, {}, {}, import("mongoose").Document<unknown, {}, import("../models/CustomerGroup.model").ICustomerGroupDocument> & import("../models/CustomerGroup.model").ICustomerGroupDocument & {
42
- _id: import("mongoose").Types.ObjectId;
43
- }, any>;
9
+ Model: import("../models/CustomerAPGroup.model").TICustomerAPGroupModel;
44
10
  };
45
11
  };
46
12
  export declare const getBorrowerGroups: (borrowerId: string, relationshipGroups: string | string[]) => Promise<{
package/db/groups.db.js CHANGED
@@ -2,10 +2,12 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getBorrowerGroups = exports.groupsMap = void 0;
4
4
  const CustomerGroup_model_1 = require("../models/CustomerGroup.model");
5
+ const CustomerAPGroup_model_1 = require("../models/CustomerAPGroup.model");
6
+ const CategoryGroup_model_1 = require("../models/CategoryGroup.model");
5
7
  exports.groupsMap = {
6
- customers: { Model: CustomerGroup_model_1.CustomerGroupModel },
7
- categories: { Model: CustomerGroup_model_1.CustomerGroupModel },
8
- vendors: { Model: CustomerGroup_model_1.CustomerGroupModel },
8
+ customers: { Model: CustomerGroup_model_1.CustomerGroup },
9
+ categories: { Model: CategoryGroup_model_1.CategoryGroup },
10
+ vendors: { Model: CustomerAPGroup_model_1.CustomerAPGroup },
9
11
  };
10
12
  const getBorrowerGroups = async (borrowerId, relationshipGroups) => {
11
13
  if (typeof relationshipGroups == 'string') {
package/db/groups.db.ts CHANGED
@@ -1,9 +1,11 @@
1
- import { CustomerGroupModel } from '../models/CustomerGroup.model';
1
+ import { CustomerGroup } from '../models/CustomerGroup.model';
2
+ import { CustomerAPGroup } from '../models/CustomerAPGroup.model';
3
+ import { CategoryGroup } from '../models/CategoryGroup.model';
2
4
 
3
5
  export const groupsMap = {
4
- customers: { Model: CustomerGroupModel },
5
- categories: { Model: CustomerGroupModel },
6
- vendors: { Model: CustomerGroupModel },
6
+ customers: { Model: CustomerGroup },
7
+ categories: { Model: CategoryGroup },
8
+ vendors: { Model: CustomerAPGroup },
7
9
  }
8
10
 
9
11
  export const getBorrowerGroups = async (borrowerId: string, relationshipGroups: string | string[]) => {
package/db/groups.js CHANGED
@@ -4,10 +4,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.getMappedGroups = exports.getAPCustomerGroups = void 0;
7
- const CustomerAPGroup_model_1 = __importDefault(require("../models/CustomerAPGroup.model"));
8
7
  const MappedGroup_model_1 = __importDefault(require("../models/MappedGroup.model"));
8
+ const CustomerAPGroup_model_1 = require("../models/CustomerAPGroup.model");
9
9
  const getAPCustomerGroups = async (borrowerId) => {
10
- return CustomerAPGroup_model_1.default.aggregate([
10
+ return CustomerAPGroup_model_1.CustomerAPGroup.aggregate([
11
11
  {
12
12
  $match: {
13
13
  'borrowerId': borrowerId
package/db/groups.ts CHANGED
@@ -1,7 +1,7 @@
1
- import CustomerAPGroup from '../models/CustomerAPGroup.model';
2
1
  import MappedGroup from '../models/MappedGroup.model';
2
+ import { CustomerAPGroup } from '../models/CustomerAPGroup.model';
3
3
 
4
- export const getAPCustomerGroups = async (borrowerId) => {
4
+ export const getAPCustomerGroups = async (borrowerId: string) => {
5
5
  return CustomerAPGroup.aggregate([
6
6
  {
7
7
  $match: {
@@ -57,6 +57,7 @@ export interface IBorrowerLean extends IBorrower {
57
57
  }
58
58
  export interface IBorrowerPlain extends Omit<IBorrower, 'organizationId'> {
59
59
  _id: string;
60
+ organizationId: string;
60
61
  createdAt: Date;
61
62
  updatedAt: Date;
62
63
  }
@@ -67,59 +68,59 @@ export declare const BorrowerSchema: mongoose.Schema<any, mongoose.Model<any, an
67
68
  createdAt: NativeDate;
68
69
  updatedAt: NativeDate;
69
70
  } & {
70
- name: string;
71
- active: boolean;
72
71
  code: string;
72
+ name: string;
73
73
  title: string;
74
+ active: boolean;
74
75
  accrualStatus: boolean;
75
- __v?: number;
76
76
  organizationId?: mongoose.Types.ObjectId;
77
77
  schemas?: mongoose.Types.DocumentArray<{
78
- type: string;
79
78
  name: string;
79
+ type: string;
80
80
  data: mongoose.Types.DocumentArray<{
81
81
  column: string;
82
82
  databaseTitle: string;
83
83
  }>;
84
84
  }>;
85
+ __v?: number;
85
86
  }, mongoose.Document<unknown, {}, mongoose.FlatRecord<{
86
87
  createdAt: NativeDate;
87
88
  updatedAt: NativeDate;
88
89
  } & {
89
- name: string;
90
- active: boolean;
91
90
  code: string;
91
+ name: string;
92
92
  title: string;
93
+ active: boolean;
93
94
  accrualStatus: boolean;
94
- __v?: number;
95
95
  organizationId?: mongoose.Types.ObjectId;
96
96
  schemas?: mongoose.Types.DocumentArray<{
97
- type: string;
98
97
  name: string;
98
+ type: string;
99
99
  data: mongoose.Types.DocumentArray<{
100
100
  column: string;
101
101
  databaseTitle: string;
102
102
  }>;
103
103
  }>;
104
+ __v?: number;
104
105
  }>> & mongoose.FlatRecord<{
105
106
  createdAt: NativeDate;
106
107
  updatedAt: NativeDate;
107
108
  } & {
108
- name: string;
109
- active: boolean;
110
109
  code: string;
110
+ name: string;
111
111
  title: string;
112
+ active: boolean;
112
113
  accrualStatus: boolean;
113
- __v?: number;
114
114
  organizationId?: mongoose.Types.ObjectId;
115
115
  schemas?: mongoose.Types.DocumentArray<{
116
- type: string;
117
116
  name: string;
117
+ type: string;
118
118
  data: mongoose.Types.DocumentArray<{
119
119
  column: string;
120
120
  databaseTitle: string;
121
121
  }>;
122
122
  }>;
123
+ __v?: number;
123
124
  }> & {
124
125
  _id: mongoose.Types.ObjectId;
125
126
  }>;
@@ -39,6 +39,7 @@ export interface IBorrowerLean extends IBorrower {
39
39
 
40
40
  export interface IBorrowerPlain extends Omit<IBorrower, 'organizationId'> {
41
41
  _id: string;
42
+ organizationId: string;
42
43
  createdAt: Date;
43
44
  updatedAt: Date;
44
45
  }
@@ -83,13 +83,34 @@ export declare const BorrowerComplianceSchema: mongoose.Schema<any, mongoose.Mod
83
83
  createdAt: NativeDate;
84
84
  updatedAt: NativeDate;
85
85
  } & {
86
+ borrower: mongoose.Types.ObjectId;
87
+ complianceNotes: mongoose.Types.DocumentArray<{
88
+ date: Date;
89
+ note: string;
90
+ user?: string;
91
+ }>;
92
+ borrowerNotes: mongoose.Types.DocumentArray<{
93
+ date: Date;
94
+ note: string;
95
+ user?: string;
96
+ }>;
97
+ mainEmails: mongoose.Types.DocumentArray<{
98
+ title?: string;
99
+ email?: string;
100
+ isActive?: boolean;
101
+ }>;
102
+ financialEmails: mongoose.Types.DocumentArray<{
103
+ title?: string;
104
+ email?: string;
105
+ isActive?: boolean;
106
+ }>;
86
107
  items: mongoose.Types.DocumentArray<{
87
108
  createdAt: NativeDate;
88
109
  updatedAt: NativeDate;
89
110
  } & {
90
111
  emailAddresses: mongoose.Types.DocumentArray<{
91
- email?: string;
92
112
  title?: string;
113
+ email?: string;
93
114
  isActive?: boolean;
94
115
  }>;
95
116
  instances: mongoose.Types.DocumentArray<{
@@ -103,14 +124,26 @@ export declare const BorrowerComplianceSchema: mongoose.Schema<any, mongoose.Mod
103
124
  uploadedAt?: Date;
104
125
  uploadedBy?: string;
105
126
  }>;
106
- status?: string;
107
127
  nextDate?: Date;
108
128
  submittedDate?: Date;
129
+ status?: string;
109
130
  }>;
110
- frequency?: string;
111
131
  startDate?: Date;
132
+ frequency?: string;
112
133
  item?: mongoose.Types.ObjectId;
113
134
  }>;
135
+ __v?: number;
136
+ email?: string;
137
+ isVisible?: boolean;
138
+ isEmailingActive?: boolean;
139
+ isDailyTransactionsEmailingActive?: boolean;
140
+ plaidAccessToken?: string;
141
+ fundingStatus?: string;
142
+ lastEmailSentAt?: Date;
143
+ }, mongoose.Document<unknown, {}, mongoose.FlatRecord<{
144
+ createdAt: NativeDate;
145
+ updatedAt: NativeDate;
146
+ } & {
114
147
  borrower: mongoose.Types.ObjectId;
115
148
  complianceNotes: mongoose.Types.DocumentArray<{
116
149
  date: Date;
@@ -123,34 +156,22 @@ export declare const BorrowerComplianceSchema: mongoose.Schema<any, mongoose.Mod
123
156
  user?: string;
124
157
  }>;
125
158
  mainEmails: mongoose.Types.DocumentArray<{
126
- email?: string;
127
159
  title?: string;
160
+ email?: string;
128
161
  isActive?: boolean;
129
162
  }>;
130
163
  financialEmails: mongoose.Types.DocumentArray<{
131
- email?: string;
132
164
  title?: string;
165
+ email?: string;
133
166
  isActive?: boolean;
134
167
  }>;
135
- __v?: number;
136
- email?: string;
137
- isVisible?: boolean;
138
- isEmailingActive?: boolean;
139
- isDailyTransactionsEmailingActive?: boolean;
140
- plaidAccessToken?: string;
141
- fundingStatus?: string;
142
- lastEmailSentAt?: Date;
143
- }, mongoose.Document<unknown, {}, mongoose.FlatRecord<{
144
- createdAt: NativeDate;
145
- updatedAt: NativeDate;
146
- } & {
147
168
  items: mongoose.Types.DocumentArray<{
148
169
  createdAt: NativeDate;
149
170
  updatedAt: NativeDate;
150
171
  } & {
151
172
  emailAddresses: mongoose.Types.DocumentArray<{
152
- email?: string;
153
173
  title?: string;
174
+ email?: string;
154
175
  isActive?: boolean;
155
176
  }>;
156
177
  instances: mongoose.Types.DocumentArray<{
@@ -164,14 +185,26 @@ export declare const BorrowerComplianceSchema: mongoose.Schema<any, mongoose.Mod
164
185
  uploadedAt?: Date;
165
186
  uploadedBy?: string;
166
187
  }>;
167
- status?: string;
168
188
  nextDate?: Date;
169
189
  submittedDate?: Date;
190
+ status?: string;
170
191
  }>;
171
- frequency?: string;
172
192
  startDate?: Date;
193
+ frequency?: string;
173
194
  item?: mongoose.Types.ObjectId;
174
195
  }>;
196
+ __v?: number;
197
+ email?: string;
198
+ isVisible?: boolean;
199
+ isEmailingActive?: boolean;
200
+ isDailyTransactionsEmailingActive?: boolean;
201
+ plaidAccessToken?: string;
202
+ fundingStatus?: string;
203
+ lastEmailSentAt?: Date;
204
+ }>> & mongoose.FlatRecord<{
205
+ createdAt: NativeDate;
206
+ updatedAt: NativeDate;
207
+ } & {
175
208
  borrower: mongoose.Types.ObjectId;
176
209
  complianceNotes: mongoose.Types.DocumentArray<{
177
210
  date: Date;
@@ -184,34 +217,22 @@ export declare const BorrowerComplianceSchema: mongoose.Schema<any, mongoose.Mod
184
217
  user?: string;
185
218
  }>;
186
219
  mainEmails: mongoose.Types.DocumentArray<{
187
- email?: string;
188
220
  title?: string;
221
+ email?: string;
189
222
  isActive?: boolean;
190
223
  }>;
191
224
  financialEmails: mongoose.Types.DocumentArray<{
192
- email?: string;
193
225
  title?: string;
226
+ email?: string;
194
227
  isActive?: boolean;
195
228
  }>;
196
- __v?: number;
197
- email?: string;
198
- isVisible?: boolean;
199
- isEmailingActive?: boolean;
200
- isDailyTransactionsEmailingActive?: boolean;
201
- plaidAccessToken?: string;
202
- fundingStatus?: string;
203
- lastEmailSentAt?: Date;
204
- }>> & mongoose.FlatRecord<{
205
- createdAt: NativeDate;
206
- updatedAt: NativeDate;
207
- } & {
208
229
  items: mongoose.Types.DocumentArray<{
209
230
  createdAt: NativeDate;
210
231
  updatedAt: NativeDate;
211
232
  } & {
212
233
  emailAddresses: mongoose.Types.DocumentArray<{
213
- email?: string;
214
234
  title?: string;
235
+ email?: string;
215
236
  isActive?: boolean;
216
237
  }>;
217
238
  instances: mongoose.Types.DocumentArray<{
@@ -225,35 +246,14 @@ export declare const BorrowerComplianceSchema: mongoose.Schema<any, mongoose.Mod
225
246
  uploadedAt?: Date;
226
247
  uploadedBy?: string;
227
248
  }>;
228
- status?: string;
229
249
  nextDate?: Date;
230
250
  submittedDate?: Date;
251
+ status?: string;
231
252
  }>;
232
- frequency?: string;
233
253
  startDate?: Date;
254
+ frequency?: string;
234
255
  item?: mongoose.Types.ObjectId;
235
256
  }>;
236
- borrower: mongoose.Types.ObjectId;
237
- complianceNotes: mongoose.Types.DocumentArray<{
238
- date: Date;
239
- note: string;
240
- user?: string;
241
- }>;
242
- borrowerNotes: mongoose.Types.DocumentArray<{
243
- date: Date;
244
- note: string;
245
- user?: string;
246
- }>;
247
- mainEmails: mongoose.Types.DocumentArray<{
248
- email?: string;
249
- title?: string;
250
- isActive?: boolean;
251
- }>;
252
- financialEmails: mongoose.Types.DocumentArray<{
253
- email?: string;
254
- title?: string;
255
- isActive?: boolean;
256
- }>;
257
257
  __v?: number;
258
258
  email?: string;
259
259
  isVisible?: boolean;
@@ -0,0 +1,75 @@
1
+ /// <reference types="mongoose/types/types" />
2
+ /// <reference types="mongoose/types/models" />
3
+ /// <reference types="mongoose/types/utility" />
4
+ /// <reference types="mongoose/types/document" />
5
+ /// <reference types="mongoose/types/aggregate" />
6
+ /// <reference types="mongoose/types/callback" />
7
+ /// <reference types="mongoose/types/collection" />
8
+ /// <reference types="mongoose/types/connection" />
9
+ /// <reference types="mongoose/types/cursor" />
10
+ /// <reference types="mongoose/types/document" />
11
+ /// <reference types="mongoose/types/error" />
12
+ /// <reference types="mongoose/types/expressions" />
13
+ /// <reference types="mongoose/types/helpers" />
14
+ /// <reference types="mongoose/types/middlewares" />
15
+ /// <reference types="mongoose/types/indexes" />
16
+ /// <reference types="mongoose/types/models" />
17
+ /// <reference types="mongoose/types/mongooseoptions" />
18
+ /// <reference types="mongoose/types/pipelinestage" />
19
+ /// <reference types="mongoose/types/populate" />
20
+ /// <reference types="mongoose/types/query" />
21
+ /// <reference types="mongoose/types/schemaoptions" />
22
+ /// <reference types="mongoose/types/schematypes" />
23
+ /// <reference types="mongoose/types/session" />
24
+ /// <reference types="mongoose/types/types" />
25
+ /// <reference types="mongoose/types/utility" />
26
+ /// <reference types="mongoose/types/validation" />
27
+ /// <reference types="mongoose/types/virtuals" />
28
+ /// <reference types="mongoose/types/inferschematype" />
29
+ import mongoose from 'mongoose';
30
+ import { IBorrowerGroup } from '../interfaces/group.interface';
31
+ export interface ICategoryGroup extends IBorrowerGroup {
32
+ }
33
+ export interface ICategoryGroupLean extends ICategoryGroup {
34
+ _id: mongoose.Types.ObjectId;
35
+ createdAt: Date;
36
+ updatedAt: Date;
37
+ }
38
+ export interface ICategoryGroupPlain extends Omit<ICategoryGroup, 'borrowerId'> {
39
+ _id: string;
40
+ borrowerId: string;
41
+ createdAt: Date;
42
+ updatedAt: Date;
43
+ }
44
+ export type TCategoryGroupDoc = mongoose.HydratedDocument<ICategoryGroup>;
45
+ export type TCategoryGroupModel = mongoose.Model<ICategoryGroup>;
46
+ export declare const CategoryGroupSchema: mongoose.Schema<any, mongoose.Model<any, any, any, any, any, any>, {}, {}, {}, {}, {
47
+ timestamps: true;
48
+ }, {
49
+ createdAt: NativeDate;
50
+ updatedAt: NativeDate;
51
+ } & {
52
+ borrowerId: mongoose.Types.ObjectId;
53
+ groupName: string;
54
+ items: string[];
55
+ __v?: number;
56
+ }, mongoose.Document<unknown, {}, mongoose.FlatRecord<{
57
+ createdAt: NativeDate;
58
+ updatedAt: NativeDate;
59
+ } & {
60
+ borrowerId: mongoose.Types.ObjectId;
61
+ groupName: string;
62
+ items: string[];
63
+ __v?: number;
64
+ }>> & mongoose.FlatRecord<{
65
+ createdAt: NativeDate;
66
+ updatedAt: NativeDate;
67
+ } & {
68
+ borrowerId: mongoose.Types.ObjectId;
69
+ groupName: string;
70
+ items: string[];
71
+ __v?: number;
72
+ }> & {
73
+ _id: mongoose.Types.ObjectId;
74
+ }>;
75
+ export declare const CategoryGroup: TCategoryGroupModel;
@@ -0,0 +1,23 @@
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.CategoryGroup = exports.CategoryGroupSchema = void 0;
7
+ const mongoose_1 = __importDefault(require("mongoose"));
8
+ const _models_1 = require("./_models");
9
+ exports.CategoryGroupSchema = new mongoose_1.default.Schema({
10
+ groupName: {
11
+ type: String,
12
+ trim: true,
13
+ required: true,
14
+ },
15
+ borrowerId: {
16
+ type: mongoose_1.default.Schema.Types.ObjectId,
17
+ ref: _models_1.MODEL_NAMES.borrowers,
18
+ required: true,
19
+ },
20
+ items: [String],
21
+ __v: { type: Number, select: false },
22
+ }, { timestamps: true });
23
+ exports.CategoryGroup = mongoose_1.default.model(_models_1.MODEL_NAMES.categoryGroups, exports.CategoryGroupSchema);
@@ -0,0 +1,44 @@
1
+ import mongoose from 'mongoose';
2
+
3
+ import { MODEL_NAMES } from './_models';
4
+ import { IBorrowerGroup } from '../interfaces/group.interface';
5
+
6
+ export interface ICategoryGroup extends IBorrowerGroup {
7
+ }
8
+
9
+ export interface ICategoryGroupLean extends ICategoryGroup {
10
+ _id: mongoose.Types.ObjectId;
11
+ createdAt: Date;
12
+ updatedAt: Date;
13
+ }
14
+
15
+ export interface ICategoryGroupPlain extends Omit<ICategoryGroup, 'borrowerId'> {
16
+ _id: string;
17
+ borrowerId: string;
18
+ createdAt: Date;
19
+ updatedAt: Date;
20
+ }
21
+
22
+ export type TCategoryGroupDoc = mongoose.HydratedDocument<ICategoryGroup>;
23
+
24
+ export type TCategoryGroupModel = mongoose.Model<ICategoryGroup>;
25
+
26
+ export const CategoryGroupSchema = new mongoose.Schema(
27
+ {
28
+ groupName: {
29
+ type: String,
30
+ trim: true,
31
+ required: true,
32
+ },
33
+ borrowerId: {
34
+ type: mongoose.Schema.Types.ObjectId,
35
+ ref: MODEL_NAMES.borrowers,
36
+ required: true,
37
+ },
38
+ items: [String],
39
+ __v: { type: Number, select: false },
40
+ },
41
+ { timestamps: true }
42
+ );
43
+
44
+ export const CategoryGroup = mongoose.model<ICategoryGroup, TCategoryGroupModel>(MODEL_NAMES.categoryGroups, CategoryGroupSchema);
@@ -1,7 +1,7 @@
1
- /// <reference types="mongoose/types/document" />
2
- /// <reference types="mongoose/types/models" />
3
1
  /// <reference types="mongoose/types/types" />
2
+ /// <reference types="mongoose/types/models" />
4
3
  /// <reference types="mongoose/types/utility" />
4
+ /// <reference types="mongoose/types/document" />
5
5
  /// <reference types="mongoose/types/aggregate" />
6
6
  /// <reference types="mongoose/types/callback" />
7
7
  /// <reference types="mongoose/types/collection" />
@@ -26,40 +26,50 @@
26
26
  /// <reference types="mongoose/types/validation" />
27
27
  /// <reference types="mongoose/types/virtuals" />
28
28
  /// <reference types="mongoose/types/inferschematype" />
29
- import mongoose, { Document } from 'mongoose';
29
+ import mongoose from 'mongoose';
30
30
  import { IBorrowerGroup } from '../interfaces/group.interface';
31
- interface ICustomerAPGroupDocument extends IBorrowerGroup, Document {
31
+ export interface ICustomerAPGroup extends IBorrowerGroup {
32
+ }
33
+ export interface ICustomerAPGroupLean extends ICustomerAPGroup {
34
+ _id: mongoose.Types.ObjectId;
35
+ createdAt: Date;
36
+ updatedAt: Date;
37
+ }
38
+ export interface ICustomerAPGroupPlain extends Omit<ICustomerAPGroup, 'borrowerId'> {
39
+ _id: string;
40
+ borrowerId: string;
41
+ createdAt: Date;
42
+ updatedAt: Date;
32
43
  }
44
+ export type TCustomerAPGroupDoc = mongoose.HydratedDocument<ICustomerAPGroup>;
45
+ export type TICustomerAPGroupModel = mongoose.Model<ICustomerAPGroup>;
33
46
  export declare const CustomerAPGroupSchema: mongoose.Schema<any, mongoose.Model<any, any, any, any, any, any>, {}, {}, {}, {}, {
34
47
  timestamps: true;
35
48
  }, {
36
49
  createdAt: NativeDate;
37
50
  updatedAt: NativeDate;
38
51
  } & {
39
- groupName: string;
40
52
  borrowerId: mongoose.Types.ObjectId;
53
+ groupName: string;
41
54
  items: string[];
42
55
  __v?: number;
43
56
  }, mongoose.Document<unknown, {}, mongoose.FlatRecord<{
44
57
  createdAt: NativeDate;
45
58
  updatedAt: NativeDate;
46
59
  } & {
47
- groupName: string;
48
60
  borrowerId: mongoose.Types.ObjectId;
61
+ groupName: string;
49
62
  items: string[];
50
63
  __v?: number;
51
64
  }>> & mongoose.FlatRecord<{
52
65
  createdAt: NativeDate;
53
66
  updatedAt: NativeDate;
54
67
  } & {
55
- groupName: string;
56
68
  borrowerId: mongoose.Types.ObjectId;
69
+ groupName: string;
57
70
  items: string[];
58
71
  __v?: number;
59
72
  }> & {
60
73
  _id: mongoose.Types.ObjectId;
61
74
  }>;
62
- declare const _default: mongoose.Model<ICustomerAPGroupDocument, {}, {}, {}, mongoose.Document<unknown, {}, ICustomerAPGroupDocument> & ICustomerAPGroupDocument & {
63
- _id: mongoose.Types.ObjectId;
64
- }, any>;
65
- export default _default;
75
+ export declare const CustomerAPGroup: TICustomerAPGroupModel;
@@ -3,10 +3,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.CustomerAPGroupSchema = void 0;
6
+ exports.CustomerAPGroup = exports.CustomerAPGroupSchema = void 0;
7
7
  const mongoose_1 = __importDefault(require("mongoose"));
8
8
  const _models_1 = require("./_models");
9
- const mongooseLeanId = require('../plugins/id.plugin');
10
9
  exports.CustomerAPGroupSchema = new mongoose_1.default.Schema({
11
10
  groupName: {
12
11
  type: String,
@@ -21,5 +20,4 @@ exports.CustomerAPGroupSchema = new mongoose_1.default.Schema({
21
20
  items: [String],
22
21
  __v: { type: Number, select: false },
23
22
  }, { timestamps: true });
24
- exports.CustomerAPGroupSchema.plugin(mongooseLeanId);
25
- exports.default = mongoose_1.default.model(_models_1.MODEL_NAMES.customerAPGroups, exports.CustomerAPGroupSchema);
23
+ exports.CustomerAPGroup = mongoose_1.default.model(_models_1.MODEL_NAMES.customerAPGroups, exports.CustomerAPGroupSchema);