package com.xunhong.erp.turbo.biz.infrastructure.convert;

import com.xunhong.erp.turbo.api.biz.dto.cmd.DealerPaymentAccountCreateCmd;
import com.xunhong.erp.turbo.api.biz.dto.cmd.DealerPaymentAccountUpdateCmd;
import com.xunhong.erp.turbo.biz.domain.entity.DealerPaymentAccount;
import com.xunhong.erp.turbo.biz.infrastructure.entity.DealerPaymentAccountDO;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.MappingTarget;
import org.mapstruct.NullValueCheckStrategy;

/**
 * @author shenyifei
 */
@Mapper(componentModel = "spring", nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS, uses = {DealerConvert.class})
public interface DealerPaymentAccountConvert {

	@Mapping(target = "dealer", source = "dealerDO")
	DealerPaymentAccount toDealerPaymentAccount(DealerPaymentAccountDO dealerPaymentAccountDO);

	@Mapping(target = "dealerDO", ignore = true)
	@Mapping(target = "version", ignore = true)
	@Mapping(target = "updatedAt", ignore = true)
	@Mapping(target = "isDelete", ignore = true)
	@Mapping(target = "createdAt", ignore = true)
	DealerPaymentAccountDO toDealerPaymentAccountDO(DealerPaymentAccountCreateCmd dealerPaymentAccountCreateCmd);

	@Mapping(target = "dealerDO", ignore = true)
	@Mapping(target = "version", ignore = true)
	@Mapping(target = "updatedAt", ignore = true)
	@Mapping(target = "isDelete", ignore = true)
	@Mapping(target = "createdAt", ignore = true)
	void toDealerPaymentAccountDO(@MappingTarget DealerPaymentAccountDO dealerPaymentAccountDO, DealerPaymentAccountUpdateCmd dealerPaymentAccountUpdateCmd);
}

