package com.clx.performance.struct.settle;

import com.clx.performance.model.settle.OrderChildSyncTransportRecord;
import com.clx.performance.model.settle.SettlementDriverDetail;
import com.clx.performance.vo.pc.carrier.settle.CarrierPageSettlementDriverDetailVO;
import com.msl.common.utils.DateStructUtil;
import com.msl.common.utils.DateUtils;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;

import java.util.List;

@Mapper(componentModel = "spring", uses = DateStructUtil.class, imports = {DateUtils.class})
public interface SettlementDriverDetailStruct {

    List<CarrierPageSettlementDriverDetailVO> covertList(List<SettlementDriverDetail> records);

    @Mapping(target = "loanFlagMsg", expression = "java(com.clx.performance.enums.loan.OwnerLoanRecordEnum.LoanFlag.getMsgByCode(detail.getLoanFlag()))")
    CarrierPageSettlementDriverDetailVO convert(SettlementDriverDetail detail);

    OrderChildSyncTransportRecord convertRecord(SettlementDriverDetail detail);
}
