import request from '@/utils/request';
import { AxiosPromise } from 'axios';

export interface SubOrderListParams {
  content?: string;
  service?: number | string;
  status?: number | string;
  pageNum: number;
  pageSize: number;
}

export interface SubOrderVO {
  id: number;
  code: string;
  service: number;
  toAddress: string;
  mode: number;
  type: number;
  pet: number;
  petName: string;
  petBreed: string;
  customer: number;
  customerName: string;
  site: number;
  store: number;
  storeName: string;
  placer: number;
  placerUsername: string;
  createTime: string;
  status: number;
  fulfiller: number;
  fulfillerName: string;
  fulfillerStatus: string;
  fulfillmentCommission: number;
}

export interface SubOrderListResult {
  total: number;
  rows: SubOrderVO[];
  code: number;
  msg: string;
}

/**
 * 获取商户订单列表
 */
export function listSubOrderOnMerchant(params: SubOrderListParams): AxiosPromise<SubOrderListResult> {
  return request({
    url: '/order/subOrder/listOnMerchant',
    method: 'get',
    params
  });
}
