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

/**
 * 会员列表查询参数类型
 */
export interface MemberQueryParam extends PageQueryParam {
    account?: string;
    property?: string;
    direction?: string;
    transactionStartTime?: string;
    transactionEndTime?: string;
    profitStatus?: string;
    commonStatus?: string;
    superPartner?: string;
    lockOrReward?: string;
    inviterId?: string;
    getAccount?: string;
    deviceType?: string;
    isInternal?: string;
}

/**
 * 会员列表分页列表项
 */
export interface MemberItem {
    id: number;
    username: string;
    superPartner: string;
    inviterId: number;
    estimatedBalance: number | null;
    totalRecharge: number | null;
    totalWithdraw: number | null;
    totalProfit: number | string | null;
    totalLoss: number | string | null;
    todayProfit: number | null;
    todayLoss: number | null;
    todayOrder: number | null;
    totalAward: number | null;
    todayAward: number | null;
    totalFee: number | null;
    registrationTime: string;
    transactionStatus: number;
    status: number;
    rate: number;
    wcRate: number;
    agentTotalBalance: number | null;
    groupCount: number;
    agentTotalRecharge: number | null;
    agentTotalWithdraw: number | null;
    agentTotalAward: number | null;
    agentTotalFee: number | null;
    realName: string | null;
    totalBalance?: number | null;
    contractBalance?: number | null;
    followBalance?: number | null;
    agentTotalCount?: number | null;
    /** 直接下级超级代理商数量，用于架构图是否可展开 */
    directAgentCount?: number | null;
    followCount: number | null;
    followRate: number | null;
}

/**
 * 会员分页项类型
 */
export type MemberPageResult = PageResult<MemberItem[]>;

/**
 * 会员id参数
 */
export interface MemberIdParam {
    memberId: number;
}

/**
 * 用户平仓参数
 */
export interface MemberForceCloseParam {
    memberId: number;
    username: string;
    password: string;
}

/**
 * 会员id+状态参数
 */
export interface MemberStatusParam {
    memberId: number;
    status: number;
}

/**
 * 会员id+代理商参数
 */
export interface MemberSuperPartnerParam {
    memberId: number;
    superPartner: string;
}

/**
 * 增加邀请关系参数
 */
export interface InviteRelationParam {
    id: number | string;
    inviterId: string | number;
}

export interface UserListTreeOrg {
    id: number;
    style: string;
    isLeaf?: boolean;
    label: {
        superPartnerText: string;
        id: number;
        t0: string;
        t1: string;
        t2: string;
        t3: string;
        t4: string;
        t5: string;
        t6: string;
        t7: string;
        t8: string;
        t9: string | null;
        diffValue: string;
        rate: number;
    };
    children: UserListTreeOrg[];
}
