gemcap-be-common 1.4.3 → 1.4.4

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.
Files changed (67) hide show
  1. package/db/availability.db.d.ts +29 -2
  2. package/db/availability.db.js +1 -72
  3. package/db/availability.db.ts +1 -75
  4. package/models/AccountPayableItem.model.d.ts +3 -3
  5. package/models/AvailabilitySigns.model.d.ts +13 -0
  6. package/models/AvailabilitySigns.model.ts +15 -0
  7. package/models/BBCSheet.model.d.ts +4 -4
  8. package/models/BBCSheet.model.js +1 -2
  9. package/models/BBCSheet.model.ts +2 -3
  10. package/models/BorrowerCompliance.model.d.ts +3 -3
  11. package/models/BorrowerCompliance.model.js +1 -2
  12. package/models/BorrowerCompliance.model.ts +1 -2
  13. package/models/Globals.model.d.ts +4 -4
  14. package/models/Globals.model.js +1 -2
  15. package/models/Globals.model.ts +2 -3
  16. package/models/InventoryItem.model.d.ts +3 -3
  17. package/models/LoanStatementTransaction.model.d.ts +10 -10
  18. package/models/LoanStatementTransaction.model.js +1 -2
  19. package/models/LoanStatementTransaction.model.ts +2 -3
  20. package/models/LoanTransaction.model.d.ts +1 -1
  21. package/models/LoanTransaction.model.js +1 -2
  22. package/models/LoanTransaction.model.ts +2 -3
  23. package/models/MicroserviceTask.model.d.ts +4 -4
  24. package/models/MicroserviceTask.model.js +1 -2
  25. package/models/MicroserviceTask.model.ts +2 -3
  26. package/models/QueryResult.model.d.ts +1 -1
  27. package/models/QueryResult.model.js +1 -2
  28. package/models/QueryResult.model.ts +2 -3
  29. package/models/ReceivableAvailability.model.d.ts +34 -34
  30. package/models/ReceivableAvailability.model.js +1 -2
  31. package/models/ReceivableAvailability.model.ts +2 -3
  32. package/models/TransactionAttachedFile.Model.d.ts +7 -7
  33. package/models/TransactionAttachedFile.Model.js +1 -2
  34. package/models/TransactionAttachedFile.Model.ts +2 -3
  35. package/models/Underwriter.model.d.ts +1 -1
  36. package/models/Underwriter.model.js +1 -2
  37. package/models/Underwriter.model.ts +2 -3
  38. package/models/UploadedFile.model.d.ts +4 -4
  39. package/models/UploadedFile.model.js +1 -2
  40. package/models/UploadedFile.model.ts +2 -3
  41. package/models/UserLog.model.d.ts +1 -1
  42. package/models/UserLog.model.js +1 -2
  43. package/models/UserLog.model.ts +2 -3
  44. package/package.json +1 -1
  45. package/services/attached-files.service.js +1 -1
  46. package/services/attached-files.service.ts +1 -1
  47. package/services/availability.service.js +3 -4
  48. package/services/availability.service.ts +3 -4
  49. package/services/brokers.service.d.ts +2 -2
  50. package/services/compliance-borrowers.service.d.ts +2 -2
  51. package/services/compliance-borrowers.service.js +4 -4
  52. package/services/compliance-borrowers.service.ts +5 -5
  53. package/services/loan-payments.service.js +4 -4
  54. package/services/loan-payments.service.ts +4 -4
  55. package/services/loan-statement.service.d.ts +1 -1
  56. package/services/loan-transactions.service.d.ts +1 -1
  57. package/services/loan-transactions.service.js +2 -2
  58. package/services/loan-transactions.service.ts +2 -2
  59. package/services/signs.service.d.ts +1 -0
  60. package/services/signs.service.js +19 -2
  61. package/services/signs.service.ts +20 -2
  62. package/services/uploads.service.js +1 -1
  63. package/services/uploads.service.ts +1 -1
  64. package/services/users.service.d.ts +7 -7
  65. package/services/users.service.js +1 -2
  66. package/services/users.service.ts +7 -8
  67. package/tsconfig.tsbuildinfo +1 -1
