export type CdcIssueMatrixStatus =
  | "Solved"
  | "In Progress"
  | "Not Addressed"
  | "Draft"
  | "Saved"
  | "New Submission";

export const CDC_ISSUE_MATRIX_STATUS_FILTER_OPTIONS = [
  "Solved",
  "In Progress",
  "Not Addressed",
  "Draft",
  "Saved",
  "New Submission",
] as const satisfies readonly CdcIssueMatrixStatus[];


/** One ministry assigned to an issue. The first entry is the primary one. */
export type CdcIssueMatrixAgency = {
  id: number;
  name: string;
  logo: string | null;
};

export type CdcIssueMatrixRow = {
  id: number;
  issueId: number;
  issueResolveId: number | null;
  meetingSummaryId: number | null;
  // OWN: raised by this role itself. MINISTRY: escalated by a ministry.
  source?: "OWN" | "MINISTRY";
  workingGroupId: number;
  workingGroup: string;
  issue: string;
  category: string;
  issueDescription: string;
  recommendation: string;
  governmentDecision: string;
  primaryAgency: string;
  primaryAgencyImage: string | null;
  // Every ministry on the issue, ordered, so the picker can prefill.
  agencies: CdcIssueMatrixAgency[];
  plenaryEscalation: boolean;
  status: CdcIssueMatrixStatus;
  statusId: number;
  nextStep: string;
  remark?: string;
  submittedAt: string;
  year: string;
  action?: string;
};

export type CdcIssueMatrixSummary = {
  totalIssues: number;
  solved: number;
  inProgress: number;
  notAddressed: number;
  totalPrimaryAgencies: number;
};
