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

import com.xunhong.erp.turbo.api.biz.dto.cmd.CompanyPaymentAccountCreateCmd;
import com.xunhong.erp.turbo.api.biz.dto.cmd.CompanyPaymentAccountUpdateCmd;
import com.xunhong.erp.turbo.biz.domain.entity.CompanyPaymentAccount;
import com.xunhong.erp.turbo.biz.infrastructure.entity.CompanyPaymentAccountDO;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.MappingTarget;
import org.mapstruct.NullValueCheckStrategy;

/**
 * @author shenyifei
 */
@Mapper(componentModel = "spring", nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS)
public interface CompanyPaymentAccountConvert {

	@Mapping(target = "company", source = "companyDO")
	CompanyPaymentAccount toCompanyPaymentAccount(CompanyPaymentAccountDO companyPaymentAccountDO);

	@Mapping(target = "companyDO", ignore = true)
	@Mapping(target = "version", ignore = true)
	@Mapping(target = "updatedAt", ignore = true)
	@Mapping(target = "isDelete", ignore = true)
	@Mapping(target = "createdAt", ignore = true)
	CompanyPaymentAccountDO toCompanyPaymentAccountDO(CompanyPaymentAccountCreateCmd companyPaymentAccountCreateCmd);

	@Mapping(target = "companyDO", ignore = true)
	@Mapping(target = "version", ignore = true)
	@Mapping(target = "updatedAt", ignore = true)
	@Mapping(target = "isDelete", ignore = true)
	@Mapping(target = "createdAt", ignore = true)
	void toCompanyPaymentAccountDO(@MappingTarget CompanyPaymentAccountDO companyPaymentAccountDO, CompanyPaymentAccountUpdateCmd companyPaymentAccountUpdateCmd);
}

