/**
 * Typed mock of the Sentinel data contract — ported verbatim from the design
 * handoff (docs/design_handoff_uptime_sentinel/lib/mock-data.js). Used by
 * useSentinelData() until the real `/api/reports/executive` polling is wired
 * in. Shape MUST stay identical to the live API response.
 */
import type { SentinelData } from './types';

export const MOCK_SENTINEL_DATA: SentinelData = {
    overview: {
        totalMonitors: 142,
        activeMonitors: 138,
        overallUptime: 99.94,
        uptimeTrend: 0.12,
        activeIncidents: 2,
        incidentsTrend: -33.3,
        avgResponseTime: 214,
        responseTrend: -8.4,
    },
    monthlyTrends: [
        { month: 'Jun 25', uptime: 99.91, incidents: 4, responseTime: 220 },
        { month: 'Jul 25', uptime: 99.88, incidents: 5, responseTime: 231 },
        { month: 'Aug 25', uptime: 99.93, incidents: 3, responseTime: 226 },
        { month: 'Sep 25', uptime: 99.86, incidents: 6, responseTime: 240 },
        { month: 'Oct 25', uptime: 99.9, incidents: 4, responseTime: 233 },
        { month: 'Nov 25', uptime: 99.95, incidents: 2, responseTime: 222 },
        { month: 'Dec 25', uptime: 99.97, incidents: 1, responseTime: 209 },
        { month: 'Jan 26', uptime: 99.92, incidents: 3, responseTime: 218 },
        { month: 'Feb 26', uptime: 99.89, incidents: 5, responseTime: 229 },
        { month: 'Mar 26', uptime: 99.94, incidents: 3, responseTime: 216 },
        { month: 'Apr 26', uptime: 99.96, incidents: 2, responseTime: 211 },
        { month: 'May 26', uptime: 99.94, incidents: 2, responseTime: 214 },
    ],
    topIssues: [
        { id: 'mon-204', name: 'Kenya Payments API', type: 'https', downtime: 45, incidents: 6, lastIncident: '2026-05-28T14:12:00Z' },
        { id: 'mon-118', name: 'IFA Supply Sync (India)', type: 'https', downtime: 32, incidents: 4, lastIncident: '2026-05-27T03:48:00Z' },
        { id: 'mon-061', name: 'Safe Water Dispenser Telemetry', type: 'tcp', downtime: 28, incidents: 4, lastIncident: '2026-05-26T19:30:00Z' },
        { id: 'mon-233', name: '2AI WhatsApp Webhook (NG)', type: 'https', downtime: 19, incidents: 3, lastIncident: '2026-05-25T09:05:00Z' },
        { id: 'mon-090', name: 'Deworm M&E Upload', type: 'https', downtime: 12, incidents: 2, lastIncident: '2026-05-22T22:41:00Z' },
        { id: 'mon-147', name: 'Global SSO / Identity', type: 'https', downtime: 6, incidents: 1, lastIncident: '2026-05-19T11:20:00Z' },
    ],
    countryBreakdown: [
        { country: 'Kenya', code: 'KE', monitors: 38, uptime: 99.8, incidents: 3 },
        { country: 'United States', code: 'US', monitors: 27, uptime: 99.99, incidents: 0 },
        { country: 'India', code: 'IN', monitors: 24, uptime: 99.91, incidents: 2 },
        { country: 'Nigeria', code: 'NG', monitors: 18, uptime: 99.87, incidents: 1 },
        { country: 'United Kingdom', code: 'UK', monitors: 11, uptime: 99.98, incidents: 0 },
        { country: 'South Africa', code: 'ZA', monitors: 9, uptime: 99.72, incidents: 1 },
        { country: 'Global / CDN', code: 'Global', monitors: 15, uptime: 99.97, incidents: 0 },
    ],
    insights: [
        { type: 'success', title: 'Best uptime in 6 months', description: 'April closed at 99.96% — the strongest month since the Q3 migration.', metric: '99.96%' },
        { type: 'warning', title: 'Kenya Payments API degrading', description: 'p95 latency on the payments endpoint has climbed for three straight days.', metric: '+18%' },
        { type: 'critical', title: 'South Africa below SLA', description: 'ZA region at 99.72% this month, under the 99.9% target after a peering outage.', metric: '99.72%' },
        { type: 'info', title: 'Response time trending down', description: 'Average response improved 8.4% month-over-month across all regions.', metric: '214 ms' },
    ],
    responsePercentiles: { p50: 180, p95: 540, p99: 1180 },
    recentAlerts: [
        { monitorName: 'Kenya Payments API', status: 'down', timestamp: '2026-05-29T08:42:11Z', responseTime: 0 },
        { monitorName: 'South Africa Edge (ZA)', status: 'down', timestamp: '2026-05-29T07:15:54Z', responseTime: 0 },
        { monitorName: 'IFA Supply Sync (India)', status: 'up', timestamp: '2026-05-29T06:03:20Z', responseTime: 268 },
        { monitorName: '2AI WhatsApp Webhook (NG)', status: 'up', timestamp: '2026-05-29T05:48:02Z', responseTime: 231 },
        { monitorName: 'Safe Water Telemetry', status: 'down', timestamp: '2026-05-29T04:30:47Z', responseTime: 0 },
        { monitorName: 'Deworm M&E Upload', status: 'up', timestamp: '2026-05-29T03:12:09Z', responseTime: 198 },
    ],
    monitors: [
        { id: 'm-204', name: 'Kenya Payments API', type: 'https', status: 'down', responseTime: 0, url: 'api.pay.ke.evidenceaction.org', region: 'KE' },
        { id: 'm-061', name: 'Nairobi Dispenser Gateway', type: 'tcp', status: 'up', responseTime: 142, url: 'gw.dispenser.ke.internal:8443', region: 'KE' },
        { id: 'm-072', name: 'M-Pesa Webhook Receiver', type: 'https', status: 'up', responseTime: 210, url: 'hooks.ke.evidenceaction.org/mpesa', region: 'KE' },
        { id: 'm-090', name: 'Kenya M&E Sync', type: 'https', status: 'up', responseTime: 305, url: 'me-sync.ke.evidenceaction.org', region: 'KE' },
        { id: 'm-301', name: 'US Identity SSO', type: 'https', status: 'up', responseTime: 88, url: 'sso.evidenceaction.org', region: 'US' },
        { id: 'm-302', name: 'US Data Warehouse', type: 'https', status: 'up', responseTime: 120, url: 'warehouse.us.evidenceaction.org', region: 'US' },
        { id: 'm-303', name: 'US Mail Relay', type: 'tcp', status: 'up', responseTime: 64, url: 'smtp.us.evidenceaction.org:587', region: 'US' },
        { id: 'm-401', name: 'UK Donor Portal', type: 'https', status: 'up', responseTime: 95, url: 'give.uk.evidenceaction.org', region: 'UK' },
        { id: 'm-402', name: 'UK Analytics Edge', type: 'https', status: 'up', responseTime: 110, url: 'analytics.uk.evidenceaction.org', region: 'UK' },
        { id: 'm-118', name: 'IFA Supply Sync', type: 'https', status: 'up', responseTime: 268, url: 'ifa-supply.in.evidenceaction.org', region: 'IN' },
        { id: 'm-119', name: 'India Survey API', type: 'https', status: 'unknown', responseTime: 0, url: 'survey.in.evidenceaction.org', region: 'IN' },
        { id: 'm-120', name: 'Delhi SMS Gateway', type: 'tcp', status: 'up', responseTime: 180, url: 'sms.in.evidenceaction.org:2775', region: 'IN' },
        { id: 'm-233', name: '2AI WhatsApp Webhook', type: 'https', status: 'up', responseTime: 231, url: 'wa.ng.evidenceaction.org/2ai', region: 'NG' },
        { id: 'm-234', name: 'Lagos Field App API', type: 'https', status: 'up', responseTime: 260, url: 'field.ng.evidenceaction.org', region: 'NG' },
        { id: 'm-235', name: 'Nigeria SMS Relay', type: 'tcp', status: 'down', responseTime: 0, url: 'sms.ng.evidenceaction.org:2775', region: 'NG' },
        { id: 'm-501', name: 'South Africa Edge', type: 'https', status: 'down', responseTime: 0, url: 'edge.za.evidenceaction.org', region: 'ZA' },
        { id: 'm-502', name: 'Cape Town CDN Node', type: 'ping', status: 'up', responseTime: 70, url: 'cdn-cpt.evidenceaction.org', region: 'ZA' },
        { id: 'm-147', name: 'Global SSO / Identity', type: 'https', status: 'up', responseTime: 96, url: 'id.evidenceaction.org', region: 'Global' },
        { id: 'm-148', name: 'Global CDN Health', type: 'ping', status: 'up', responseTime: 38, url: 'cdn.evidenceaction.org', region: 'Global' },
        { id: 'm-149', name: 'Public Status Page', type: 'https', status: 'up', responseTime: 52, url: 'status.evidenceaction.org', region: 'Global' },
        { id: 'm-150', name: 'Global DNS Resolver', type: 'tcp', status: 'up', responseTime: 44, url: 'ns1.evidenceaction.org:53', region: 'Global' },
    ],
    lastUpdated: '2026-05-29T08:45:00Z',
};
