export abstract class BaseEntity<TId = string> {
  constructor(
    public readonly id: TId,
    public readonly createdAt: Date = new Date(),
    public updatedAt: Date = new Date(),
  ) {}

  equals(other: BaseEntity<TId>): boolean {
    if (other === null || other === undefined) return false;
    if (this === other) return true;
    return this.id === other.id;
  }
}
