gemcap-be-common 1.4.239 → 1.4.240

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.4.239",
3
+ "version": "1.4.240",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -92,7 +92,7 @@ export class ComplianceBorrowersService {
92
92
  // populate: { path: 'instances.files.uploadedBy', model: MODEL_NAMES.users },
93
93
  // }) // TODO remove this when we have a better way to handle users
94
94
  .transform((borrower) => ({ ...borrower, plaidAccessToken: borrower?.plaidAccessToken ?? false }))
95
- .lean() as IComplianceBorrowerDocumentFull;
95
+ .lean<IComplianceBorrowerDocumentFull>();
96
96
  if (!ourBorrower.borrower) {
97
97
  return Promise.resolve({ ...ourBorrower });
98
98
  }
@@ -132,7 +132,7 @@ export class ComplianceBorrowersService {
132
132
  async getAllBorrowersShortened(userAccess: IUserAccess) {
133
133
  type BorrowerComplianceShort = Pick<IComplianceBorrowerWithBorrower, 'borrower' | 'fundingStatus' | 'items'>;
134
134
 
135
- const allComplianceBorrower: BorrowerComplianceShort[] = await BorrowerCompliance
135
+ const allComplianceBorrower = await BorrowerCompliance
136
136
  .find(userAccess.allBorrowers ? { isVisible: true } : {
137
137
  'borrower': { $in: userAccess.borrowersAccess },
138
138
  isVisible: true,
@@ -143,7 +143,7 @@ export class ComplianceBorrowersService {
143
143
  populate: { path: 'item', model: 'complianceItems' },
144
144
  })
145
145
  .collation({ locale: 'en' })
146
- .lean();
146
+ .lean<BorrowerComplianceShort[]>();
147
147
  const borrowers = await Promise.all(allComplianceBorrower.map(async (borrower) => {
148
148
  if (!borrower.borrower) {
149
149
  return borrower;