import { PageQueryParam, PageResult } from "../base";

/**
 * 返佣管理请求参数
 */
export interface RewardQueryParam extends PageQueryParam {
    type?: string;
    memberId?: string;
    startTime?: string;
    endTime?: string;
    property?: string | null;
    direction?: string | null;
}

/**
 * 返佣管理列表分页列表项
 */
export interface RewardItem {
    id: number;
    member: Member;
    fromMember: FromMember;
    type: number;
    num: number;
    coin: Coin;
    contractOrderEntrust: ContractOrderEntrust;
    createTime: string;
}

export interface Member {
    id: number;
    mobilePhone: string;
}

export interface FromMember {
    id: number;
    mobilePhone: string;
}

export interface Coin {
    name: string;
}

export interface ContractOrderEntrust {
    id: number;
}

/**
 * 返佣管理分页项类型
 */
export type RewardPageResult = PageResult<RewardItem[]>;

/**
 * 返佣比例请求参数
 */
export interface RewardSetQueryParam extends PageQueryParam {
    account?: string;
    commonStatus?: string;
    superPartner?: string;
    property?: string;
    direction?: string;
    getAccount?: string;
}

/**
 * 返佣比例列表分页列表项
 */
export interface RewardSetItem {
    id: number;
    username: string;
    thirdLevel: number;
    memberLevel: number;
    inviterId: number;
    transactionStatus: number;
    status: number;
    superPartner: number;
    registrationTime: string;
    agentTotalCount: number;
    directAgentCount?: number;
    agentTotalBalance: number | null;
    agentTotalRecharge: number | null;
    agentTotalWithdraw: number | null;
    agentTotalAward: number | null;
    agentTotalFee: number | null;
    expand: boolean;
    label: string;
    children: RewardSetItem[];
    rate: number | null;
    followBalance: number;
    contractBalance: number;
}

/**
 * 返佣比例分页项类型
 */
export type RewardSetPageResult = PageResult<RewardSetItem[]>;

export interface RewardSetParam {
    id: string;
    rate: number;
    type: string;
    username: string;
    realName: string;
    canUpdate: boolean;
    wcRate?: string | number;
}

/**
 * 生效合约账户参数
 */
export interface InitContractWalletParam {
    contractId: number | string;
}

/**
 * 戳一下参数
 */
export interface PokeParam {
    contractId: number | string;
    price: number | string;
}

/**
 * 委托请求参数
 */
export interface EntrustQueryParam extends PageQueryParam {
    account?: string;
    property?: string;
    direction?: string;
    contractId?: number | string;
    entrustType?: number | string;
    type?: number | string;
    isBlast?: number | string;
    isFromSpot?: number | string;
    status?: number | string;
    memberId?: number | string;
    phone?: string;
    email?: string;
    profitAndLoss?: number | string;
    volume?: number | string;
    startTime?: string;
    endTime?: string;
}

/**
 * 委托分页项类型
 */
export type EntrustPageResult = PageResult<EntrustItem[]>;

export interface EntrustItem {
    id: number | string;
    memberId: number | string;
    symbol: string;
    status: number | string;
    direction: string;
    entrustType: string;
    type: string;
    isFromSpot: number;
    usdtOpenPrice: number;
    volume: number;
    triggerPrice: number;
    entrustPrice: number;
    tradedPrice: number;
    tradedVolume: number;
    openFee: number;
    closeFee: number;
    profitAndLoss: number;
    isBlast: number;
    createTime: string;
}

/**
 * 撤销订单参数
 */
export interface EntrustIdParam {
    entrustId: number | string;
}

/**
 * 仓位管理请求参数
 */
export interface ContractQueryParam extends PageQueryParam {
    contractId?: number | string;
    memberId?: number | string;
    phone?: string;
    email?: string;
    property?: string;
    direction?: string;
    status?: string;
}

/**
 * 仓位管理分页项类型
 */
export type ContractPageResult = PageResult<ContractItem[]>;

/**
 * 仓位管理数据项
 */
export interface ContractItem {
    id: number | string;
    memberId: number | string;
    availablePosition: string;
    closePrice: number | string;
    closeTime: string;
    closeType: string;
    closedOpenPrice: number;
    closedPosition: string;
    currentOpenValue: number;
    currentPosition: string;
    currentPrice: number;
    currentProfit: number;
    decimalScale: number;
    direction: string;
    frozenPosition: string;
    leverage: number;
    moneyType: string;
    openPrice: number;
    openTime: string;
    openType: number;
    principalAmount: number;
    status: string;
    createTime: string;
    isLock: number | null;
    coin: Coin;
    currentPositionList: any;
    positionsWithCut: any;
    currentPositionWithCutList: any;
}

export interface Coin {
    unit: string;
    name: string;
    nameCn: string;
    status: number;
}

export interface ForceCloseAllParam {
    username?: string;
    password?: string;
}

/**
 * 参数id
 */
export interface IdParam {
    id?: string;
}

/**
 * 强平参数
 */
export interface ForceCloseOutParam {
    positionId?: string;
    username?: string;
    password?: string;
}

// 测试价格请求参数

export interface testValueParam {
    symbol: string;
    price: number;
}
