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

export class InvalidProformaTransitionError extends DomainError {
  constructor(current: string, next: string, id: string) {
    super(`Invalid transition for proforma ${id}: ${current} → ${next}`);
    this.name = "InvalidProformaTransitionError";
  }
}

export const isInvalidProformaTransitionError = (e: unknown): e is InvalidProformaTransitionError =>
  e instanceof InvalidProformaTransitionError;
