import type { AuctionCustomerDetail, AuctionUploadDetail, PlateItemDetail } from '@/types/onlineAuctionDetail';
import type { StatusChipColor } from '@/types/statusChip';

export interface MarketplaceListingPlanAddonRow {
    id: string;
    row_type: 'plan' | 'addon';
    name: string;
    type_label: string;
    type_color: StatusChipColor;
    status_label: string;
    status_color: StatusChipColor;
    expiry_date: string | null;
    price: string | number;
}

export interface MarketplaceListingPaymentLineItem {
    type: 'plan' | 'addon' | 'unknown';
    name: string;
}

export interface MarketplaceListingPaymentRow {
    id: number;
    total_amount: string | number;
    transaction_id: string | null;
    status: string;
    status_label: string;
    status_color: string;
    line_items: MarketplaceListingPaymentLineItem[];
    created_at: string | null;
}

export interface MarketplaceListingDetail {
    id: number;
    title: string | null;
    display_label: string;
    description: string | null;
    category: string;
    type: string;
    type_label: string;
    status: string;
    status_label: string;
    status_color: string;
    is_featured: boolean;
    is_relisted: boolean;
    price: string | number | null;
    asking_price: number | null;
    payment_methods: string | null;
    created_at: string | null;
    plate_image_url: string | null;
    image_url: string | null;
    uploads: AuctionUploadDetail[];
    plate: PlateItemDetail | null;
    customer: AuctionCustomerDetail;
    current_plan: {
        plan_name: string;
        expiry_date: string | null;
    } | null;
    subscription: {
        stripe_subscription_id: string;
        status: string;
        status_label: string;
        is_premium_expiring: boolean;
    } | null;
    plan_addon_rows: MarketplaceListingPlanAddonRow[];
    payments: MarketplaceListingPaymentRow[];
    payments_completed_total: number | string;
    view_original_listing_url: string | null;
    can_edit: boolean;
}
