gemcap-be-common 1.4.3 → 1.4.5

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 -16
  61. package/services/signs.service.ts +20 -16
  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
@@ -1,6 +1,33 @@
1
- import { IAvailabilitySignDoc, IAvailabilitySignItem, IAvailabilitySignView } from '../models/AvailabilitySigns.model';
1
+ /// <reference types="mongoose/types/aggregate" />
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/types/inferschematype" />
25
+ import mongoose from 'mongoose';
26
+ import { IAvailabilitySignDoc, IAvailabilitySignItem } from '../models/AvailabilitySigns.model';
2
27
  import { IResult } from '../interfaces/result.interface';
3
28
  export declare const findAvailabilitySignsByBBCDateId: (bbcDateId: string) => Promise<IAvailabilitySignDoc>;
4
- export declare const getAvailabilitySigns: (bbcDateIds: string[]) => Promise<IAvailabilitySignView[]>;
29
+ export declare const getAvailabilitySigns: (bbcDateIds: string[]) => Promise<(mongoose.FlattenMaps<IAvailabilitySignDoc> & {
30
+ _id: mongoose.Types.ObjectId;
31
+ })[]>;
5
32
  export declare const addAvailabilitySign: (bbcDateId: string, sign: IAvailabilitySignItem) => Promise<IResult>;
6
33
  export declare const updateAvailabilitySigns: (bbcDateId: string, signs: IAvailabilitySignItem[]) => Promise<void>;
@@ -6,83 +6,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.updateAvailabilitySigns = exports.addAvailabilitySign = exports.getAvailabilitySigns = exports.findAvailabilitySignsByBBCDateId = void 0;
7
7
  const mongoose_1 = __importDefault(require("mongoose"));
8
8
  const AvailabilitySigns_model_1 = require("../models/AvailabilitySigns.model");
9
- const _models_1 = require("../models/_models");
10
9
  const findAvailabilitySignsByBBCDateId = async (bbcDateId) => {
11
10
  return AvailabilitySigns_model_1.AvailabilitySignsModel.findOne({ bbcDateId: new mongoose_1.default.Types.ObjectId(bbcDateId) }).lean();
12
11
  };
13
12
  exports.findAvailabilitySignsByBBCDateId = findAvailabilitySignsByBBCDateId;
14
13
  const getAvailabilitySigns = async (bbcDateIds) => {
15
- return AvailabilitySigns_model_1.AvailabilitySignsModel.aggregate([
16
- {
17
- $match: {
18
- 'bbcDateId': { $in: bbcDateIds.map((bbcDateId) => new mongoose_1.default.Types.ObjectId(bbcDateId)) },
19
- },
20
- }, {
21
- $unwind: {
22
- path: '$signs',
23
- preserveNullAndEmptyArrays: true,
24
- },
25
- }, {
26
- $lookup: {
27
- from: _models_1.MODEL_NAMES.users,
28
- localField: 'signs.userSignedId',
29
- foreignField: '_id',
30
- as: 'signs.userSigned',
31
- },
32
- }, {
33
- $lookup: {
34
- from: _models_1.MODEL_NAMES.users,
35
- localField: 'signs.userRevokedId',
36
- foreignField: '_id',
37
- as: 'signs.userRevoked',
38
- },
39
- }, {
40
- $unwind: {
41
- path: '$signs.userSigned',
42
- preserveNullAndEmptyArrays: true,
43
- },
44
- }, {
45
- $unwind: {
46
- path: '$signs.userRevoked',
47
- preserveNullAndEmptyArrays: true,
48
- },
49
- }, {
50
- $addFields: {
51
- 'signs.userSigned': {
52
- $ifNull: ['$signs.userSigned', { _id: '$signs.userSignedId' }],
53
- },
54
- },
55
- }, {
56
- $addFields: {
57
- 'signs.userRevoked': {
58
- $ifNull: ['$signs.userRevoked', { _id: '$signs.userRevokedId' }],
59
- },
60
- },
61
- }, {
62
- $unset: [
63
- 'signs.userSignedId',
64
- 'signs.userRevokedId',
65
- ],
66
- },
67
- {
68
- $sort: {
69
- 'signs.signedAt': 1,
70
- },
71
- }, {
72
- $group: {
73
- '_id': '$_id',
74
- 'bbcDateId': {
75
- $first: '$bbcDateId',
76
- },
77
- 'requiredSigns': {
78
- $first: '$requiredSigns',
79
- },
80
- 'signs': {
81
- $push: '$signs',
82
- },
83
- },
84
- },
85
- ]);
14
+ return AvailabilitySigns_model_1.AvailabilitySignsModel.find({ bbcDateId: { $in: bbcDateIds } }).lean();
86
15
  };
