import type { Slide, Appeal, PlayerReport, PromoCode, Subscription } from "@/types";
import { punishments, players } from "./data";

export const slides: Slide[] = [
  {
    id: "s1", enabled: true, order: 1, mediaType: "image",
    mediaUrl: "",
    label: "Season 5 · Live now",
    title: "Compete in a brand new season",
    description: "Reworked ranks, seasonal rewards and two new maps. Queue up on any of our 21 active servers.",
    primary: { label: "Browse servers", to: "/servers", visible: true },
    secondary: { label: "See rewards", to: "/news/season-5-launch", visible: true },
    accent: "from-primary/40 via-primary/10 to-transparent",
  },
  {
    id: "s2", enabled: true, order: 2, mediaType: "image", mediaUrl: "",
    label: "Store · Summer sale",
    title: "Up to 40% off privileges",
    description: "Premium, VIP and reserved slots at their lowest prices of the year. Ends August 3rd.",
    primary: { label: "Open the store", to: "/store", visible: true },
    secondary: { label: "See bundles", to: "/store", visible: true },
    accent: "from-secondary/40 via-secondary/10 to-transparent",
  },
  {
    id: "s3", enabled: true, order: 3, mediaType: "image", mediaUrl: "",
    label: "Skin changer",
    title: "Configure your loadout online",
    description: "Set knife, gloves and every weapon skin, then sync it live to any of our CS2 servers.",
    primary: { label: "Open skin changer", to: "/skins", visible: true },
    secondary: { label: "Learn more", to: "/rules", visible: true },
    accent: "from-info/30 via-info/10 to-transparent",
  },
  {
    id: "s4", enabled: true, order: 4, mediaType: "image", mediaUrl: "",
    label: "Subscription",
    title: "Unlock the full Purple Zone experience",
    description: "Multipliers, cosmetics, extra rewards and marketplace perks. One subscription, everywhere.",
    primary: { label: "See subscription", to: "/subscription", visible: true },
    secondary: { label: "Learn more", to: "/subscription", visible: false },
    accent: "from-primary/30 via-secondary/10 to-transparent",
  },
];

export const appeals: Appeal[] = [
  {
    id: "ap-1001", punishmentId: punishments[0].id, playerId: "me", playerName: "v1p3r",
    reason: "False positive", explanation: "I was using legitimate crosshair placement, please review the demo linked below.",
    evidenceLinks: ["https://demos.purplezone.gg/1234"], attachments: [], videoUrl: "https://youtu.be/xxxxxx",
    status: "under_review", assignedAdmin: "PurpleAdmin",
    createdAt: "2026-07-19 14:12", updatedAt: "2026-07-20 09:04",
    messages: [
      { id: "m1", author: "v1p3r", role: "player", time: "2026-07-19 14:12", body: "Please review the linked demo." },
      { id: "m2", author: "PurpleAdmin", role: "admin", time: "2026-07-20 09:04", body: "Assigned. We will get back to you within 48h." },
    ],
    timeline: [
      { time: "2026-07-19 14:12", label: "Appeal submitted" },
      { time: "2026-07-19 15:00", label: "Marked under review" },
      { time: "2026-07-20 09:04", label: "Assigned to PurpleAdmin" },
    ],
  },
  {
    id: "ap-1002", punishmentId: punishments[2].id, playerId: "me", playerName: "v1p3r",
    reason: "Duration too long", explanation: "First offense — requesting reduction.",
    evidenceLinks: [], attachments: [], status: "approved", assignedAdmin: "PurpleAdmin",
    createdAt: "2026-07-10 10:00", updatedAt: "2026-07-12 18:30",
    messages: [], timeline: [{ time: "2026-07-12 18:30", label: "Approved — reduced to 3d" }],
  },
  {
    id: "ap-1003", punishmentId: punishments[4].id, playerId: "me", playerName: "v1p3r",
    reason: "Mistaken identity", explanation: "That was not me — my account was signed in on a shared PC.",
    evidenceLinks: [], attachments: [], status: "more_info",
    createdAt: "2026-07-05 09:22", updatedAt: "2026-07-06 12:10",
    messages: [{ id: "m1", author: "PurpleAdmin", role: "admin", time: "2026-07-06 12:10", body: "Please provide the Steam ID of the other user." }],
    timeline: [{ time: "2026-07-06 12:10", label: "More information requested" }],
  },
];

