import createAxios from '/@/utils/axios'

export const url = '/admin/user.MoneyLog/'

export function add(userId: string) {
    return createAxios({
        url: url + 'add',
        method: 'get',
        params: {
            userId: userId,
        },
    })
}

export function logHistory(params: { id: number | string }) {
    return createAxios({
        url: url + 'logHistory',
        method: 'get',
        params,
    })
}

export function annualReport(params: { year: number | string }) {
    return createAxios({
        url: url + 'annualReport',
        method: 'get',
        params,
    })
}

export function dailyReport(params: { start: string; end: string; type: 'daily' | 'monthly' | 'yearly' }) {
    return createAxios({
        url: url + 'dailyReport',
        method: 'get',
        params,
    })
}

export function customerReport(params: {
    start: string
    end: string
    username: string
    lose_rebate: string
    page: number
    limit: number
}) {
    return createAxios({
        url: url + 'customerReport',
        method: 'get',
        params,
    })
}
