import type { Batch, Strain } from "@/types/api"

function daysAgo(days: number): string {
  const d = new Date()
  d.setDate(d.getDate() - days)
  d.setHours(10, 0, 0, 0)
  return d.toISOString()
}

export const mockStrains: Strain[] = [
  {
    id: "s-001",
    name: "Amnesia Haze",
    defaultThcPercent: 22,
    defaultCbdPercent: 1,
  },
  {
    id: "s-002",
    name: "White Widow",
    defaultThcPercent: 19,
    defaultCbdPercent: 2,
  },
  {
    id: "s-003",
    name: "Northern Lights",
    defaultThcPercent: 18,
    defaultCbdPercent: 3,
  },
  {
    id: "s-004",
    name: "Jack Herer",
    defaultThcPercent: 21,
    defaultCbdPercent: 1.5,
  },
  {
    id: "s-005",
    name: "Blue Dream",
    defaultThcPercent: 20,
    defaultCbdPercent: 2,
  },
  {
    id: "s-006",
    name: "Girl Scout Cookies",
    defaultThcPercent: 25,
    defaultCbdPercent: 1,
  },
]

export const mockBatches: Batch[] = [
  {
    id: "b-001",
    strainName: "Amnesia Haze",
    thcPercent: 22.5,
    cbdPercent: 0.8,
    totalGrams: 500,
    availableGrams: 342,
    status: "AVAILABLE",
    supplier: "GreenGrow GmbH",
    harvestDate: "2026-04-15",
    receivedAt: daysAgo(45),
    notes: "Premium-Qualität, Labor geprüft",
  },
  {
    id: "b-002",
    strainName: "White Widow",
    thcPercent: 19.2,
    cbdPercent: 2.1,
    totalGrams: 300,
    availableGrams: 187,
    status: "AVAILABLE",
    supplier: "CannaCraft Berlin",
    harvestDate: "2026-04-20",
    receivedAt: daysAgo(40),
  },
  {
    id: "b-003",
    strainName: "Northern Lights",
    thcPercent: 17.8,
    cbdPercent: 3.2,
    totalGrams: 400,
    availableGrams: 78,
    status: "AVAILABLE",
    supplier: "GreenGrow GmbH",
    harvestDate: "2026-05-01",
    receivedAt: daysAgo(30),
    notes: "Hoher CBD-Gehalt, beliebt bei Schmerzpatienten",
  },
  {
    id: "b-004",
    strainName: "Jack Herer",
    thcPercent: 21.0,
    cbdPercent: 1.5,
    totalGrams: 600,
    availableGrams: 455,
    status: "AVAILABLE",
    supplier: "HanfHaus Sachsen",
    harvestDate: "2026-05-05",
    receivedAt: daysAgo(25),
  },
  {
    id: "b-005",
    strainName: "Blue Dream",
    thcPercent: 20.3,
    cbdPercent: 1.8,
    totalGrams: 350,
    availableGrams: 220,
    status: "AVAILABLE",
    supplier: "CannaCraft Berlin",
    harvestDate: "2026-05-10",
    receivedAt: daysAgo(20),
  },
  {
    id: "b-006",
    strainName: "Girl Scout Cookies",
    thcPercent: 25.1,
    cbdPercent: 0.9,
    totalGrams: 250,
    availableGrams: 180,
    status: "AVAILABLE",
    supplier: "MedCanna Bayern",
    harvestDate: "2026-05-12",
    receivedAt: daysAgo(18),
    notes: "Sehr hoher THC-Gehalt — nur erfahrene Nutzer",
  },
  {
    id: "b-007",
    strainName: "Amnesia Haze",
    thcPercent: 23.0,
    cbdPercent: 0.7,
    totalGrams: 450,
    availableGrams: 390,
    status: "AVAILABLE",
    supplier: "GreenGrow GmbH",
    harvestDate: "2026-05-18",
    receivedAt: daysAgo(12),
  },
  {
    id: "b-008",
    strainName: "White Widow",
    thcPercent: 18.5,
    cbdPercent: 2.3,
    totalGrams: 200,
    availableGrams: 52,
    status: "AVAILABLE",
    supplier: "HanfHaus Sachsen",
    harvestDate: "2026-05-22",
    receivedAt: daysAgo(8),
  },
  {
    id: "b-009",
    strainName: "Northern Lights",
    thcPercent: 18.0,
    cbdPercent: 3.0,
    totalGrams: 500,
    availableGrams: 0,
    status: "DEPLETED",
    supplier: "GreenGrow GmbH",
    harvestDate: "2026-03-01",
    receivedAt: daysAgo(75),
  },
  {
    id: "b-010",
    strainName: "Jack Herer",
    thcPercent: 20.5,
    cbdPercent: 1.4,
    totalGrams: 350,
    availableGrams: 0,
    status: "DEPLETED",
    supplier: "CannaCraft Berlin",
    harvestDate: "2026-03-10",
    receivedAt: daysAgo(70),
  },
  {
    id: "b-011",
    strainName: "Blue Dream",
    thcPercent: 19.8,
    cbdPercent: 2.0,
    totalGrams: 300,
    availableGrams: 245,
    status: "RECALLED",
    supplier: "MedCanna Bayern",
    harvestDate: "2026-04-01",
    receivedAt: daysAgo(55),
    notes: "Rückruf: Schimmelbefall bei Laborkontrolle festgestellt",
  },
  {
    id: "b-012",
    strainName: "Girl Scout Cookies",
    thcPercent: 24.8,
    cbdPercent: 1.0,
    totalGrams: 200,
    availableGrams: 130,
    status: "RECALLED",
    supplier: "HanfHaus Sachsen",
    harvestDate: "2026-04-08",
    receivedAt: daysAgo(50),
    notes: "Rückruf: Pestizid-Rückstände über Grenzwert",
  },
]
