export const TRADE_CUSTOM_IDS = {
    PREFIX: "trade_",
    ADD_ITEM: "trade_add_item",
    ADD_MONEY: "trade_add_money",
    REMOVE_ITEM: "trade_remove_item",
    LOCK: "trade_lock",
    CANCEL: "trade_cancel",
    CONFIRM: "trade_confirm",
    MONEY_MODAL: "trade_money_modal",
    MONEY_AMOUNT_FIELD: "amount",
    SELECT_ITEM: "trade_select_item",
    REMOVE_ITEM_SELECT: "trade_remove_item_select",
} as const;

export interface TradeItem {
    id: number;
    name: string; // Cache name for UI display
    quantity: bigint;
}

export interface TradeOffer {
    money: bigint;
    items: TradeItem[]; // easier to iterate for UI than Map
}

export interface TradeParticipant {
    id: string;
    username: string;
    locked: boolean;
    offer: TradeOffer;
}

export type TradeState = 'NEGOTIATING' | 'COMPLETED' | 'CANCELLED';

export interface TradeSession {
    threadId: string;
    userA: TradeParticipant;
    userB: TradeParticipant;
    state: TradeState;
    lastInteraction: number;
}
