
package com.tmerclub.cloud.api.product.feign;

import com.tmerclub.cloud.api.product.dto.WarehouseDTO;
import com.tmerclub.cloud.api.product.dto.WarehouseSearchDTO;
import com.tmerclub.cloud.common.order.vo.WarehouseVO;
import com.tmerclub.cloud.common.response.ServerResponseEntity;

import java.util.List;

/**
 * @author ZP
 * @date
 */
public interface WarehouseFeignClient {

    /**
     * 创建默认仓库
     * @param shopId
     * @param sysType
     * @param phone
     * @param name
     * @param addr
     * @return
     */
    ServerResponseEntity<Void> createWarehouseByShopId(Long shopId, Integer sysType, String phone, String name);

    /**
     * 判断是否默认仓库
     * @param warehouseId
     * @return
     */
    ServerResponseEntity<Boolean> isDefaultWarehouse(Long warehouseId);

    /**
     * 获取仓库（通过仓库id）
     * @param warehouseId 仓库id
     * @return 仓库VO
     */
    WarehouseVO getWarehouseById(Long warehouseId);

    /**
     * 查询仓库集合
     * @param warehouseSearchDTO 仓库查询dto
     * @return 仓库集合
     */
    List<WarehouseVO> listWarehouse(WarehouseSearchDTO warehouseSearchDTO);

    /**
     * 查询可配送的仓库（有对应的区域仓库就返回区域仓库，没有就返回默认仓库）
     * @param warehouseSearchDTO 仓库查询dto
     * @return 仓库集合
     */
    List<WarehouseVO> listCanDeliveryWarehouse(WarehouseSearchDTO warehouseSearchDTO);

    /**
     * 获取商家的默认仓库id
     * @param shopId
     * @param sysType
     * @return
     */
    ServerResponseEntity<Long> getDefaultIdByShopId(Long shopId, Integer sysType);

    /**
     * 获取店铺的所有仓库列表
     * @param shopId
     * @param systype
     * @return
     */
    List<WarehouseVO> listWarehouseByShopId(Long shopId, Integer systype);

    /**
     * 根据门店创建仓库
     * @param warehouseDTO
     * @return
     */
    ServerResponseEntity<Void> insertWarehouseAndArea(WarehouseDTO warehouseDTO);

    /**
     * 根据门店更新仓库
     * @param warehouseDTO
     * @return
     */
    ServerResponseEntity<Void> updateWarehouseAndArea(WarehouseDTO warehouseDTO);

    /**
     * 根据门店id删除仓库
     * @param warehouseId
     * @return
     */
    ServerResponseEntity<Void> deleteWarehouseAndArea(Long warehouseId);
}
