package com.xisc.pm.infra.feign;

import com.xisc.pm.domain.vo.WmInStockVO;
import com.xisc.pm.domain.vo.WmSigleQtyVO;
import com.xisc.pm.infra.feign.fallback.WmApiFeignFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

/**
 * @author 纪文桃 wentao.ji01@hand-china.com
 * @date 2024/10/23 11:46
 * @description
 */
@FeignClient(value = "${xisc.service.wm.name:xisc-wm}", fallbackFactory = WmApiFeignFallbackFactory.class)
public interface WmApiFeign {

    /**
     * 修改复合坯复材库存
     *
     * @param organizationId 租户
     * @param WmSigleQtyVOs  入参
     * @return
     */
    @PostMapping("/v1/{organizationId}/wm-itf/sync-sigle-qty")
    ResponseEntity<String> syncSigleQty(@PathVariable Long organizationId, @RequestBody List<WmSigleQtyVO> WmSigleQtyVOs);

    /**
     * 材料消耗
     *
     * @param tenantId
     * @param wmInStockVOS
     * @return
     */
    @PostMapping("/v1/{organizationId}/wm-itf/mat-remove")
    ResponseEntity<String> matRemove(@PathVariable("organizationId") Long tenantId, @RequestBody List<WmInStockVO> wmInStockVOS);

    /**
     * 材料下线入库
     *
     * @param tenantId
     * @param wmInStockVOS
     * @return
     */
    @PostMapping("/v1/{organizationId}/wm-itf/in-stock")
    ResponseEntity<String> inStock(@PathVariable("organizationId") Long tenantId, @RequestBody List<WmInStockVO> wmInStockVOS);
}
