package com.prolog.rdc.tms.service.strategy;

import com.prolog.product.core.framework.entity.UserEntity;
import com.prolog.rdc.tms.model.dto.LoadingBillPriceDTO;
import com.prolog.rdc.tms.model.entity.BmsFreightPriceModel;
import com.prolog.rdc.tms.model.entity.BmsLoadingBillHeaderModel;
import com.prolog.rdc.tms.model.entity.BmsLogisticsContractModel;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class PayExecuteStrategyServiceImpl implements PayExecuteStrategyService {

    @Autowired
    private CostStrategyRuleHandlerContext context;

    @Override
    public List<LoadingBillPriceDTO> executeStrategyLoading(BmsLogisticsContractModel contractModel, BmsFreightPriceModel priceModel, Integer settlementModel, BmsLoadingBillHeaderModel costStrategy, String source,UserEntity user) {
        PayAbstractSplitStrategyRuleHandler handlerInstance = this.context.getHandlerInstancePay(settlementModel);
        return handlerInstance.executeStrategyLoading(contractModel,priceModel,costStrategy, source,user);
    }
}
