import { EntityCtor, EntityInfo } from '@core'; import { randomUUID } from 'crypto'; export class Entity implements EntityInfo { uuid: string; createdAt: Date; updatedAt: Date; constructor(raw: EntityCtor) { this.uuid = raw.uuid || randomUUID(); this.createdAt = raw.createdAt || new Date(); this.updatedAt = raw.updatedAt || new Date(); } }