gemcap-be-common 1.5.156 → 1.5.158

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gemcap-be-common",
3
- "version": "1.5.156",
3
+ "version": "1.5.158",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -58,7 +58,7 @@ export declare class ComplianceBorrowersService {
58
58
  isComplianceBorrowerAllowed(userAccess: IUserAccess, requestedBorrowerId: string): boolean;
59
59
  calculateInstanceStatuses(instance: IBorrowerItemInstance, item: IBorrowerItemLean): IInstanceStatus;
60
60
  getFullComplianceBorrowerById(complianceBorrowerId: string): Promise<IComplianceBorrowerDocumentFullWithStatuses>;
61
- getAllBorrowersShortened(userAccess: IUserAccess): Promise<Pick<IComplianceBorrowerWithBorrower, "items" | "borrower" | "fundingStatus">[]>;
61
+ getAllBorrowersShortened(userAccess: IUserAccess): Promise<Pick<IComplianceBorrowerWithBorrower, "borrower" | "items" | "fundingStatus">[]>;
62
62
  generateInstances(complianceBorrowerId: any): Promise<IComplianceBorrowerDocumentFullWithStatuses>;
63
63
  calculateAndUpdateFundingStatus(complianceBorrowerId: string): Promise<void>;
64
64
  calculateFundingStatus(complianceBorrower: IComplianceBorrowerDocumentFull): string;
@@ -5,7 +5,7 @@ import { BorrowersDB } from './borrowers.db';
5
5
  import { LoanChargesService } from './loan-charges.service';
6
6
  export interface IUserLogFilter {
7
7
  userId: string;
8
- borrowerId: string;
8
+ borrowerId?: string;
9
9
  periodStart: Date;
10
10
  periodEnd: Date;
11
11
  }
@@ -121,7 +121,7 @@ class UserLogsService {
121
121
  $and: [
122
122
  { 'timestamp': { $gte: filter.periodStart } },
123
123
  { 'timestamp': { $lte: filter.periodEnd } },
124
- filter.userId ? { 'userId': new mongoose_1.default.Types.ObjectId(filter.userId) } : {},
124
+ filter.userId ? { 'userId': filter.userId } : {},
125
125
  ],
126
126
  },
127
127
  },
@@ -132,9 +132,9 @@ class UserLogsService {
132
132
  },
133
133
  ]);
134
134
  const logsWithRecord = await Promise.all(logs.map(async (log) => await this.performDynamicLookup(log)));
135
- const filteredByBorrowers = !filter.borrowerId
136
- ? logsWithRecord.slice()
137
- : await this.filterByBorrower(logsWithRecord, filter.borrowerId);
135
+ const filteredByBorrowers = filter.borrowerId
136
+ ? await this.filterByBorrower(logsWithRecord, filter.borrowerId)
137
+ : logsWithRecord.slice();
138
138
  await this.replaceBorrowers(filteredByBorrowers);
139
139
  return filteredByBorrowers;
140
140
  }
@@ -10,7 +10,7 @@ import { LoanChargesService } from './loan-charges.service';
10
10
 
11
11
  export interface IUserLogFilter {
12
12
  userId: string;
13
- borrowerId: string;
13
+ borrowerId?: string;
14
14
  periodStart: Date;
15
15
  periodEnd: Date;
16
16
  }
@@ -138,7 +138,7 @@ export class UserLogsService {
138
138
  $and: [
139
139
  { 'timestamp': { $gte: filter.periodStart } },
140
140
  { 'timestamp': { $lte: filter.periodEnd } },
141
- filter.userId ? { 'userId': new mongoose.Types.ObjectId(filter.userId) } : {},
141
+ filter.userId ? { 'userId': filter.userId } : {},
142
142
  ],
143
143
  },
144
144
  },
@@ -149,9 +149,9 @@ export class UserLogsService {
149
149
  },
150
150
  ]);
151
151
  const logsWithRecord = await Promise.all(logs.map(async (log) => await this.performDynamicLookup(log)));
152
- const filteredByBorrowers = !filter.borrowerId
153
- ? logsWithRecord.slice()
154
- : await this.filterByBorrower(logsWithRecord, filter.borrowerId);
152
+ const filteredByBorrowers = filter.borrowerId
153
+ ? await this.filterByBorrower(logsWithRecord, filter.borrowerId)
154
+ : logsWithRecord.slice();
155
155
  await this.replaceBorrowers(filteredByBorrowers);
156
156
  return filteredByBorrowers;
157
157
  }