export type DisputeStatusCode =
  | 'N'
  | 'P'
  | 'R'
  | 'D'
  | 'Q'
  | 'S'
  | 'X'
  | null
  | undefined;

export const DISPUTE_STATUS_MAP = {
  N: { label: 'Negative', color: 'error' },
  P: { label: 'Positive', color: 'default' },
  R: { label: 'Repaired', color: 'info' },
  D: { label: 'Deleted', color: 'success' },
  Q: { label: 'Partial Repair', color: 'warning' },
  S: { label: 'Re-Inserted', color: 'secondary' },
  X: { label: 'Do Not Process', color: 'error' },
} as const;

export function getDisputeStatus(code: DisputeStatusCode) {
  return DISPUTE_STATUS_MAP[code as keyof typeof DISPUTE_STATUS_MAP] ?? {
    label: 'Not Reported',
    color: 'default',
  };
}
