// Mock data for the Council Meetings module
// All names/sections inspired by Maldivian local councils (English + Dhivehi-ready)

const SECTIONS = [
  "Office of the President",
  "Finance & Procurement",
  "Public Works",
  "Social Services",
  "Health & Sanitation",
  "Education & Youth",
  "Land & Environment",
  "Legal Affairs",
];

const PARTICIPANTS = [
  { id: "p1",  name: "Ibrahim Naseer",       section: "Office of the President", role: "President",     initials: "IN" },
  { id: "p2",  name: "Aishath Shifa",        section: "Office of the President", role: "Vice President",initials: "AS" },
  { id: "p3",  name: "Mohamed Waheed",       section: "Finance & Procurement",   role: "Councillor",    initials: "MW" },
  { id: "p4",  name: "Fathimath Reesha",     section: "Social Services",         role: "Councillor",    initials: "FR" },
  { id: "p5",  name: "Hassan Ziyad",         section: "Public Works",            role: "Councillor",    initials: "HZ" },
  { id: "p6",  name: "Aminath Leeza",        section: "Health & Sanitation",     role: "Councillor",    initials: "AL" },
  { id: "p7",  name: "Yoosuf Saleem",        section: "Education & Youth",       role: "Councillor",    initials: "YS" },
  { id: "p8",  name: "Mariyam Nazeera",      section: "Land & Environment",      role: "Councillor",    initials: "MN" },
  { id: "p9",  name: "Ahmed Faseeh",         section: "Legal Affairs",           role: "Secretariat",   initials: "AF" },
  { id: "p10", name: "Khadeeja Rasheed",     section: "Office of the President", role: "Secretariat",   initials: "KR" },
  { id: "p11", name: "Ali Mursil",           section: "Public Works",            role: "Councillor",    initials: "AM" },
  { id: "p12", name: "Sheereen Abdulla",     section: "Finance & Procurement",   role: "Councillor",    initials: "SA" },
];

const PAPERS = [
  {
    id: "CP-2026-041",
    title: "Procurement of solar streetlights for Ward 3",
    description: "Approval to award the supply and installation contract for 84 solar streetlights along the harbour road and inner Ward 3 lanes, replacing the failing sodium-vapour fixtures.",
    submittedBy: "p3", section: "Finance & Procurement",
    status: "Submitted",
    submittedAt: "2026-04-28",
    attachments: [
      { name: "Tender_Evaluation_Report.pdf", size: "1.4 MB", type: "pdf" },
      { name: "Cost_Breakdown.xlsx", size: "82 KB", type: "xlsx" },
      { name: "Site_Map_Ward3.png", size: "640 KB", type: "img" },
    ],
    notes: "Three bids received. Lowest compliant bidder is Maaha Energy Pvt Ltd.",
    relatedMeetingId: "M-046",
  },
  {
    id: "CP-2026-042",
    title: "Allocation of land for community sports complex",
    description: "Reservation of plot L-217 (12,400 sq.ft) for the proposed multi-use sports complex requested by the Youth Development Committee.",
    submittedBy: "p8", section: "Land & Environment",
    status: "Added to agenda",
    submittedAt: "2026-04-25",
    attachments: [
      { name: "Plot_L217_Survey.pdf", size: "2.1 MB", type: "pdf" },
      { name: "Youth_Committee_Request.docx", size: "44 KB", type: "doc" },
    ],
    notes: "",
    relatedMeetingId: "M-046",
  },
  {
    id: "CP-2026-043",
    title: "Emergency funding — flood damage to Hithadhoo School",
    description: "Approval of MVR 480,000 from contingency reserves to cover roof and electrical repairs after the 22 April flooding incident.",
    submittedBy: "p7", section: "Education & Youth",
    status: "Resolved",
    submittedAt: "2026-04-23",
    attachments: [
      { name: "Damage_Assessment.pdf", size: "3.2 MB", type: "pdf" },
      { name: "Repair_Quotes.pdf", size: "780 KB", type: "pdf" },
    ],
    notes: "Marked urgent by Office of the President.",
    relatedMeetingId: "M-045",
  },
  {
    id: "CP-2026-044",
    title: "Revision of waste collection schedule",
    description: "Move household waste collection from alternate days to daily collection across Wards 1–4, with a corresponding contractor fee revision.",
    submittedBy: "p6", section: "Health & Sanitation",
    status: "Submitted",
    submittedAt: "2026-04-29",
    attachments: [
      { name: "Service_Comparison.xlsx", size: "120 KB", type: "xlsx" },
    ],
    notes: "",
    relatedMeetingId: null,
  },
  {
    id: "CP-2026-045",
    title: "Appointment of internal audit committee members",
    description: "Confirmation of three members nominated to the council's internal audit committee for the 2026–2028 term.",
    submittedBy: "p9", section: "Legal Affairs",
    status: "Submitted",
    submittedAt: "2026-04-30",
    attachments: [
      { name: "Nominee_CVs.pdf", size: "1.8 MB", type: "pdf" },
    ],
    notes: "",
    relatedMeetingId: null,
  },
  {
    id: "CP-2026-046",
    title: "Repaving of Ameenee Magu — phase 2",
    description: "Phase 2 of the Ameenee Magu repaving project covering the 1.2 km stretch from Chandhanee Magu junction to the southern roundabout.",
    submittedBy: "p5", section: "Public Works",
    status: "Draft",
    submittedAt: "2026-05-02",
    attachments: [],
    notes: "Awaiting cost confirmation from contractor.",
    relatedMeetingId: null,
  },
  {
    id: "CP-2026-040",
    title: "Increase to councillor sitting allowance",
    description: "Proposal to increase the per-meeting sitting allowance from MVR 750 to MVR 1,000, effective 1 June 2026.",
    submittedBy: "p2", section: "Office of the President",
    status: "Resolved",
    submittedAt: "2026-04-15",
    attachments: [
      { name: "Allowance_Comparison.pdf", size: "320 KB", type: "pdf" },
    ],
    notes: "",
    relatedMeetingId: "M-045",
  },
  {
    id: "CP-2026-039",
    title: "Public consultation on harbour expansion",
    description: "Mandate to hold a public consultation forum regarding the proposed northern harbour expansion before formal endorsement.",
    submittedBy: "p4", section: "Social Services",
    status: "Resolved",
    submittedAt: "2026-04-10",
    attachments: [
      { name: "Concept_Drawing.pdf", size: "4.1 MB", type: "pdf" },
    ],
    notes: "",
    relatedMeetingId: "M-044",
  },
];

