import {
  AssetQueryParam,
  AssetPageResult
} from '@/types/api/member/asset';
import request from '@/utils/request';
import { AxiosPromise } from 'axios';

/**
 * "会员管理" => "会员资产"
 * @param data
 */
export function memberAsset(data: AssetQueryParam): AxiosPromise<AssetPageResult> {
  return request({
    url: 'admin/member/member-wallet/balance',
    method: 'post',
    params: data
  });
}

/** 资产划转：获取用户跟单账户与资产账户余额 */
export function getBalanceByMember(memberId: number) {
  return request({
    url: 'admin/follow/account/balance-by-member',
    method: 'post',
    params: { memberId }
  });
}

/** 资产划转：管理员密码校验 */
export function verifyAdminPassword(password: string) {
  return request({
    url: 'admin/system/employee/verify-password',
    method: 'post',
    params: { password }
  });
}

/** 资产划转：跟单账户划转到资产账户 */
export function transferToSpot(data: { memberId: number; amount: number | string }) {
  return request({
    url: 'admin/follow/account/transfer-to-spot',
    method: 'post',
    params: data
  });
}