export const reports: PlayerReport[] = [
  {
    id: "rp-2001", reporterId: "me", reportedPlayerId: players[3].id, reportedPlayerName: players[3].name,
    category: "cheating", serverId: "srv-1", incidentAt: "2026-07-21 20:15",
    description: "Suspicious pre-fires through smoke on B site multiple rounds.",
    evidenceLinks: ["https://demos.purplezone.gg/9910"], attachments: [],
    status: "investigating", priority: "high", assignedAdmin: "PurpleAdmin", createdAt: "2026-07-21 20:20",
    timeline: [
      { time: "2026-07-21 20:20", label: "Report submitted" },
      { time: "2026-07-21 21:00", label: "Marked investigating" },
    ],
  },
  {
    id: "rp-2002", reporterId: "me", reportedPlayerId: players[7].id, reportedPlayerName: players[7].name,
    category: "voice_abuse", serverId: "srv-2", incidentAt: "2026-07-18 22:00",
    description: "Screaming into mic for entire match.",
    evidenceLinks: [], attachments: [], status: "resolved", priority: "normal", createdAt: "2026-07-18 22:10",
    timeline: [{ time: "2026-07-19 09:00", label: "Punishment issued (mute 24h)" }],
  },
  {
    id: "rp-2003", reporterId: "me", reportedPlayerId: players[9].id, reportedPlayerName: players[9].name,
    category: "toxic", incidentAt: "2026-07-22 12:00",
    description: "Repeated insults in chat.",
    evidenceLinks: [], attachments: [], relatedMessage: "get lost noob",
    status: "submitted", priority: "low", createdAt: "2026-07-22 12:05",
    timeline: [{ time: "2026-07-22 12:05", label: "Report submitted" }],
  },
];

export const promoCodes: PromoCode[] = [
  { id: "pc1", code: "SUMMER25", description: "25% off any store product", enabled: true, discountType: "percentage", discountValue: 25, scope: "any", usageLimit: 1000, perUserLimit: 1, usedCount: 213, revenue: 984.5, endsAt: "2026-08-31" },
  { id: "pc2", code: "WELCOME5", description: "$5 off first purchase", enabled: true, discountType: "fixed", discountValue: 5, scope: "first_purchase", perUserLimit: 1, usedCount: 89, revenue: 2140.3, firstPurchaseOnly: true },
  { id: "pc3", code: "SUBYEAR", description: "20% off annual subscription", enabled: true, discountType: "percentage", discountValue: 20, scope: "subscription", scopeValue: "12m", usedCount: 47, revenue: 1980.1 },
  { id: "pc4", code: "EUONLY", description: "10% off on EU servers", enabled: false, discountType: "percentage", discountValue: 10, scope: "server", scopeValue: "srv-1", usedCount: 12, revenue: 89.2 },
  { id: "pc5", code: "FREEXP", description: "Free XP boost with any bundle", enabled: true, discountType: "free_item", discountValue: 0, scope: "category", scopeValue: "Bundle", usageLimit: 500, usedCount: 320, revenue: 0 },
];

export const subscription: Subscription = {
  id: "sub-1", userId: "me", planId: "3m", status: "active",
  startsAt: "2026-06-15", expiresAt: "2026-09-15", autoRenew: true,
  paymentHistory: [
    { id: "pmt-1", date: "2026-06-15", amount: 12.99, status: "paid" },
    { id: "pmt-2", date: "2026-03-15", amount: 12.99, status: "paid" },
    { id: "pmt-3", date: "2025-12-15", amount: 12.99, status: "paid" },
  ],
  promoUsed: "SUMMER25",
};

export const subscribers: Subscription[] = Array.from({ length: 14 }, (_, i) => ({
  id: `sub-${100 + i}`, userId: players[i % players.length].id, planId: ["1m", "3m", "6m", "12m", "lifetime"][i % 5],
  status: (["active", "expiring_soon", "cancelled", "gifted", "payment_failed", "paused", "expired"] as const)[i % 7],
  startsAt: `2026-05-${(1 + i).toString().padStart(2, "0")}`,
  expiresAt: `2026-08-${(1 + i).toString().padStart(2, "0")}`,
  autoRenew: i % 2 === 0,
  paymentHistory: [{ id: `pmt-${i}`, date: `2026-05-${(1 + i).toString().padStart(2, "0")}`, amount: 12.99, status: "paid" }],
}));