import type { NotificationResponse } from '@/lib/api/notifications';

const now = new Date();
const dayMs = 86400000;

function hoursAgo(hours: number): string {
  return new Date(now.getTime() - hours * 3600000).toISOString();
}

function daysAgo(days: number): string {
  return new Date(now.getTime() - days * dayMs).toISOString();
}

export const demoNotifications: NotificationResponse[] = [
  {
    id: 1,
    title: 'Task Overdue',
    body: 'Replace HVAC filter is 5 days overdue.',
    notification_type: 'task_reminder',
    is_read: false,
    data: { task_id: 1 },
    created_at: hoursAgo(2),
  },
  {
    id: 2,
    title: 'Task Overdue',
    body: 'Fix leaking faucet is 2 days overdue.',
    notification_type: 'task_reminder',
    is_read: false,
    data: { task_id: 2 },
    created_at: hoursAgo(5),
  },
  {
    id: 3,
    title: 'Task Due Today',
    body: 'Test smoke detectors is due today.',
    notification_type: 'task_reminder',
    is_read: false,
    data: { task_id: 3 },
    created_at: hoursAgo(8),
  },
  {
    id: 4,
    title: 'Task Completed',
    body: 'Replace kitchen faucet was marked as complete.',
    notification_type: 'task_completion',
    is_read: false,
    data: { task_id: 13, completion_id: 1 },
    created_at: daysAgo(3),
  },
  {
    id: 5,
    title: 'Warranty Expiring',
    body: 'Dishwasher Warranty expired 30 days ago.',
    notification_type: 'warranty_expiry',
    is_read: true,
    data: { document_id: 3 },
    created_at: daysAgo(5),
  },
  {
    id: 6,
    title: 'Task Completed',
    body: 'Deep clean bathroom was marked as complete.',
    notification_type: 'task_completion',
    is_read: true,
    data: { task_id: 14, completion_id: 2 },
    created_at: daysAgo(1),
  },
  {
    id: 7,
    title: 'Task Due Soon',
    body: 'Mow the lawn is due in 3 days.',
    notification_type: 'task_reminder',
    is_read: true,
    data: { task_id: 5 },
    created_at: daysAgo(1),
  },
  {
    id: 8,
    title: 'Warranty Expiring Soon',
    body: 'Window AC Warranty expires in 90 days.',
    notification_type: 'warranty_expiry',
    is_read: true,
    data: { document_id: 4 },
    created_at: daysAgo(7),
  },
  {
    id: 9,
    title: 'Welcome to honeyDue!',
    body: 'Start by adding your first residence to track home maintenance.',
    notification_type: 'system',
    is_read: true,
    created_at: daysAgo(30),
  },
  {
    id: 10,
    title: 'Task Completed',
    body: 'Trim hedges was marked as complete.',
    notification_type: 'task_completion',
    is_read: true,
    data: { task_id: 15, completion_id: 3 },
    created_at: daysAgo(2),
  },
];
