package com.jeesharp.business.modules.finance.application.api;

import com.jeesharp.business.modules.finance.api.PayRefundApi;
import com.jeesharp.business.modules.finance.payrefund.application.PayRefundOrderApplicationService;
import com.jeesharp.business.modules.finance.payrefund.dto.PayRefundCreateDTO;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.Map;

/**
 * {@link PayRefundApi} 实现，委托 {@link PayRefundOrderApplicationService}。
 *
 * @author jeesharp
 * @since 2026-06-11
 */
@Service
@AllArgsConstructor
public class PayRefundApiImpl implements PayRefundApi {

    private final PayRefundOrderApplicationService payRefundOrderApplicationService;

    @Override
    public String createAndExecute(PayRefundCreateDTO dto) {
        return payRefundOrderApplicationService.createAndExecute(dto);
    }

    @Override
    public void retry(String refundOrderId) {
        payRefundOrderApplicationService.retry(refundOrderId);
    }

    @Override
    public void handleWechatNotify(String rawBody, Map<String, String> headers) throws Exception {
        payRefundOrderApplicationService.handleWechatNotify(rawBody, headers);
    }
}
