fase(15): reporting module with pdf generation
This commit is contained in:
14
dist/modules/reporting/domain/value-objects/DateRange.js
vendored
Normal file
14
dist/modules/reporting/domain/value-objects/DateRange.js
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.DateRange = void 0;
|
||||
const ValueObject_1 = require("../../../../shared/domain/ValueObject");
|
||||
class DateRange extends ValueObject_1.ValueObject {
|
||||
get startDate() { return this.props.startDate; }
|
||||
get endDate() { return this.props.endDate; }
|
||||
static create(startDate, endDate) {
|
||||
if (startDate > endDate)
|
||||
throw new Error('startDate must be before endDate');
|
||||
return new DateRange({ startDate, endDate });
|
||||
}
|
||||
}
|
||||
exports.DateRange = DateRange;
|
||||
Reference in New Issue
Block a user