Files

19 lines
845 B
JavaScript

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ReportStatus = void 0;
const ValueObject_1 = require("../../../../shared/domain/ValueObject");
class ReportStatus extends ValueObject_1.ValueObject {
get value() { return this.props.value; }
static pending() { return new ReportStatus({ value: 'pending' }); }
static generating() { return new ReportStatus({ value: 'generating' }); }
static ready() { return new ReportStatus({ value: 'ready' }); }
static failed() { return new ReportStatus({ value: 'failed' }); }
static fromString(s) {
if (s === 'pending' || s === 'generating' || s === 'ready' || s === 'failed') {
return new ReportStatus({ value: s });
}
throw new Error(`Invalid report status: ${s}`);
}
}
exports.ReportStatus = ReportStatus;