import UUIDGenerator from '../services/UUIDGenerator'; export default abstract class BaseEntity { protected _id: string; constructor() { this.regen(); } get id(): string { return this._id; } set id(value: string) { this._id = value; } isEqual(as: BaseEntity): boolean { return this.id === as.id; } hasValue(field) { return field !== undefined && field !== null && field !== ''; } regen() { this._id = UUIDGenerator.generate(); } }