const MEETINGS = [
  {
    id: "M-046",
    no: "046/2026",
    title: "General Council Meeting — May 2026",
    type: "General",
    date: "2026-05-08T10:00",
    location: "Council Chamber, City Hall",
    status: "Scheduled",
    participantIds: ["p1","p2","p3","p4","p5","p6","p7","p8","p9","p10","p11","p12"],
    notes: "First meeting after the budget revision. President will chair.",
    agenda: [
      { paperId: "CP-2026-041", status: "Pending debate", debateNotes: "", vote: null, resolutionId: null },
      { paperId: "CP-2026-042", status: "Pending debate", debateNotes: "", vote: null, resolutionId: null },
      { paperId: "CP-2026-044", status: "Pending debate", debateNotes: "", vote: null, resolutionId: null },
    ],
    minutes: { generalNotes: "" },
  },
  {
    id: "M-047",
    no: "047/2026",
    title: "Emergency Meeting — Harbour Incident Review",
    type: "Emergency",
    date: "2026-05-12T14:30",
    location: "Council Chamber, City Hall",
    status: "Draft",
    participantIds: ["p1","p2","p3","p5","p9","p10"],
    notes: "Called by President in response to the 5 May harbour incident.",
    agenda: [],
    minutes: { generalNotes: "" },
  },
  {
    id: "M-048",
    no: "048/2026",
    title: "General Council Meeting — February 2026",
    type: "General",
    date: "2026-02-27T10:00",
    location: "Council Chamber, City Hall",
    status: "Completed",
    participantIds: ["p1","p2","p3","p4","p5","p6","p7","p8","p9","p10","p11","p12"],
    notes: "Routine monthly session. All sections represented.",
    agenda: [
      { paperId: "CP-2026-039", status: "Resolved", debateNotes: "Procedural review of the consultation framework. Members reaffirmed scope.", vote: { for: 11, against: 0, abstain: 1 }, resolutionId: "R-089" },
    ],
    minutes: { generalNotes: "Meeting commenced at 10:02. Quorum of 12 confirmed. Closed at 12:48." },
  },
  {
    id: "M-045",
    no: "045/2026",
    title: "General Council Meeting — April 2026",
    type: "General",
    date: "2026-04-24T10:00",
    location: "Council Chamber, City Hall",
    status: "Completed",
    participantIds: ["p1","p2","p3","p4","p5","p6","p7","p8","p9","p10","p11","p12"],
    notes: "",
    agenda: [
      { paperId: "CP-2026-043", status: "Resolved", debateNotes: "Brief debate. Members agreed urgency justified contingency use.", vote: { for: 10, against: 0, abstain: 1 }, resolutionId: "R-088" },
      { paperId: "CP-2026-040", status: "Resolved", debateNotes: "Discussion centred on inflation indexing.", vote: { for: 8, against: 2, abstain: 1 }, resolutionId: "R-087" },
    ],
    minutes: { generalNotes: "Meeting commenced at 10:05. Quorum confirmed by Secretariat." },
  },
  {
    id: "M-044",
    no: "044/2026",
    title: "General Council Meeting — March 2026",
    type: "General",
    date: "2026-03-27T10:00",
    location: "Council Chamber, City Hall",
    status: "Completed",
    participantIds: ["p1","p2","p3","p4","p5","p6","p7","p8","p9","p10","p11"],
    notes: "",
    agenda: [
      { paperId: "CP-2026-039", status: "Resolved", debateNotes: "Lengthy debate on consultation scope.", vote: { for: 9, against: 1, abstain: 1 }, resolutionId: "R-086" },
    ],
    minutes: { generalNotes: "" },
  },
  {
    id: "M-043",
    no: "043/2026",
    title: "Emergency Meeting — Cyclone Preparedness",
    type: "Emergency",
    date: "2026-02-18T16:00",
    location: "Council Chamber, City Hall",
    status: "Cancelled",
    participantIds: ["p1","p2","p3","p9"],
    notes: "Cancelled — weather advisory downgraded.",
    agenda: [],
    minutes: { generalNotes: "" },
  },
];

