// src/data/errors/domain-errors.ts
var DomainError = class extends Error {
  constructor(message, code, options) {
    super(message, options);
    this.name = this.constructor.name;
    this.code = code;
    this.details = options?.details;
    Object.setPrototypeOf(this, new.target.prototype);
  }
};
var NotFoundError = class extends DomainError {
  constructor(message, options) {
    super(message, "NOT_FOUND", options);
  }
};
var ValidationError = class extends DomainError {
  constructor(message, options) {
    super(message, "VALIDATION", options);
  }
};
var ConflictError = class extends DomainError {
  constructor(message, options) {
    super(message, "CONFLICT", options);
  }
};
var ForbiddenError = class extends DomainError {
  constructor(message, options) {
    super(message, "FORBIDDEN", options);
  }
};
function domainErrorToHttpStatus(err) {
  if (err instanceof NotFoundError) return 404;
  if (err instanceof ValidationError) return 400;
  if (err instanceof ConflictError) return 409;
  if (err instanceof ForbiddenError) return 403;
  return null;
}

export {
  DomainError,
  NotFoundError,
  ValidationError,
  ConflictError,
  ForbiddenError,
  domainErrorToHttpStatus
};
//# sourceMappingURL=chunk-FYHBHHWK.mjs.map