@@ -28,7 +28,7 @@ import { EMicroserviceTaskStatuses } from '../enums/microservice-task-statuses.e
28
28
  export interface IMicroserviceTask {
29
29
  cmd: EMicroserviceTask;
30
30
  params: any;
31
- userId: mongoose.Types.ObjectId;
31
+ userId: string;
32
32
  status: EMicroserviceTaskStatuses;
33
33
  executeAt: Date;
34
34
  }
@@ -42,9 +42,9 @@ export declare const MicroserviceTaskSchema: mongoose.Schema<any, mongoose.Model
42
42
  } & {
43
43
  cmd: string;
44
44
  params: any;
45
+ userId?: string;
45
46
  __v?: number;
46
47
  status?: string;
47
- userId?: mongoose.Types.ObjectId;
48
48
  executeAt?: Date;
49
49
  }, mongoose.Document<unknown, {}, mongoose.FlatRecord<{
50
50
  createdAt: NativeDate;
@@ -52,9 +52,9 @@ export declare const MicroserviceTaskSchema: mongoose.Schema<any, mongoose.Model
52
52
  } & {
53
53
  cmd: string;
54
54
  params: any;
55
+ userId?: string;
55
56
  __v?: number;
56
57
  status?: string;
57
- userId?: mongoose.Types.ObjectId;
58
58
  executeAt?: Date;
59
59
  }>> & mongoose.FlatRecord<{
60
60
  createdAt: NativeDate;
@@ -62,9 +62,9 @@ export declare const MicroserviceTaskSchema: mongoose.Schema<any, mongoose.Model
62
62
  } & {
63
63
  cmd: string;
64
64
  params: any;
65
+ userId?: string;
65
66
  __v?: number;
66
67
  status?: string;
67
- userId?: mongoose.Types.ObjectId;
68
68
  executeAt?: Date;
69
69
  }> & {
70
70
  _id: mongoose.Types.ObjectId;
@@ -17,8 +17,7 @@ exports.MicroserviceTaskSchema = new mongoose_1.default.Schema({
17
17
  required: true,
18
18
  },
19
19
  userId: {
20
- type: mongoose_1.default.Schema.Types.ObjectId,
21
- ref: _models_1.MODEL_NAMES.users,
20
+ type: String,
22
21
  },
23
22
  status: {
24
23
  type: String,
@@ -9,7 +9,7 @@ const mongooseLeanId = require('../plugins/id.plugin');
9
9
  export interface IMicroserviceTask {
10
10
  cmd: EMicroserviceTask;
11
11
  params: any;
12
- userId: mongoose.Types.ObjectId;
12
+ userId: string;
13
13
  status: EMicroserviceTaskStatuses;
14
14
  executeAt: Date;
15
15
  }
@@ -28,8 +28,7 @@ export const MicroserviceTaskSchema = new mongoose.Schema(
28
28
  required: true,
29
29
  },
30
30
  userId: {
31
- type: mongoose.Schema.Types.ObjectId,
32
- ref: MODEL_NAMES.users,
31
+ type: String,
33
32
  },
34
33
  status: {
35
34
  type: String,
@@ -102,7 +102,7 @@ export declare const QUERY_GROUPS: TQueryGroups;
102
102
  export interface IQueryResult {
103
103
  query: string;
104
104
  filter: Object;
105
- userId?: mongoose.Types.ObjectId;
105
+ userId?: string;
106
106
  result: Object;
107
107
  }
108
108
  export interface IQueryResultDoc extends IQueryResult, Document {
@@ -187,8 +187,7 @@ exports.QueryResultSchema = new mongoose_1.default.Schema({
187
187
  },
188
188
  filter: mongoose_1.default.Schema.Types.Mixed,
189
189
  userId: {
190
- type: mongoose_1.default.Schema.Types.ObjectId,
191
- ref: _models_1.MODEL_NAMES.users,
190
+ type: String,
192
191
  required: false,
193
192
  },
194
193
  result: mongoose_1.default.Schema.Types.Mixed,
@@ -215,7 +215,7 @@ export const QUERY_GROUPS: TQueryGroups = {
215
215
  export interface IQueryResult {
216
216
  query: string;
217
217
  filter: Object;
218
- userId?: mongoose.Types.ObjectId;
218
+ userId?: string;
219
219
  result: Object;
220
220
  }
221
221
 
@@ -232,8 +232,7 @@ export const QueryResultSchema = new mongoose.Schema<IQueryResult, TQueryResultM
232
232
  },
233
233
  filter: mongoose.Schema.Types.Mixed,
234
234
  userId: {
235
- type: mongoose.Schema.Types.ObjectId,
236
- ref: MODEL_NAMES.users,
235
+ type: String,
237
236
  required: false,
238
237
  },
239
238
  result: mongoose.Schema.Types.Mixed,
@@ -79,7 +79,7 @@ export interface IReceivableManualSummary {
79
79
  export interface IReceivableAvailability {
80
80
  borrowerId: mongoose.Types.ObjectId;
81
81
  bbcDateId: mongoose.Types.ObjectId;
82
- userCalculatedId: mongoose.Types.ObjectId;
82
+ userCalculatedId: string;
83
83
  calculatedAt: Date;
84
84
  actual: boolean;
85
85
  settings?: IAvailabilitySettings;
@@ -184,49 +184,49 @@ export declare const AvailabilitySchema: mongoose.Schema<any, mongoose.Model<any
184
184
  createdAt: NativeDate;
185
185
  updatedAt: NativeDate;
186
186
  } & {
187
- borrowerId: mongoose.Types.ObjectId;
188
187
  bbcDateId: mongoose.Types.ObjectId;
188
+ borrowerId: mongoose.Types.ObjectId;
189
189
  useManualInputs: boolean;
190
190
  __v?: number;
191
191
  summary?: {
192
192
  invoiceAmount: number;
193
- grossAR: number;
194
- balanceAfterCrossAge: number;
195
- permittedOver: number;
196
193
  creditNotes: number;
197
194
  excludedCustomerDeduction: number;
195
+ grossAR: number;
196
+ permittedOver: number;
197
+ preliminaryEligibleBalance: number;
198
+ creditNotesNegative: number;
198
199
  deduction: number;
199
200
  partiallyPaidDeduction: number;
200
201
  contraDeduction: number;
201
202
  crossAgeDeduction: number;
202
203
  waivedDeduction: number;
204
+ balanceAfterCrossAge: number;
203
205
  finalResult: number;
204
206
  insuredComponent: number;
205
- preliminaryEligibleBalance: number;
206
207
  uninsuredComponent: number;
207
208
  insuredAvailability: number;
208
209
  uninsuredAvailability: number;
209
- creditNotesNegative: number;
210
210
  ARReserves: number;
211
211
  ARAvailability: number;
212
212
  };
213
- userCalculatedId?: mongoose.Types.ObjectId;
214
- calculatedAt?: Date;
215
213
  actual?: boolean;
214
+ userCalculatedId?: string;
215
+ calculatedAt?: Date;
216
216
  settings?: {
217
217
  excludedCustomers: mongoose.Types.DocumentArray<{
218
218
  limit?: number;
219
219
  customer?: string;
220
220
  }>;
221
- permittedConcentration: mongoose.Types.DocumentArray<{
221
+ insuredCustomers: mongoose.Types.DocumentArray<{
222
222
  limit?: number;
223
223
  customer?: string;
224
224
  }>;
225
- permittedExtendedARDays: mongoose.Types.DocumentArray<{
225
+ permittedConcentration: mongoose.Types.DocumentArray<{
226
226
  limit?: number;
227
227
  customer?: string;
228
228
  }>;
229
- insuredCustomers: mongoose.Types.DocumentArray<{
229
+ permittedExtendedARDays: mongoose.Types.DocumentArray<{
230
230
  limit?: number;
231
231
  customer?: string;
232
232
  }>;
@@ -244,49 +244,49 @@ export declare const AvailabilitySchema: mongoose.Schema<any, mongoose.Model<any
244
244
  createdAt: NativeDate;
245
245
  updatedAt: NativeDate;
246
246
  } & {
247
- borrowerId: mongoose.Types.ObjectId;
248
247
  bbcDateId: mongoose.Types.ObjectId;
248
+ borrowerId: mongoose.Types.ObjectId;
249
249
  useManualInputs: boolean;
250
250
  __v?: number;
251
251
  summary?: {
252
252
  invoiceAmount: number;
253
- grossAR: number;
254
- balanceAfterCrossAge: number;
255
- permittedOver: number;
256
253
  creditNotes: number;
257
254
  excludedCustomerDeduction: number;
255
+ grossAR: number;
256
+ permittedOver: number;
257
+ preliminaryEligibleBalance: number;
258
+ creditNotesNegative: number;
258
259
  deduction: number;
259
260
  partiallyPaidDeduction: number;
260
261
  contraDeduction: number;
261
262
  crossAgeDeduction: number;
262
263
  waivedDeduction: number;
264
+ balanceAfterCrossAge: number;
263
265
  finalResult: number;
264
266
  insuredComponent: number;
265
- preliminaryEligibleBalance: number;
266
267
  uninsuredComponent: number;
267
268
  insuredAvailability: number;
268
269
  uninsuredAvailability: number;
269
- creditNotesNegative: number;
270
270
  ARReserves: number;
271
271
  ARAvailability: number;
272
272
  };
273
- userCalculatedId?: mongoose.Types.ObjectId;
274
- calculatedAt?: Date;
275
273
  actual?: boolean;
274
+ userCalculatedId?: string;
275
+ calculatedAt?: Date;
276
276
  settings?: {
277
277
  excludedCustomers: mongoose.Types.DocumentArray<{
278
278
  limit?: number;
279
279
  customer?: string;
280
280
  }>;
281
- permittedConcentration: mongoose.Types.DocumentArray<{
281
+ insuredCustomers: mongoose.Types.DocumentArray<{
282
282
  limit?: number;
283
283
  customer?: string;
284
284
  }>;
285
- permittedExtendedARDays: mongoose.Types.DocumentArray<{
285
+ permittedConcentration: mongoose.Types.DocumentArray<{
286
286
  limit?: number;
287
287
  customer?: string;
288
288
  }>;
289
- insuredCustomers: mongoose.Types.DocumentArray<{
289
+ permittedExtendedARDays: mongoose.Types.DocumentArray<{
290
290
  limit?: number;
291
291
  customer?: string;
292
292
  }>;
@@ -304,49 +304,49 @@ export declare const AvailabilitySchema: mongoose.Schema<any, mongoose.Model<any
304
304
  createdAt: NativeDate;
305
305
  updatedAt: NativeDate;
306
306
  } & {
307
- borrowerId: mongoose.Types.ObjectId;
308
307
  bbcDateId: mongoose.Types.ObjectId;
308
+ borrowerId: mongoose.Types.ObjectId;
309
309
  useManualInputs: boolean;
310
310
  __v?: number;
311
311
  summary?: {
312
312
  invoiceAmount: number;
313
- grossAR: number;
314
- balanceAfterCrossAge: number;
315
- permittedOver: number;
316
313
  creditNotes: number;
317
314
  excludedCustomerDeduction: number;
315
+ grossAR: number;
316
+ permittedOver: number;
317
+ preliminaryEligibleBalance: number;
318
+ creditNotesNegative: number;
318
319
  deduction: number;
319
320
  partiallyPaidDeduction: number;
320
321
  contraDeduction: number;
321
322
  crossAgeDeduction: number;
322
323
  waivedDeduction: number;
324
+ balanceAfterCrossAge: number;
323
325
  finalResult: number;
324
326
  insuredComponent: number;
325
- preliminaryEligibleBalance: number;
326
327
  uninsuredComponent: number;
327
328
  insuredAvailability: number;
328
329
  uninsuredAvailability: number;
329
- creditNotesNegative: number;
330
330
  ARReserves: number;
331
331
  ARAvailability: number;
332
332
  };
333
- userCalculatedId?: mongoose.Types.ObjectId;
334
- calculatedAt?: Date;
335
333
  actual?: boolean;
334
+ userCalculatedId?: string;
335
+ calculatedAt?: Date;
336
336
  settings?: {
337
337
  excludedCustomers: mongoose.Types.DocumentArray<{
338
338
  limit?: number;
339
339
  customer?: string;
340
340
  }>;
341
- permittedConcentration: mongoose.Types.DocumentArray<{
341
+ insuredCustomers: mongoose.Types.DocumentArray<{
342
342
  limit?: number;
343
343
  customer?: string;
344
344
  }>;
345
- permittedExtendedARDays: mongoose.Types.DocumentArray<{
345
+ permittedConcentration: mongoose.Types.DocumentArray<{
346
346
  limit?: number;
347
347
  customer?: string;
348
348
  }>;
349
- insuredCustomers: mongoose.Types.DocumentArray<{
349
+ permittedExtendedARDays: mongoose.Types.DocumentArray<{
350
350
  limit?: number;
351
351
  customer?: string;
352
352
  }>;
@@ -108,8 +108,7 @@ exports.AvailabilitySchema = new mongoose_1.default.Schema({
108
108
  required: true,
109
109
  },
110
110
  userCalculatedId: {
111
- type: mongoose_1.default.Schema.Types.ObjectId,
112
- ref: _models_1.MODEL_NAMES.users,
111
+ type: String,
113
112
  required: false,
114
113
  },
115
114
  calculatedAt: {
@@ -66,7 +66,7 @@ export interface IReceivableManualSummary {
66
66
  export interface IReceivableAvailability {
67
67
  borrowerId: mongoose.Types.ObjectId;
68
68
  bbcDateId: mongoose.Types.ObjectId;
69
- userCalculatedId: mongoose.Types.ObjectId;
69
+ userCalculatedId: string;
70
70
  calculatedAt: Date;
71
71
  actual: boolean;
72
72
  settings?: IAvailabilitySettings;
@@ -182,8 +182,7 @@ export const AvailabilitySchema = new mongoose.Schema(
182
182
  required: true,
183
183
  },
184
184
  userCalculatedId: {
185
- type: mongoose.Schema.Types.ObjectId,
186
- ref: MODEL_NAMES.users,
185
+ type: String,
187
186
  required: false,
188
187
  },
189
188
  calculatedAt: {
@@ -28,7 +28,7 @@ export interface ITransactionAttachedFile {
28
28
  filename: string;
29
29
  originalName: string;
30
30
  effectiveDate: string;
31
- userId: mongoose.Types.ObjectId;
31
+ userId: string;
32
32
  }
33
33
  export interface ITransactionAttachedFileDoc extends ITransactionAttachedFile, mongoose.Document {
34
34
  }
@@ -38,32 +38,32 @@ export declare const TransactionAttachedFileSchema: mongoose.Schema<any, mongoos
38
38
  createdAt: NativeDate;
39
39
  updatedAt: NativeDate;
40
40
  } & {
41
- borrowerId: mongoose.Types.ObjectId;
42
41
  effectiveDate: string;
42
+ borrowerId: mongoose.Types.ObjectId;
43
43
  filename: string;
44
44
  originalName: string;
45
+ userId?: string;
45
46
  __v?: number;
46
- userId?: mongoose.Types.ObjectId;
47
47
  }, mongoose.Document<unknown, {}, mongoose.FlatRecord<{
48
48
  createdAt: NativeDate;
49
49
  updatedAt: NativeDate;
50
50
  } & {
51
- borrowerId: mongoose.Types.ObjectId;
52
51
  effectiveDate: string;
52
+ borrowerId: mongoose.Types.ObjectId;
53
53
  filename: string;
54
54
  originalName: string;
55
+ userId?: string;
55
56
  __v?: number;
56
- userId?: mongoose.Types.ObjectId;
57
57
  }>> & mongoose.FlatRecord<{
58
58
  createdAt: NativeDate;
59
59
  updatedAt: NativeDate;
60
60
  } & {
61
- borrowerId: mongoose.Types.ObjectId;
62
61
  effectiveDate: string;
62
+ borrowerId: mongoose.Types.ObjectId;
63
63
  filename: string;
64
64
  originalName: string;
65
+ userId?: string;
65
66
  __v?: number;
66
- userId?: mongoose.Types.ObjectId;
67
67
  }> & {
68
68
  _id: mongoose.Types.ObjectId;
69
69
  }>;
@@ -28,8 +28,7 @@ exports.TransactionAttachedFileSchema = new mongoose_1.default.Schema({
28
28
  trim: true,
29
29
  },
30
30
  userId: {
31
- type: mongoose_1.default.Schema.Types.ObjectId,
32
- ref: _models_1.MODEL_NAMES.users,
31
+ type: String,
33
32
  required: false,
34
33
  },
35
34
  __v: { type: Number, select: false },
@@ -7,7 +7,7 @@ export interface ITransactionAttachedFile {
7
7
  filename: string;
8
8
  originalName: string;
9
9
  effectiveDate: string;
10
- userId: mongoose.Types.ObjectId;
10
+ userId: string;
11
11
  }
12
12
 
13
13
  export interface ITransactionAttachedFileDoc extends ITransactionAttachedFile, mongoose.Document {
@@ -36,8 +36,7 @@ export const TransactionAttachedFileSchema = new mongoose.Schema(
36
36
  trim: true,
37
37
  },
38
38
  userId: {
39
- type: mongoose.Schema.Types.ObjectId,
40
- ref: MODEL_NAMES.users,
39
+ type: String,
41
40
  required: false,
42
41
  },
43
42
  __v: { type: Number, select: false },
@@ -29,7 +29,7 @@ export interface IUnderwriter {
29
29
  name: string;
30
30
  email: string;
31
31
  order?: number;
32
- userId?: mongoose.Types.ObjectId;
32
+ userId?: string;
33
33
  }
34
34
  export interface IUnderwriterWithId extends IUnderwriter {
35
35
  _id: string;
@@ -32,8 +32,7 @@ exports.UnderwriterSchema = new mongoose_1.default.Schema({
32
32
  type: String,
33
33
  },
34
34
  userId: {
35
- type: mongoose_1.default.Schema.Types.ObjectId,
36
- ref: _models_1.MODEL_NAMES.users,
35
+ type: String,
37
36
  required: false,
38
37
  },
39
38
  }, {
@@ -8,7 +8,7 @@ export interface IUnderwriter {
8
8
  name: string;
9
9
  email: string;
10
10
  order?: number;
11
- userId?: mongoose.Types.ObjectId;
11
+ userId?: string;
12
12
  }
13
13
 
14
14
  export interface IUnderwriterWithId extends IUnderwriter {
@@ -47,8 +47,7 @@ export const UnderwriterSchema = new mongoose.Schema<IUnderwriter, UnderwriterMo
47
47
  type: String,
48
48
  },
49
49
  userId: {
50
- type: mongoose.Schema.Types.ObjectId,
51
- ref: MODEL_NAMES.users,
50
+ type: String,
52
51
  required: false,
53
52
  },
54
53
  },
@@ -28,7 +28,7 @@ export interface IUploadedFile {
28
28
  filename: string;
29
29
  originalName: string;
30
30
  borrowerId: mongoose.Types.ObjectId;
31
- userId: mongoose.Types.ObjectId;
31
+ userId: string;
32
32
  converted?: boolean;
33
33
  type: EUploadTypes;
34
34
  }
@@ -42,9 +42,9 @@ export declare const UploadedFileSchema: mongoose.Schema<any, mongoose.Model<any
42
42
  } & {
43
43
  type: string;
44
44
  converted: boolean;
45
+ userId?: string;
45
46
  __v?: number;
46
47
  borrowerId?: mongoose.Types.ObjectId;
47
- userId?: mongoose.Types.ObjectId;
48
48
  filename?: string;
49
49
  originalName?: string;
50
50
  }, mongoose.Document<unknown, {}, mongoose.FlatRecord<{
@@ -53,9 +53,9 @@ export declare const UploadedFileSchema: mongoose.Schema<any, mongoose.Model<any
53
53
  } & {
54
54
  type: string;
55
55
  converted: boolean;
56
+ userId?: string;
56
57
  __v?: number;
57
58
  borrowerId?: mongoose.Types.ObjectId;
58
- userId?: mongoose.Types.ObjectId;
59
59
  filename?: string;
60
60
  originalName?: string;
61
61
  }>> & mongoose.FlatRecord<{
@@ -64,9 +64,9 @@ export declare const UploadedFileSchema: mongoose.Schema<any, mongoose.Model<any
64
64
  } & {
65
65
  type: string;
66
66
  converted: boolean;
67
+ userId?: string;
67
68
  __v?: number;
68
69
  borrowerId?: mongoose.Types.ObjectId;
69
- userId?: mongoose.Types.ObjectId;
70
70
  filename?: string;
71
71
  originalName?: string;
72
72
  }> & {
@@ -24,8 +24,7 @@ exports.UploadedFileSchema = new mongoose_1.default.Schema({
24
24
  required: false,
25
25
  },
26
26
  userId: {
27
- type: mongoose_1.default.Schema.Types.ObjectId,
28
- ref: _models_1.MODEL_NAMES.users,
27
+ type: String,
29
28
  required: false,
30
29
  },
31
30
  converted: {
@@ -9,7 +9,7 @@ export interface IUploadedFile {
9
9
  filename: string;
10
10
  originalName: string;
11
11
  borrowerId: mongoose.Types.ObjectId;
12
- userId: mongoose.Types.ObjectId;
12
+ userId: string;
13
13
  converted?: boolean;
14
14
  type: EUploadTypes;
15
15
  }
@@ -35,8 +35,7 @@ export const UploadedFileSchema = new mongoose.Schema(
35
35
  required: false,
36
36
  },
37
37
  userId: {
38
- type: mongoose.Schema.Types.ObjectId,
39
- ref: MODEL_NAMES.users,
38
+ type: String,
40
39
  required: false,
41
40
  },
42
41
  converted: {
@@ -46,7 +46,7 @@ export declare enum ELogActionType {
46
46
  export interface IUserLog {
47
47
  _id?: mongoose.Types.ObjectId;
48
48
  logType: ELogType;
49
- userId: mongoose.Types.ObjectId;
49
+ userId: string;
50
50
  timestamp: Date;
51
51
  action: ELogActionType;
52
52
  recordId: mongoose.Types.ObjectId;
@@ -35,8 +35,7 @@ exports.UserLogSchema = new mongoose_1.default.Schema({
35
35
  required: true,
36
36
  },
37
37
  userId: {
38
- type: mongoose_1.default.Schema.Types.ObjectId,
39
- ref: _models_1.MODEL_NAMES.users,
38
+ type: String,
40
39
  required: true,
41
40
  },
42
41
  timestamp: {
@@ -27,7 +27,7 @@ export enum ELogActionType {
27
27
  export interface IUserLog {
28
28
  _id?: mongoose.Types.ObjectId;
29
29
  logType: ELogType;
30
- userId: mongoose.Types.ObjectId;
30
+ userId: string;
31
31
  timestamp: Date;
32
32
  action: ELogActionType;
33
33
  recordId: mongoose.Types.ObjectId;
@@ -49,8 +49,7 @@ export const UserLogSchema = new mongoose.Schema<IUserLog, UserLogModel>(
49
49
  required: true,
50
50
  },
51
51
  userId: {
52
- type: mongoose.Schema.Types.ObjectId,
53
- ref: MODEL_NAMES.users,
52
+ type: String,
54
53
  required: true,
55
54
  },
56
55
  timestamp: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gemcap-be-common",
3
- "version": "1.4.3",
3
+ "version": "1.4.4",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -68,7 +68,7 @@ class AttachedFilesService {
68
68
  }
69
69
  async createAttachedFile(file, userId, effectiveDate, borrowerId) {
70
70
  const newFile = {
71
- userId: new mongoose_1.default.Types.ObjectId(userId),
71
+ userId,
72
72
  filename: file.filename,
73
73
  originalName: file.originalName,
74
74
  effectiveDate,
@@ -89,7 +89,7 @@ export class AttachedFilesService {
89
89
  originalName: string
90
90
  }, userId: string, effectiveDate: string, borrowerId: string) {
91
91
  const newFile: ITransactionAttachedFile = {
92
- userId: new mongoose.Types.ObjectId(userId),
92
+ userId,
93
93
  filename: file.filename,
94
94
  originalName: file.originalName,
95
95
  effectiveDate,
@@ -17,7 +17,6 @@ const ReceivableAvailabilityItem_model_1 = require("../models/ReceivableAvailabi
17
17
  const collaterals_db_1 = require("../db/collaterals.db");
18
18
  const _models_1 = require("../models/_models");
19
19
  const receivables_db_1 = require("../db/receivables.db");
20
- const availability_db_1 = require("../db/availability.db");
21
20
  const bbcSheets_db_1 = require("../db/bbcSheets.db");
22
21
  const CustomerGroup_model_1 = require("../models/CustomerGroup.model");
23
22
  const partially_paid_restated_1 = require("../queries/receivable/partially-paid-restated");
@@ -91,7 +90,7 @@ class AvailabilityService {
91
90
  const calculation = {
92
91
  borrowerId: null,
93
92
  bbcDateId: new mongoose_1.default.Types.ObjectId(bbcDateId),
94
- userCalculatedId: user?.id ? new mongoose_1.default.Types.ObjectId(String(user.id)) : null,
93
+ userCalculatedId: user?.id ? user.id : null,
95
94
  calculatedAt: new Date(),
96
95
  actual: true,
97
96
  settings: calculationsSettings,
@@ -589,7 +588,7 @@ class AvailabilityService {
589
588
  },
590
589
  {
591
590
  $lookup: {
592
- from: 'users',
591
+ from: _models_1.MODEL_NAMES.users,
593
592
  localField: 'userCalculatedId',
594
593
  foreignField: '_id',
595
594
  as: 'userCalculated',
@@ -883,7 +882,7 @@ class AvailabilityService {
883
882
  };
884
883
  }
885
884
  async isBBCEditable(bbcDateId) {
886
- const availabilitiesSigns = await (0, availability_db_1.getAvailabilitySigns)([bbcDateId]);
885
+ const availabilitiesSigns = await this.signsService.getAvailabilitiesSigns([bbcDateId]);
887
886
  if (!availabilitiesSigns.length) {
888
887
  return true;
889
888
  }
@@ -29,7 +29,6 @@ import { getCollateralDocsByBBC, ITEMS_PAGINATION } from '../db/collaterals.db';
29
29
  import { IAvailabilitySignView } from '../models/AvailabilitySigns.model';
30
30
  import { MODEL_NAMES } from '../models/_models';
31
31
  import { setReceivableManualInputsToggle } from '../db/receivables.db';
32
- import { getAvailabilitySigns } from '../db/availability.db';
33
32
  import { IInventoryAvailabilitySummary, InventoryAvailabilityPaginators } from '../models/InventoryAvailability.model';
34
33
  import { getBBCSheetsByType } from '../db/bbcSheets.db';
35
34
  import { CustomerGroupModel } from '../models/CustomerGroup.model';
@@ -160,7 +159,7 @@ export class AvailabilityService {
160
159
  const calculation: IReceivableAvailability = {
161
160
  borrowerId: null,
162
161
  bbcDateId: new mongoose.Types.ObjectId(bbcDateId),
163
- userCalculatedId: user?.id ? new mongoose.Types.ObjectId(String(user.id)) : null,
162
+ userCalculatedId: user?.id ? user.id : null,
164
163
  calculatedAt: new Date(),
165
164
  actual: true,
166
165
  settings: calculationsSettings,
@@ -704,7 +703,7 @@ export class AvailabilityService {
704
703
  },
705
704
  {
706
705
  $lookup: {
707
- from: 'users',
706
+ from: MODEL_NAMES.users,
708
707
  localField: 'userCalculatedId',
709
708
  foreignField: '_id',
710
709
  as: 'userCalculated',
@@ -1019,7 +1018,7 @@ export class AvailabilityService {
1019
1018
  }
1020
1019
 
1021
1020
  async isBBCEditable(bbcDateId: string): Promise<boolean> {
1022
- const availabilitiesSigns = await getAvailabilitySigns([bbcDateId]);
1021
+ const availabilitiesSigns = await this.signsService.getAvailabilitiesSigns([bbcDateId]);
1023
1022
  if (!availabilitiesSigns.length) {
1024
1023
  return true;
1025
1024
  }