const RESOLUTIONS = [
  {
    id: "R-089",
    summary: "Reaffirm public consultation framework for major infrastructure proposals.",
    text: "The Council resolves to reaffirm the existing public consultation framework for any major infrastructure proposal exceeding MVR 5 million in capital cost, with the Office of the President to issue refreshed guidance to all sections within 14 days.",
    enforcingParty: "Office of the President",
    paperId: null,
    meetingId: "M-048",
    vote: { for: 11, against: 0, abstain: 1 },
    passedDate: "2026-02-27",
  },
  {
    id: "R-088",
    summary: "Approve MVR 480,000 from contingency reserves for Hithadhoo School flood repairs.",
    text: "The Council resolves to release MVR 480,000 from the 2026 contingency reserves for the immediate repair of the Hithadhoo School roof and electrical systems damaged in the flooding of 22 April 2026. The Finance & Procurement section is to disburse funds within 7 working days of this resolution.",
    enforcingParty: "Finance & Procurement",
    paperId: "CP-2026-043",
    meetingId: "M-045",
    vote: { for: 10, against: 0, abstain: 1 },
    passedDate: "2026-04-24",
  },
  {
    id: "R-087",
    summary: "Increase councillor sitting allowance to MVR 1,000 from 1 June 2026.",
    text: "The Council resolves to revise the per-meeting sitting allowance for councillors from MVR 750 to MVR 1,000, effective 1 June 2026. The Office of the President is to update the relevant standing order.",
    enforcingParty: "Office of the President",
    paperId: "CP-2026-040",
    meetingId: "M-045",
    vote: { for: 8, against: 2, abstain: 1 },
    passedDate: "2026-04-24",
  },
  {
    id: "R-086",
    summary: "Mandate public consultation on northern harbour expansion before endorsement.",
    text: "The Council resolves that no formal endorsement of the northern harbour expansion proposal shall be made before a public consultation forum is held, to be organised by the Social Services section within 30 days.",
    enforcingParty: "Social Services",
    paperId: "CP-2026-039",
    meetingId: "M-044",
    vote: { for: 9, against: 1, abstain: 1 },
    passedDate: "2026-03-27",
  },
  {
    id: "R-085",
    summary: "Approve revised council operating hours from 08:30–14:30 during Ramadan.",
    text: "The Council resolves to revise its public operating hours to 08:30–14:30 throughout the month of Ramadan 1447H, with the Secretariat to publish notice through public channels.",
    enforcingParty: "Office of the President",
    paperId: null,
    meetingId: "M-044",
    vote: { for: 11, against: 0, abstain: 0 },
    passedDate: "2026-03-27",
  },
  {
    id: "R-084",
    summary: "Adopt the 2026 council annual procurement plan.",
    text: "The Council resolves to adopt the Annual Procurement Plan for the 2026 fiscal year as tabled by the Finance & Procurement section, with the addendum of two items requested by Public Works.",
    enforcingParty: "Finance & Procurement",
    paperId: null,
    meetingId: "M-044",
    vote: { for: 10, against: 1, abstain: 0 },
    passedDate: "2026-03-27",
  },
];

// helpers
const getParticipant = (id) => PARTICIPANTS.find((p) => p.id === id);
const getPaper = (id) => PAPERS.find((p) => p.id === id);
const getMeeting = (id) => MEETINGS.find((m) => m.id === id);
const getResolution = (id) => RESOLUTIONS.find((r) => r.id === id);

Object.assign(window, {
  SECTIONS, PARTICIPANTS, PAPERS, MEETINGS, RESOLUTIONS,
  getParticipant, getPaper, getMeeting, getResolution,
});
