Skip to content
This repository has been archived by the owner on Feb 29, 2024. It is now read-only.

Commit

Permalink
Merge pull request #330 from kmcwebdev/development
Browse files Browse the repository at this point in the history
Add lexisnexisDownload() method for LegalAndComplianceService and rel…
  • Loading branch information
csulit authored Oct 10, 2023
2 parents 6d63dbe + 18ebd31 commit 170a2aa
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export class LegalAndComplianceController {
@Public()
@Get('test')
test() {
this.legalAndComplianceService.test();
this.legalAndComplianceService.lexisnexisDownload();

return 'OK';
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,12 @@ export class LegalAndComplianceService {
return insertJob;
}

test() {
lexisnexisDownload() {
return this.eventEmitter.emit('lac-lexisnexis-download', {
lexisnexis_search_id: '6cd2673a-b4d0-4d35-855b-9129b2987ba6',
lexisnexis_search_id: '1b50344f-c113-4579-b381-0b8eaef78469',
search_query: 'Oriental game limited',
category: 'negativeNews',
download_id: '8IL5csh0nyKXHbiDhdS98ZF3khrhHI-Z0QYXf4XV8og',
category: 'legal',
download_id: 'T_5iLdc5CJPxHUZoX45lU2Zz4wsj13oa_H-Pz2BO2CU',
});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ export class LacLexisnexisDownloadService implements OnModuleInit {
pdf_report_url: fileHandle.url,
})
.where('lexisnexis_search_id', '=', data.lexisnexis_search_id)
.execute();
.executeTakeFirstOrThrow();

message.ack();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,18 +102,14 @@ export class LacLexisnexisSearchService implements OnModuleInit {
.where('lexisnexis_search_id', '=', data.lexisnexis_search_id)
.executeTakeFirstOrThrow();

if (searchQuery.data.totalSize > 0) {
this.logger.log('Sending to lexisnexis download service');

const downloadPayload: LexisnexisDownloadMetadata = {
lexisnexis_search_id: data.lexisnexis_search_id,
category: data.category,
search_query: data.search_query,
download_id: searchQuery.data.downloadId,
};

this.eventEmitter.emit('lac-lexisnexis-download', downloadPayload);
}
const downloadPayload: LexisnexisDownloadMetadata = {
lexisnexis_search_id: data.lexisnexis_search_id,
category: data.category,
search_query: data.search_query,
download_id: searchQuery.data.downloadId,
};

this.eventEmitter.emit('lac-lexisnexis-download', downloadPayload);

message.ack();
}
Expand Down

0 comments on commit 170a2aa

Please sign in to comment.