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:
19
dist/modules/findings/application/queries/FindingStatsQuery.js
vendored
Normal file
19
dist/modules/findings/application/queries/FindingStatsQuery.js
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.FindingStatsQuery = void 0;
|
||||
const Result_1 = require("../../../../shared/domain/Result");
|
||||
class FindingStatsQuery {
|
||||
constructor(repository) {
|
||||
this.repository = repository;
|
||||
}
|
||||
async execute(request) {
|
||||
const [total, bySeverity, openCount, resolvedCount] = await Promise.all([
|
||||
this.repository.count(request.sessionId ? { sessionId: request.sessionId } : undefined),
|
||||
this.repository.countBySeverity(),
|
||||
this.repository.count({ status: 'open', sessionId: request.sessionId }),
|
||||
this.repository.count({ status: 'resolved', sessionId: request.sessionId }),
|
||||
]);
|
||||
return (0, Result_1.Ok)({ total, bySeverity, openCount, resolvedCount });
|
||||
}
|
||||
}
|
||||
exports.FindingStatsQuery = FindingStatsQuery;
|
||||
Reference in New Issue
Block a user