import type { RenewProps } from '../common'

import { post } from '#/api/http'
import { only_last_id } from '#/api/only-last'

import { BasicService } from '../basic'

class SpStaffService extends BasicService {
  // 计算续费费用
  async calRenewFee(data: RenewProps) {
    const url = '/org/provider/user/sysUser/calRenewVipFee'
    return await post(url, data, {
      [only_last_id]: url,
    } as any)
  }
  // 续费
  async renew(data: RenewProps) {
    return await post('/org/provider/user/sysUser/renew', data)
  }

  protected findPageUrl(): string {
    return '/org/provider/user/list'
  }

  protected removeUrl(): string {
    return '/org/provider/user/batch/delete'
  }

  protected saveOrUpdateUrl(): string {
    return '/org/provider/user/saveOrUpdate'
  }

  protected override switchKeyValues() {
    return [
      {
        key: 'status',
        trueValue: 0,
        falseValue: 1,
      },
    ]
  }
}

export const spStaffService = new SpStaffService()
