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/domain/value-objects/Severity.js
vendored
Normal file
19
dist/modules/findings/domain/value-objects/Severity.js
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.Severity = void 0;
|
||||
const ValueObject_1 = require("../../../../shared/domain/ValueObject");
|
||||
class Severity extends ValueObject_1.ValueObject {
|
||||
static low() { return new Severity({ value: 'low' }); }
|
||||
static medium() { return new Severity({ value: 'medium' }); }
|
||||
static high() { return new Severity({ value: 'high' }); }
|
||||
static critical() { return new Severity({ value: 'critical' }); }
|
||||
static fromString(s) {
|
||||
if (!Severity.LEVELS.includes(s)) {
|
||||
throw new Error(`Invalid severity: ${s}`);
|
||||
}
|
||||
return new Severity({ value: s });
|
||||
}
|
||||
get value() { return this.props.value; }
|
||||
}
|
||||
exports.Severity = Severity;
|
||||
Severity.LEVELS = ['low', 'medium', 'high', 'critical'];
|
||||
Reference in New Issue
Block a user