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:
21
dist/modules/findings/domain/value-objects/FindingStatus.js
vendored
Normal file
21
dist/modules/findings/domain/value-objects/FindingStatus.js
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.FindingStatus = void 0;
|
||||
const ValueObject_1 = require("../../../../shared/domain/ValueObject");
|
||||
class FindingStatus extends ValueObject_1.ValueObject {
|
||||
static open() { return new FindingStatus({ value: 'open' }); }
|
||||
static investigating() { return new FindingStatus({ value: 'investigating' }); }
|
||||
static resolved() { return new FindingStatus({ value: 'resolved' }); }
|
||||
static closed() { return new FindingStatus({ value: 'closed' }); }
|
||||
static fromString(s) {
|
||||
if (!FindingStatus.VALUES.includes(s)) {
|
||||
throw new Error(`Invalid finding status: ${s}`);
|
||||
}
|
||||
return new FindingStatus({ value: s });
|
||||
}
|
||||
get value() { return this.props.value; }
|
||||
isOpen() { return this.props.value === 'open'; }
|
||||
isResolved() { return this.props.value === 'resolved'; }
|
||||
}
|
||||
exports.FindingStatus = FindingStatus;
|
||||
FindingStatus.VALUES = ['open', 'investigating', 'resolved', 'closed'];
|
||||
Reference in New Issue
Block a user