package com.yc.ship.module.trade.service.supplier.impl;

import com.yc.ship.module.trade.controller.admin.order.vo.rule.RefundAuditNotifyReqVO;
import com.yc.ship.module.trade.service.refund.TradeRefundService;
import com.yc.ship.module.trade.service.refund.bo.RefundAuditNotifyBO;
import com.yc.ship.module.trade.service.supplier.SupplierTradeService;
import com.yc.ship.module.trade.service.supplier.TradeStandardSupplierService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Map;

import static com.yc.ship.module.trade.service.supplier.SupplierTradeService.STANDARD_SERVICE;


/**
 * &#064;Description 标准的供应商接入service
 * &#064;Author qsl
 * &#064;Date 2025/08/15 15:03
 */
@Service
@Slf4j
public class TradeStandardSupplierServiceImpl implements TradeStandardSupplierService {

    @Resource
    private Map<String, SupplierTradeService> allSupplierTradeService;
    @Resource
    private TradeRefundService tradeRefundService;

    @Override
    public void handleSupplierRefundAuditNotify(RefundAuditNotifyReqVO refundAuditNotifyReqVO) {
        SupplierTradeService supplierTradeService =  allSupplierTradeService.get(STANDARD_SERVICE);
        RefundAuditNotifyBO refundAuditNotifyBO = supplierTradeService.handleRefundAuditResult(refundAuditNotifyReqVO);
        tradeRefundService.handleSupplierRefundAuditNotify(refundAuditNotifyBO);
    }


}
