Files
Autonomous-Bug-Explorer/dist/modules/licensing/domain/value-objects/LicensePlan.js

24 lines
879 B
JavaScript

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.LicensePlan = void 0;
class LicensePlan {
constructor(value) {
this.value = value;
}
static free() { return new LicensePlan('free'); }
static pro() { return new LicensePlan('pro'); }
static enterprise() { return new LicensePlan('enterprise'); }
static fromString(value) {
if (value === 'free' || value === 'pro' || value === 'enterprise') {
return new LicensePlan(value);
}
throw new Error(`Invalid license plan: ${value}`);
}
get isFree() { return this.value === 'free'; }
get isPro() { return this.value === 'pro'; }
get isEnterprise() { return this.value === 'enterprise'; }
toString() { return this.value; }
equals(other) { return this.value === other.value; }
}
exports.LicensePlan = LicensePlan;