import request from '@/utils/request'
import { sellerShopHeaders } from '@/utils/sellerShop'

// 入库单列表
export function listSellerStockInbound(query) {
  return request({
    url: '/agri/seller/stock/inbound/list',
    method: 'get',
    params: query,
    headers: sellerShopHeaders()
  })
}

// 入库单详情
export function getSellerStockInbound(inboundId) {
  return request({
    url: '/agri/seller/stock/inbound/' + inboundId,
    method: 'get',
    headers: sellerShopHeaders()
  })
}

// 手工创建入库单
export function createSellerStockInbound(data) {
  return request({
    url: '/agri/seller/stock/inbound',
    method: 'post',
    data: data,
    headers: sellerShopHeaders()
  })
}

// 经办人下拉（历史入库操作人）
export function listStockInboundOperators() {
  return request({
    url: '/agri/seller/stock/inbound/operators',
    method: 'get',
    headers: sellerShopHeaders()
  })
}

// 商品选择器
export function listStockInboundGoodsOptions(query) {
  return request({
    url: '/agri/seller/stock/inbound/goods/options',
    method: 'get',
    params: query,
    headers: sellerShopHeaders()
  })
}

// 条码/商品编号录入
export function getStockInboundGoodsByBarcode(barcode) {
  return request({
    url: '/agri/seller/stock/inbound/goods/byBarcode',
    method: 'get',
    params: { barcode },
    headers: sellerShopHeaders()
  })
}
