import {
  ClipboardCheck,
  FileText,
  PackageCheck,
  ShieldCheck,
  Ship,
  Train,
} from "lucide-react";

export const PROGRESS_STAGES = [
  {
    label: "Request",
    icon: FileText,
    statuses: ["DRAFT", "CHANGES_REQUESTED"],
  },
  {
    label: "Submitted",
    icon: ClipboardCheck,
    statuses: ["SUBMITTED"],
  },
  {
    label: "Approval",
    icon: ShieldCheck,
    statuses: ["PENDING_APPROVAL", "APPROVED_PENDING_SIGNATURE", "APPROVED"],
  },
  {
    label: "Contract",
    icon: ShieldCheck,
    statuses: ["CONTRACT_READY", "SIGNED_CUSTOMER"],
  },
  {
    label: "Payment",
    icon: ShieldCheck,
    statuses: [
      "FULLY_EXECUTED",
      "SELECTED_FOR_BATCH",
      "PAYMENT_VERIFICATION_IN_PROGRESS",
    ],
  },
  {
    label: "Loading",
    icon: Ship,
    statuses: [
      "PAID",
      "PNR_GENERATED",
      "PENDING_CONSOLIDATION",
      "CONSOLIDATED",
    ],
  },
  {
    label: "In Transit",
    icon: Train,
    statuses: ["EXPIRED", "IN_TRANSIT"],
  },
  {
    label: "Complete",
    icon: PackageCheck,
    statuses: ["COMPLETED", "DELIVERED"],
  },
];

export const STATUS_MAP: Record<
  string,
  { title: string; description: string; stage: number }
> = {
  DRAFT: {
    title: "Draft — not submitted",
    description:
      "This booking is being prepared and hasn’t been submitted for review yet.",
    stage: 0,
  },
  CHANGES_REQUESTED: {
    title: "Changes requested",
    description: "Staff has requested changes. Please review and resubmit.",
    stage: 0,
  },
  SUBMITTED: {
    title: "Submitted for review",
    description: "Your booking has been submitted and is awaiting review.",
    stage: 1,
  },
  PENDING_APPROVAL: {
    title: "Pending approval",
    description: "Your booking is moving through the approval process.",
    stage: 2,
  },
  APPROVED_PENDING_SIGNATURE: {
    title: "Approved — awaiting signature",
    description: "Approved. Your contract will be ready to sign shortly.",
    stage: 2,
  },
  APPROVED: {
    title: "Approved",
    description: "Your booking has been fully approved.",
    stage: 2,
  },
  CONTRACT_READY: {
    title: "Contract ready to sign",
    description:
      "Your contract is ready. Review and apply your signature to proceed.",
    stage: 3,
  },
  SIGNED_CUSTOMER: {
    title: "Signed — awaiting staff",
    description:
      "Your signature has been submitted. Awaiting the final staff signature.",
    stage: 3,
  },
  FULLY_EXECUTED: {
    title: "Contract fully executed",
    description: "Signed by all parties. You can now proceed to payment.",
    stage: 4,
  },
  SELECTED_FOR_BATCH: {
    title: "Selected for a train — payment due",
    description:
      "Your booking was selected for a scheduled train. Complete payment within the pay window to secure your slot.",
    stage: 4,
  },
  EXPIRED: {
    title: "Pay window expired",
    description:
      "The payment window was missed. You can move this booking to another schedule or cancel it.",
    stage: 6,
  },
  PNR_GENERATED: {
    title: "Payment reference generated",
    description:
      "A payment reference number has been generated for this booking.",
    stage: 5,
  },
  PAYMENT_VERIFICATION_IN_PROGRESS: {
    title: "Verifying payment",
    description: "Your payment is being verified.",
    stage: 4,
  },
  PAID: {
    title: "Payment confirmed",
    description: "Payment has been confirmed for this booking.",
    stage: 5,
  },
  IN_TRANSIT: {
    title: "Cargo moving",
    description: "Your shipment is currently moving through the rail network.",
    stage: 6,
  },
  OPERATION_REQUEST_PENDING: {
    title: "Operation request under review",
    description:
      "Your order has been submitted to operations and is awaiting acceptance.",
    stage: 4,
  },
  OPERATION_CHANGES_REQUESTED: {
    title: "Operation changes requested",
    description: "Operations requested changes to this order. Please review and resubmit.",
    stage: 4,
  },
  OPERATION_PRICE_PENDING_CONFIRM: {
    title: "Price adjusted — confirm to proceed",
    description:
      "Operations adjusted this order's price. Confirm the new price to proceed.",
    stage: 4,
  },
  ROAD_DISPATCH_PENDING: {
    title: "Awaiting truck dispatch",
    description:
      "This road order was accepted and is awaiting truck dispatch. Billed by distance.",
    stage: 5,
  },
  PENDING_CONSOLIDATION: {
    title: "Pending consolidation",
    description: "Awaiting a consolidation partner shipment.",
    stage: 5,
  },
  CONSOLIDATED: {
    title: "Consolidated",
    description: "Cargo has been consolidated with a partner shipment.",
    stage: 5,
  },
  COMPLETED: {
    title: "Service complete",
    description: "Cargo delivered and service successfully terminated.",
    stage: 7,
  },
  DELIVERED: {
    title: "Service complete",
    description: "Cargo delivered and service successfully terminated.",
    stage: 7,
  },
  REJECTED: {
    title: "Booking rejected",
    description: "This booking request has been rejected.",
    stage: -1,
  },
  CANCELLED: {
    title: "Booking cancelled",
    description: "This booking process has been terminated.",
    stage: -1,
  },
};

export const REQUIRED_DOC_FIELDS = [
  { key: "commercial_invoice", label: "Commercial Invoice" },
  { key: "packing_list", label: "Packing List" },
  { key: "certificate_of_origin", label: "Certificate of Origin" },
  { key: "letter_of_credit", label: "Letter of Credit / LC" },
];