87
16
  exports.getAvailabilitySigns = getAvailabilitySigns;
88
17
  const addAvailabilitySign = async (bbcDateId, sign) => {
@@ -4,89 +4,15 @@ import {
4
4
  AvailabilitySignsModel,
5
5
  IAvailabilitySignDoc,
6
6
  IAvailabilitySignItem,
7
- IAvailabilitySignView,
8
7
  } from '../models/AvailabilitySigns.model';
9
8
  import { IResult } from '../interfaces/result.interface';
10
- import { MODEL_NAMES } from '../models/_models';
11
9
 
12
10
  export const findAvailabilitySignsByBBCDateId = async (bbcDateId: string): Promise<IAvailabilitySignDoc> => {
13
11
  return AvailabilitySignsModel.findOne({ bbcDateId: new mongoose.Types.ObjectId(bbcDateId) }).lean();
14
12
  };
15
13
 
16
14
  export const getAvailabilitySigns = async (bbcDateIds: string[]) => {
17
- return AvailabilitySignsModel.aggregate<IAvailabilitySignView>([
18
- {
19
- $match: {
20
- 'bbcDateId': { $in: bbcDateIds.map((bbcDateId) => new mongoose.Types.ObjectId(bbcDateId)) },
21
- },
22
- }, {
23
- $unwind: {
24
- path: '$signs',
25
- preserveNullAndEmptyArrays: true,
26
- },
27
- }, {
28
- $lookup: {
29
- from: MODEL_NAMES.users,
30
- localField: 'signs.userSignedId',
31
- foreignField: '_id',
32
- as: 'signs.userSigned',
33
- },
34
- }, {
35
- $lookup:
36
- {
37
- from: MODEL_NAMES.users,
38
- localField: 'signs.userRevokedId',
39
- foreignField: '_id',
40
- as: 'signs.userRevoked',
41
- },
42
- }, {
43
- $unwind: {
44
- path: '$signs.userSigned',
45
- preserveNullAndEmptyArrays: true,
46
- },
47
- }, {
48
- $unwind: {
49
- path: '$signs.userRevoked',
50
- preserveNullAndEmptyArrays: true,
51
- },
52
- }, {
53
- $addFields: {
54
- 'signs.userSigned': {
55
- $ifNull: ['$signs.userSigned', { _id: '$signs.userSignedId' }],
56
- },
57
- },
58
- }, {
59
- $addFields: {
60
- 'signs.userRevoked': {
61
- $ifNull: ['$signs.userRevoked', { _id: '$signs.userRevokedId' }],
62
- },
63
- },
64
- }, {
65
- $unset: [
66
- 'signs.userSignedId',
67
- 'signs.userRevokedId',
68
- ],
69
- },
70
- {
71
- $sort:
72
- {
73
- 'signs.signedAt': 1,
74
- },
75
- }, {
76
- $group: {
77
- '_id': '$_id',
78
- 'bbcDateId': {
79
- $first: '$bbcDateId',
80
- },
81
- 'requiredSigns': {
82
- $first: '$requiredSigns',
83
- },
84
- 'signs': {
85
- $push: '$signs',
86
- },
87
- },
88
- },
89
- ]);
15
+ return AvailabilitySignsModel.find({ bbcDateId: { $in: bbcDateIds } }).lean();
90
16
  };
91
17
 
92
18
  export const addAvailabilitySign = async (bbcDateId: string, sign: IAvailabilitySignItem): Promise<IResult> => {
@@ -43,10 +43,10 @@ export declare const AccountPayableItemSchema: mongoose.Schema<any, mongoose.Mod
43
43
  createdAt: NativeDate;
44
44
  updatedAt: NativeDate;
45
45
  } & {
46
+ amount: number;
46
47
  order: number;
47
48
  bbcSheetId: mongoose.Types.ObjectId;
48
49
  apDate: Date;
49
- amount: number;
50
50
  __v?: number;
51
51
  poNumber?: string;
52
52
  customerName?: string;
@@ -57,10 +57,10 @@ export declare const AccountPayableItemSchema: mongoose.Schema<any, mongoose.Mod
57
57
  createdAt: NativeDate;
58
58
  updatedAt: NativeDate;
59
59
  } & {
60
+ amount: number;
60
61
  order: number;
61
62
  bbcSheetId: mongoose.Types.ObjectId;
62
63
  apDate: Date;
63
- amount: number;
64
64
  __v?: number;
65
65
  poNumber?: string;
66
66
  customerName?: string;
@@ -71,10 +71,10 @@ export declare const AccountPayableItemSchema: mongoose.Schema<any, mongoose.Mod
71
71
  createdAt: NativeDate;
72
72
  updatedAt: NativeDate;
73
73
  } & {
74
+ amount: number;
74
75
  order: number;
75
76
  bbcSheetId: mongoose.Types.ObjectId;
76
77
  apDate: Date;
77
- amount: number;
78
78
  __v?: number;
79
79
  poNumber?: string;
80
80
  customerName?: string;
@@ -31,6 +31,13 @@ export interface IAvailabilitySignItem {
31
31
  userRevokedId?: string;
32
32
  revokedAt?: Date;
33
33
  }
34
+ export interface IAvailabilitySignItemPreView {
35
+ _id: mongoose.Types.ObjectId;
36
+ userSignedId: string;
37
+ signedAt: Date;
38
+ userRevokedId?: string;
39
+ revokedAt?: Date;
40
+ }
34
41
  export interface IAvailabilitySignItemView {
35
42
  _id: mongoose.Types.ObjectId;
36
43
  userSigned: IUser;
@@ -43,6 +50,12 @@ export interface IAvailabilitySign {
43
50
  requiredSigns: number;
44
51
  signs: IAvailabilitySignItem[];
45
52
  }
53
+ export interface IAvailabilitySignPreView {
54
+ _id: mongoose.Types.ObjectId;
55
+ bbcDateId: mongoose.Types.ObjectId;
56
+ requiredSigns: number;
57
+ signs: IAvailabilitySignItemPreView[];
58
+ }
46
59
  export interface IAvailabilitySignView {
47
60
  _id: mongoose.Types.ObjectId;
48
61
  bbcDateId: mongoose.Types.ObjectId;
@@ -14,6 +14,14 @@ export interface IAvailabilitySignItem {
14
14
  revokedAt?: Date;
15
15
  }
16
16
 
17
+ export interface IAvailabilitySignItemPreView {
18
+ _id: mongoose.Types.ObjectId;
19
+ userSignedId: string;
20
+ signedAt: Date;
21
+ userRevokedId?: string;
22
+ revokedAt?: Date;
23
+ }
24
+
17
25
  export interface IAvailabilitySignItemView {
18
26
  _id: mongoose.Types.ObjectId;
19
27
  userSigned: IUser;
@@ -28,6 +36,13 @@ export interface IAvailabilitySign {
28
36
  signs: IAvailabilitySignItem[];
29
37
  }
30
38
 
39
+ export interface IAvailabilitySignPreView {
40
+ _id: mongoose.Types.ObjectId;
41
+ bbcDateId: mongoose.Types.ObjectId;
42
+ requiredSigns: number;
43
+ signs: IAvailabilitySignItemPreView[];
44
+ }
45
+
31
46
  export interface IAvailabilitySignView {
32
47
  _id: mongoose.Types.ObjectId;
33
48
  bbcDateId: mongoose.Types.ObjectId;
@@ -27,7 +27,7 @@ import { IBBCDate } from './BBCDate.model';
27
27
  export interface IBBCSheet {
28
28
  bbcDateId: mongoose.Types.ObjectId;
29
29
  dataType: string;
30
- uploadUser: mongoose.Types.ObjectId;
30
+ uploadUser: string;
31
31
  fileHash: string;
32
32
  fileName: string;
33
33
  sheetName: string;
@@ -48,7 +48,7 @@ export declare const BBCSheetSchema: mongoose.Schema<any, mongoose.Model<any, an
48
48
  dataType: string;
49
49
  __v?: number;
50
50
  comment?: string;
51
- uploadUser?: mongoose.Types.ObjectId;
51
+ uploadUser?: string;
52
52
  fileHash?: string;
53
53
  fileName?: string;
54
54
  sheetName?: string;
@@ -60,7 +60,7 @@ export declare const BBCSheetSchema: mongoose.Schema<any, mongoose.Model<any, an
60
60
  dataType: string;
61
61
  __v?: number;
62
62
  comment?: string;
63
- uploadUser?: mongoose.Types.ObjectId;
63
+ uploadUser?: string;
64
64
  fileHash?: string;
65
65
  fileName?: string;
66
66
  sheetName?: string;
@@ -72,7 +72,7 @@ export declare const BBCSheetSchema: mongoose.Schema<any, mongoose.Model<any, an
72
72
  dataType: string;
73
73
  __v?: number;
74
74
  comment?: string;
75
- uploadUser?: mongoose.Types.ObjectId;
75
+ uploadUser?: string;
76
76
  fileHash?: string;
77
77
  fileName?: string;
78
78
  sheetName?: string;
@@ -22,8 +22,7 @@ exports.BBCSheetSchema = new mongoose_1.default.Schema({
22
22
  trim: true,
23
23
  },
24
24
  uploadUser: {
25
- type: mongoose_1.default.Schema.Types.ObjectId,
26
- ref: _models_1.MODEL_NAMES.users,
25
+ type: String,
27
26
  },
28
27
  fileHash: {
29
28
  type: String,
@@ -11,7 +11,7 @@ const mongooseLeanId = require('../plugins/id.plugin');
11
11
  export interface IBBCSheet {
12
12
  bbcDateId: mongoose.Types.ObjectId;
13
13
  dataType: string;
14
- uploadUser: mongoose.Types.ObjectId;
14
+ uploadUser: string;
15
15
  fileHash: string;
16
16
  fileName: string;
17
17
  sheetName: string;
@@ -38,8 +38,7 @@ export const BBCSheetSchema = new mongoose.Schema(
38
38
  trim: true,
39
39
  },
40
40
  uploadUser: {
41
- type: mongoose.Schema.Types.ObjectId,
42
- ref: MODEL_NAMES.users,
41
+ type: String,
43
42
  },
44
43
  fileHash: {
45
44
  type: String,
@@ -92,7 +92,7 @@ export declare const BorrowerComplianceSchema: mongoose.Schema<any, mongoose.Mod
92
92
  fileId: string;
93
93
  isFileNew?: boolean;
94
94
  uploadedAt?: Date;
95
- uploadedBy?: mongoose.Types.ObjectId;
95
+ uploadedBy?: string;
96
96
  }>;
97
97
  nextDate?: Date;
98
98
  submittedDate?: Date;
@@ -153,7 +153,7 @@ export declare const BorrowerComplianceSchema: mongoose.Schema<any, mongoose.Mod
153
153
  fileId: string;
154
154
  isFileNew?: boolean;
155
155
  uploadedAt?: Date;
156
- uploadedBy?: mongoose.Types.ObjectId;
156
+ uploadedBy?: string;
157
157
  }>;
158
158
  nextDate?: Date;
159
159
  submittedDate?: Date;
@@ -214,7 +214,7 @@ export declare const BorrowerComplianceSchema: mongoose.Schema<any, mongoose.Mod
214
214
  fileId: string;
215
215
  isFileNew?: boolean;
216
216
  uploadedAt?: Date;
217
- uploadedBy?: mongoose.Types.ObjectId;
217
+ uploadedBy?: string;
218
218
  }>;
219
219
  nextDate?: Date;
220
220
  submittedDate?: Date;
@@ -42,8 +42,7 @@ const BorrowerComplianceInstanceSchema = new mongoose_1.default.Schema({
42
42
  required: false,
43
43
  },
44
44
  uploadedBy: {
45
- type: mongoose_1.default.Schema.Types.ObjectId,
46
- ref: _models_1.MODEL_NAMES.users,
45
+ type: String,
47
46
  required: false,
48
47
  },
49
48
  }]
@@ -69,8 +69,7 @@ const BorrowerComplianceInstanceSchema = new mongoose.Schema({
69
69
  required: false,
70
70
  },
71
71
  uploadedBy: {
72
- type: mongoose.Schema.Types.ObjectId,
73
- ref: MODEL_NAMES.users,
72
+ type: String,
74
73
  required: false,
75
74
  },
76
75
  }]
@@ -26,7 +26,7 @@ import mongoose, { Document } from 'mongoose';
26
26
  export interface IGlobals {
27
27
  setting: string;
28
28
  value: any;
29
- userID: mongoose.Types.ObjectId;
29
+ userID: string;
30
30
  }
31
31
  export interface IGlobalsDoc extends IGlobals, Document {
32
32
  }
@@ -39,7 +39,7 @@ export declare const GlobalsSchema: mongoose.Schema<any, mongoose.Model<any, any
39
39
  value: any;
40
40
  setting: string;
41
41
  __v?: number;
42
- userID?: mongoose.Types.ObjectId;
42
+ userID?: string;
43
43
  }, mongoose.Document<unknown, {}, mongoose.FlatRecord<{
44
44
  createdAt: NativeDate;
45
45
  updatedAt: NativeDate;
@@ -47,7 +47,7 @@ export declare const GlobalsSchema: mongoose.Schema<any, mongoose.Model<any, any
47
47
  value: any;
48
48
  setting: string;
49
49
  __v?: number;
50
- userID?: mongoose.Types.ObjectId;
50
+ userID?: string;
51
51
  }>> & mongoose.FlatRecord<{
52
52
  createdAt: NativeDate;
53
53
  updatedAt: NativeDate;
@@ -55,7 +55,7 @@ export declare const GlobalsSchema: mongoose.Schema<any, mongoose.Model<any, any
55
55
  value: any;
56
56
  setting: string;
57
57
  __v?: number;
58
- userID?: mongoose.Types.ObjectId;
58
+ userID?: string;
59
59
  }> & {
60
60
  _id: mongoose.Types.ObjectId;
61
61
  }>;
@@ -16,8 +16,7 @@ exports.GlobalsSchema = new mongoose_1.default.Schema({
16
16
  required: true,
17
17
  },
18
18
  userID: {
19
- type: mongoose_1.default.Schema.Types.ObjectId,
20
- ref: _models_1.MODEL_NAMES.users,
19
+ type: String,
21
20
  },
22
21
  __v: { type: Number, select: false },
23
22
  }, { timestamps: true });
@@ -5,7 +5,7 @@ import { MODEL_NAMES } from './_models';
5
5
  export interface IGlobals {
6
6
  setting: string;
7
7
  value: any;
8
- userID: mongoose.Types.ObjectId;
8
+ userID: string;
9
9
  }
10
10
 
11
11
  export interface IGlobalsDoc extends IGlobals, Document {
@@ -22,8 +22,7 @@ export const GlobalsSchema = new mongoose.Schema(
22
22
  required: true,
23
23
  },
24
24
  userID: {
25
- type: mongoose.Schema.Types.ObjectId,
26
- ref: MODEL_NAMES.users,
25
+ type: String,
27
26
  },
28
27
  __v: { type: Number, select: false },
29
28
  },
@@ -72,8 +72,8 @@ export declare const InventoryItemSchema: mongoose.Schema<any, mongoose.Model<an
72
72
  updatedAt: NativeDate;
73
73
  } & {
74
74
  order: number;
75
- bbcSheetId: mongoose.Types.ObjectId;
76
75
  value: number;
76
+ bbcSheetId: mongoose.Types.ObjectId;
77
77
  skuDate: Date;
78
78
  category: string;
79
79
  sku: string;
@@ -94,8 +94,8 @@ export declare const InventoryItemSchema: mongoose.Schema<any, mongoose.Model<an
94
94
  updatedAt: NativeDate;
95
95
  } & {
96
96
  order: number;
97
- bbcSheetId: mongoose.Types.ObjectId;
98
97
  value: number;
98
+ bbcSheetId: mongoose.Types.ObjectId;
99
99
  skuDate: Date;
100
100
  category: string;
101
101
  sku: string;
@@ -116,8 +116,8 @@ export declare const InventoryItemSchema: mongoose.Schema<any, mongoose.Model<an
116
116
  updatedAt: NativeDate;
117
117
  } & {
118
118
  order: number;
119
- bbcSheetId: mongoose.Types.ObjectId;
120
119
  value: number;
120
+ bbcSheetId: mongoose.Types.ObjectId;
121
121
  skuDate: Date;
122
122
  category: string;
123
123
  sku: string;
@@ -40,7 +40,7 @@ export interface ILoanStatementTransaction {
40
40
  isSystem: boolean;
41
41
  memo: string;
42
42
  settlementCode?: string;
43
- userId?: mongoose.Types.ObjectId;
43
+ userId?: string;
44
44
  isEditable?: boolean;
45
45
  }
46
46
  export interface ILoanStatementTransactionWithId extends ILoanStatementTransaction {
@@ -59,46 +59,46 @@ export declare const LoanStatementSchema: mongoose.Schema<any, mongoose.Model<an
59
59
  updatedAt: NativeDate;
60
60
  } & {
61
61
  date: Date;
62
- order: number;
63
62
  amount: number;
63
+ order: number;
64
64
  chargeId: mongoose.Types.ObjectId;
65
65
  isSystem: boolean;
66
+ balance?: number;
67
+ userId?: string;
66
68
  __v?: number;
67
69
  memo?: string;
68
70
  settlementCode?: string;
69
71
  amountPaid?: number;
70
- balance?: number;
71
- userId?: mongoose.Types.ObjectId;
72
72
  }, mongoose.Document<unknown, {}, mongoose.FlatRecord<{
73
73
  createdAt: NativeDate;
74
74
  updatedAt: NativeDate;
75
75
  } & {
76
76
  date: Date;
77
- order: number;
78
77
  amount: number;
78
+ order: number;
79
79
  chargeId: mongoose.Types.ObjectId;
80
80
  isSystem: boolean;
81
+ balance?: number;
82
+ userId?: string;
81
83
  __v?: number;
82
84
  memo?: string;
83
85
  settlementCode?: string;
84
86
  amountPaid?: number;
85
- balance?: number;
86
- userId?: mongoose.Types.ObjectId;
87
87
  }>> & mongoose.FlatRecord<{
88
88
  createdAt: NativeDate;
89
89
  updatedAt: NativeDate;
90
90
  } & {
91
91
  date: Date;
92
- order: number;
93
92
  amount: number;
93
+ order: number;
94
94
  chargeId: mongoose.Types.ObjectId;
95
95
  isSystem: boolean;
96
+ balance?: number;
97
+ userId?: string;
96
98
  __v?: number;
97
99
  memo?: string;
98
100
  settlementCode?: string;
99
101
  amountPaid?: number;
100
- balance?: number;
101
- userId?: mongoose.Types.ObjectId;
102
102
  }> & {
103
103
  _id: mongoose.Types.ObjectId;
104
104
  }>;
@@ -55,8 +55,7 @@ exports.LoanStatementSchema = new mongoose_1.default.Schema({
55
55
  type: String,
56
56
  },
57
57
  userId: {
58
- type: mongoose_1.default.Schema.Types.ObjectId,
59
- ref: _models_1.MODEL_NAMES.users,
58
+ type: String,
60
59
  required: false,
61
60
  },
62
61
  __v: { type: Number, select: false },
@@ -31,7 +31,7 @@ export interface ILoanStatementTransaction {
31
31
  isSystem: boolean;
32
32
  memo: string;
33
33
  settlementCode?: string;
34
- userId?: mongoose.Types.ObjectId;
34
+ userId?: string;
35
35
  isEditable?: boolean;
36
36
  }
37
37
 
@@ -87,8 +87,7 @@ export const LoanStatementSchema = new mongoose.Schema(
87
87
  type: String,
88
88
  },
89
89
  userId: {
90
- type: mongoose.Schema.Types.ObjectId,
91
- ref: MODEL_NAMES.users,
90
+ type: String,
92
91
  required: false,
93
92
  },
94
93
  __v: { type: Number, select: false },
@@ -56,7 +56,7 @@ export interface ILoanTransaction {
56
56
  balance: number;
57
57
  floatedBalance: number;
58
58
  loanPaymentId?: mongoose.Types.ObjectId;
59
- userId?: mongoose.Types.ObjectId;
59
+ userId?: string;
60
60
  isSent?: boolean;
61
61
  }
62
62
  export interface ILoanTransactionDocWithProduct extends ILoanTransactionDoc {
@@ -41,8 +41,7 @@ exports.LOAN_TRANSACTION_FIELDS = [
41
41
  ];
42
42
  exports.LoanTransactionSchema = new mongoose_1.default.Schema({
43
43
  userId: {
44
- type: mongoose_1.default.Schema.Types.ObjectId,
45
- ref: _models_1.MODEL_NAMES.users,
44
+ type: String,
46
45
  required: false,
47
46
  },
48
47
  order: {
@@ -64,7 +64,7 @@ export interface ILoanTransaction {
64
64
  balance: number;
65
65
  floatedBalance: number;
66
66
  loanPaymentId?: mongoose.Types.ObjectId;
67
- userId?: mongoose.Types.ObjectId;
67
+ userId?: string;
68
68
  isSent?: boolean;
69
69
  }
70
70
 
@@ -99,8 +99,7 @@ export interface ITransactionsFilter {
99
99
  export const LoanTransactionSchema = new mongoose.Schema<ILoanTransactionDoc, ILoanTransactionModel>(
100
100
  {
101
101
  userId: {
102
- type: mongoose.Schema.Types.ObjectId,
103
- ref: MODEL_NAMES.users,
102
+ type: String,
104
103
  required: false,
105
104
  },
106
105
  order: {