fase(5): findings module complete
Some checks failed
ABE Exploratory Testing / explore (push) Has been cancelled
Some checks failed
ABE Exploratory Testing / explore (push) Has been cancelled
This commit is contained in:
22
dist/modules/findings/application/queries/ListFindingsQuery.js
vendored
Normal file
22
dist/modules/findings/application/queries/ListFindingsQuery.js
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.ListFindingsQuery = void 0;
|
||||
const Result_1 = require("../../../../shared/domain/Result");
|
||||
class ListFindingsQuery {
|
||||
constructor(repository) {
|
||||
this.repository = repository;
|
||||
}
|
||||
async execute(request) {
|
||||
const filters = {
|
||||
sessionId: request.sessionId,
|
||||
severity: request.severity,
|
||||
type: request.type,
|
||||
status: request.status,
|
||||
search: request.search,
|
||||
};
|
||||
const findings = await this.repository.findAll(filters);
|
||||
const total = await this.repository.count(filters);
|
||||
return (0, Result_1.Ok)({ findings, total });
|
||||
}
|
||||
}
|
||||
exports.ListFindingsQuery = ListFindingsQuery;
|
||||
Reference in New Issue
Block a user