import { DomainError } from "@repo/rdx-ddd";

export class EntityNotFoundError extends DomainError {
  constructor(entity: string, field: string, value: any, options?: ErrorOptions) {
    super(`Entity '${entity}' with ${field} '${value}' was not found.`, options);
    this.name = "EntityNotFoundError";
  }
}

export const isEntityNotFoundError = (e: unknown): e is EntityNotFoundError =>
  e instanceof EntityNotFoundError;
