import { UniqueEntityID } from '@/core/entities/unique-entity-id'; export class Entity { private _id: UniqueEntityID; protected props: T; protected constructor(props: T, id?: UniqueEntityID) { this.props = props; this._id = id ?? new UniqueEntityID(); } public equals(entity: Entity): boolean { if (entity === this) { return true; } if (entity.id === this._id) { return true; } return false; } get id(): UniqueEntityID { return this._id; } }