import type { DocumentResponse } from '@/lib/api/documents';

const now = new Date().toISOString();

function daysFromNow(days: number): string {
  return new Date(Date.now() + days * 86400000).toISOString().split('T')[0];
}

const creator = { id: 1, username: 'demo_user', first_name: 'Demo', last_name: 'User' };

export const demoDocuments: DocumentResponse[] = [
  // Warranties (4)
  {
    id: 1, residence_id: 1, residence_name: 'Maple Street House',
    title: 'HVAC System Warranty', description: 'Carrier furnace and AC unit 10-year warranty',
    document_type: 'warranty',
    file_url: '', file_name: 'hvac-warranty.pdf', mime_type: 'application/pdf',
    purchase_date: '2022-08-15', expiry_date: daysFromNow(2000),
    purchase_price: 8500, vendor: 'Rivera HVAC Solutions',
    serial_number: 'CR-2022-88441', model_number: 'Carrier 24ACC636',
    is_active: true, images: [],
    created_by: creator, created_at: '2024-01-20T10:00:00Z', updated_at: now,
  },
  {
    id: 2, residence_id: 1, residence_name: 'Maple Street House',
    title: 'Roof Warranty', description: 'Architectural shingle 25-year warranty',
    document_type: 'warranty',
    file_url: '', file_name: 'roof-warranty.pdf', mime_type: 'application/pdf',
    purchase_date: '2020-05-10', expiry_date: daysFromNow(6500),
    purchase_price: 12000, vendor: 'Williams Roofing',
    serial_number: '', model_number: 'GAF Timberline HDZ',
    is_active: true, images: [],
    created_by: creator, created_at: '2024-01-20T10:00:00Z', updated_at: now,
  },
  {
    id: 3, residence_id: 1, residence_name: 'Maple Street House',
    title: 'Dishwasher Warranty', description: 'Bosch dishwasher 2-year warranty',
    document_type: 'warranty',
    file_url: '', file_name: 'dishwasher-warranty.pdf', mime_type: 'application/pdf',
    purchase_date: '2023-11-01', expiry_date: daysFromNow(-30),
    purchase_price: 850, vendor: 'Home Depot',
    serial_number: 'BSH-44210', model_number: 'Bosch 500 Series',
    is_active: true, images: [],
    created_by: creator, created_at: '2024-01-20T10:00:00Z', updated_at: now,
  },
  {
    id: 4, residence_id: 2, residence_name: 'Downtown Apartment',
    title: 'Window AC Warranty', description: 'Portable AC unit warranty',
    document_type: 'warranty',
    file_url: '', file_name: 'ac-warranty.pdf', mime_type: 'application/pdf',
    purchase_date: '2024-06-01', expiry_date: daysFromNow(90),
    purchase_price: 350, vendor: 'Amazon',
    serial_number: 'LG-P1234', model_number: 'LG LP0821GSSM',
    is_active: true, images: [],
    created_by: creator, created_at: '2024-06-02T10:00:00Z', updated_at: now,
  },

  // General documents (4)
  {
    id: 5, residence_id: 1, residence_name: 'Maple Street House',
    title: 'Home Insurance Policy', description: 'Annual homeowners insurance policy document',
    document_type: 'insurance',
    file_url: '', file_name: 'home-insurance-2024.pdf', mime_type: 'application/pdf',
    expiry_date: daysFromNow(200),
    vendor: 'State Farm',
    serial_number: '', model_number: '',
    is_active: true, images: [],
    created_by: creator, created_at: '2024-01-05T10:00:00Z', updated_at: now,
  },
  {
    id: 6, residence_id: 1, residence_name: 'Maple Street House',
    title: 'Plumbing Repair Receipt', description: 'Receipt for kitchen faucet replacement',
    document_type: 'receipt',
    file_url: '', file_name: 'plumbing-receipt.pdf', mime_type: 'application/pdf',
    purchase_date: '2025-02-15', purchase_price: 175,
    vendor: 'Johnson Plumbing',
    serial_number: '', model_number: '',
    is_active: true, images: [],
    created_by: creator, created_at: '2025-02-15T10:00:00Z', updated_at: now,
  },
  {
    id: 7, residence_id: 2, residence_name: 'Downtown Apartment',
    title: 'Lease Agreement', description: 'Current rental lease agreement',
    document_type: 'contract',
    file_url: '', file_name: 'lease-2024.pdf', mime_type: 'application/pdf',
    expiry_date: daysFromNow(180),
    vendor: '', serial_number: '', model_number: '',
    is_active: true, images: [],
    created_by: creator, created_at: '2024-03-01T10:00:00Z', updated_at: now,
  },
  {
    id: 8, residence_id: 1, residence_name: 'Maple Street House',
    title: 'Furnace Manual', description: 'Carrier furnace owner manual and specs',
    document_type: 'manual',
    file_url: '', file_name: 'furnace-manual.pdf', mime_type: 'application/pdf',
    vendor: 'Carrier', serial_number: '', model_number: 'Carrier 59SC5',
    is_active: true, images: [],
    created_by: creator, created_at: '2024-01-20T10:00:00Z', updated_at: now,
  },
];
