import type { DtoSerializable, Identifiable, } from './types.js'; export abstract class BaseEntity implements Identifiable, DtoSerializable { public readonly id: string; protected constructor(params: Identifiable) { this.id = params.id; } public equals>(entity: T): boolean { return Object.getPrototypeOf(this)!.constructor === Object.getPrototypeOf(entity)!.constructor && this.id === entity.id; } public abstract toDto(): Dto; }