/* API listing_condition: 1 = new, 2 = used */
export type ListingCondition = "new" | "used";
export type ListingStatus = "active" | "sold" | "draft" | "paused" | "deleted";

export interface ListingImage {
  id: string;
  url: string;
  isCover: boolean;
  file?: File;
  galleryId?: number;        // gallery item id for existing images in edit mode
  existingFilename?: string; // server filename to pass back in edit_listing payload
}

export interface WizardData {
  title: string;
  description: string;
  category: string;       // display name from API category
  categoryId: number;     // numeric API category id (0 = none)
  subCategory: string;
  condition: ListingCondition | "";
  images: ListingImage[];
  price: string;
  quantity: string;
  originalPrice: string;
  isNegotiable: boolean;
  city: string;
  area: string;
  pincode: string;
  latitude: string;
  longitude: string;
}

export interface Listing {
  id: string;
  title: string;
  description: string;
  category: string;
  subCategory: string;
  condition: ListingCondition;
  images: ListingImage[];
  price: number;
  originalPrice?: number;
  isNegotiable: boolean;
  city: string;
  area: string;
  status: ListingStatus;
  createdAt: string;
  views: number;
  enquiries: number;
  savedCount: number;
  performanceScore: number;
  isBoosted: boolean;
  boostExpiry?: string;
}

export interface BoostPlan {
  id: string;
  label: string;
  duration: string;
  price: number;
  reach: string;
  estimatedViews: string;
  badge?: string;
}
