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 = "finance-service", url = "${finance.service.url}")
public interface FinanceClient {

    /**
     * 创建退款记录
     */
    @PostMapping("/api/finance/refunds")
    ApiResponse<?> createRefund(@RequestBody Object request);

    /**
     * 确认退款成功
     */
    @PutMapping("/api/finance/refunds/{id}/confirm")
    ApiResponse<?> confirmRefund(@PathVariable("id") Long id, @RequestBody Object request);

    /**
     * 查询退款记录状态
     */
    @GetMapping("/api/finance/refunds/{id}")
    ApiResponse<?> getRefund(@PathVariable("id") Long id);
}
