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

import com.jeesharp.business.modules.pay.api.PaySubsidyChannelApi;
import com.jeesharp.business.modules.pay.subsidy.dto.PaySubsidyCancelRequestDTO;
import com.jeesharp.business.modules.pay.subsidy.dto.PaySubsidyCreateRequestDTO;
import com.jeesharp.business.modules.pay.subsidy.dto.PaySubsidyResultDTO;
import com.jeesharp.business.modules.pay.subsidy.dto.PaySubsidyReturnRequestDTO;
import com.jeesharp.business.modules.pay.subsidy.support.PayWechatSubsidyClient;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;

/**
 * {@link PaySubsidyChannelApi} 实现。
 *
 * @author jeesharp
 * @since 2026-06-12
 */
@Service
@AllArgsConstructor
public class PaySubsidyChannelApiImpl implements PaySubsidyChannelApi {

    private final PayWechatSubsidyClient payWechatSubsidyClient;

    @Override
    public PaySubsidyResultDTO createSubsidy(PaySubsidyCreateRequestDTO request) {
        return payWechatSubsidyClient.createSubsidy(request);
    }

    @Override
    public PaySubsidyResultDTO querySubsidy(String platformTenantId, String subMchId, String transactionId) {
        return payWechatSubsidyClient.querySubsidy(platformTenantId, subMchId, transactionId);
    }

    @Override
    public PaySubsidyResultDTO returnSubsidy(PaySubsidyReturnRequestDTO request) {
        return payWechatSubsidyClient.returnSubsidy(request);
    }

    @Override
    public PaySubsidyResultDTO cancelSubsidy(PaySubsidyCancelRequestDTO request) {
        return payWechatSubsidyClient.cancelSubsidy(request);
    }
}
