package com.erp.aftersale.client;

import com.erp.common.core.model.ApiResponse;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

/**
 * 库存服务Feign客户端
 */
@FeignClient(name = "inventory-service", url = "${inventory.service.url}")
public interface InventoryClient {

    /**
     * 退货入库（售后通过后，商品退回仓库）
     */
    @PostMapping("/api/inventory/return-in")
    ApiResponse<?> returnIn(@RequestBody Object request);

    /**
     * 换货出库（换货时新商品出库）
     */
    @PostMapping("/api/inventory/exchange-out")
    ApiResponse<?> exchangeOut(@RequestBody Object request);

    /**
     * 查询SKU库存
     */
    @GetMapping("/api/inventory/sku/{skuId}")
    ApiResponse<?> getSkuStock(@PathVariable("skuId") Long skuId);

    /**
     * 批量扣减库存（退款时可能需要回退库存锁定）
     */
    @PostMapping("/api/inventory/release-lock")
    ApiResponse<?> releaseLock(@RequestBody Object request);
}
