import { server } from "@/utils/client";

/**
 * entity.UserAgentToDayInfo
 */
export interface UserAgentToDayInfo {
    /**
     * 佣金
     */
    commissar?: number;
    /**
     * 有效金额
     */
    effective_amount?: number;
    /**
     * 充值人数
     */
    recharge_user_count?: number;
    /**
     * 注册数量
     */
    reg_count?: number;
}
export const getRegisterCountApi = () => {
    return server.post<UserAgentToDayInfo>({
        url: "/v1/api/user/user_today_register_count",
        data: {},
    });
};
export const getTotalCountApi = () => {
    return server.post<UserAgentToDayInfo>({
        url: "/v1/api/user/user_agent_statistics",
        data: {},
    });
};
export interface UserCommissionStatistics {
    /**
     * 佣金
     */
    commissar?: number;
    /**
     * 等级
     */
    level?: number;
    /**
     * 提现佣金
     */
    withdrawal_commissions?: number;
    /**
     * 是否能领取
     */
    enable_receive: boolean;
    max_value: number;
    min_value: number;
}
export const getCommissionApi = () => {
    return server.post<UserCommissionStatistics>({
        url: "/v1/api/user/user_commission_statistics",
        data: {},
    });
};
export interface InfoDayRequest {
    /**
     * 分页模式--当前页数
     */
    current_page: number;
    /**
     * day
     */
    day: number;
    /**
     * 升序-降序
     */
    is_asc?: boolean;
    /**
     * 是否已经没有数据
     */
    is_end?: boolean;
    /**
     * 下一页的起始位，默认0
     */
    next_cursor?: string;
    /**
     * 每页大小
     */
    page_size: number;
    /**
     * 如果是升序-那就是最大ID，如果是降序那就是最小ID
     */
    start_cursor?: string;
    /**
     * 总数
     */
    total_count?: number;
    /**
     * 是否使用分页----默认为下标模式
     */
    use_page?: boolean;
}

export interface UserLevelToDayResp {
    /**
     * 佣金
     */
    commissar?: number;
    /**
     * 等级
     */
    level?: number;
    /**
     * 电话号码
     */
    phone?: string;
    /**
     * 自己的有效投注
     */
    score?: number;
    /**
     * 有效总投注人数
     */
    score_num?: number;
}

export const getInfoDayApi = (data: InfoDayRequest) => {
    return server.post<UserLevelToDayResp[]>({
        url: "/v1/api/user/user_self_info_day",
        data,
    });
};

export interface InfoDayListRequest {
    /**
     * 当前页数
     */
    current_page?: number;
    /**
     * 每页大小
     */
    page_size?: number;
}
export interface UserTodayInfoList {
    /**
     * 佣金
     */
    commissar?: number;
    /**
     * 日期
     */
    day?: string;
    /**
     * 有效金额
     */
    effective_amount?: number;
    /**
     * 等级
     */
    level?: number;
    /**
     * 总充值
     */
    recharge?: number;
    /**
     * 进注册数量
     */
    reg_count?: number;
    /**
     * 有效投注人数
     */
    register_new?: number;
}
export const getInfoDayList = (data: InfoDayListRequest) => {
    return server.post<UserTodayInfoList[]>({
        url: "/v1/api/user/user_self_info_list",
        data,
    });
};
export interface UserWithdrawalList {
    /**
     * 提现金额
     */
    withdrawal_amount?: number;
    /**
     * 提现详情
     */
    withdrawal_detail?: string;
    /**
     * 提现状态
     */
    withdrawal_status?: number;
    /**
     * 提现时间
     */
    withdrawal_time?: number;
}
export const getWithdrawalListApi = (data: InfoDayListRequest) => {
    return server.post<UserWithdrawalList[]>({
        url: "/v1/api/user/user_commission_withdrawal_list",
        data,
    });
};

/**
 * @description 前台用户佣金提现
 */
export const getWithdrawalApi = (data: { amount: number }) => {
    return server.post({
        url: "/v1/api/user/user_commission_withdrawal",
        data,
    });
};
