export const ERROR_CODES = {
  API_ERROR: "API_ERROR",
  DATABASE_ERROR: "DATABASE_ERROR",
  NETWORK_ERROR: "NETWORK_ERROR",
  AUTH_ERROR: "AUTH_ERROR",
  PERMISSION_ERROR: "PERMISSION_ERROR",
  VALIDATION_ERROR: "VALIDATION_ERROR",
  UNKNOWN_ERROR: "UNKNOWN_ERROR",
  NOT_FOUND_ERROR: "NOT_FOUND_ERROR",
  INPUT_ERROR: "INPUT_ERROR",
  INTERNAL_SERVER_ERROR: "INTERNAL_SERVER_ERROR",
  EXTERNAL_SERVICE_ERROR: "EXTERNAL_SERVICE_ERROR",
} as const;

export type Err = {
  code: string;
  message: string;
  userHint: string;
  detail: string;
  actionable?: boolean;
  error?: any;
};

export type Result<T> = { data?: T; error?: Err };
