Files
rate/api/src/entities/entity.ts
2022-10-11 12:18:12 +02:00

15 lines
366 B
TypeScript

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();
}
}