package com.ga.core.mapstruct;

import com.ga.core.vo.product.ContractSaveReq;
import com.ga.core.vo.product.ContractVO;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.MappingTarget;

@Mapper(componentModel = "spring")
public interface ContractMapStruct {

    @Mapping(target = "contractId",  ignore = true)
    @Mapping(target = "status",      ignore = true)
    @Mapping(target = "lapseDate",   ignore = true)
    @Mapping(target = "revivalDate", ignore = true)
    @Mapping(target = "createdAt",   ignore = true)
    @Mapping(target = "updatedAt",   ignore = true)
    ContractVO toVO(ContractSaveReq req);

    @Mapping(target = "contractId",  ignore = true)
    @Mapping(target = "status",      ignore = true)
    @Mapping(target = "lapseDate",   ignore = true)
    @Mapping(target = "revivalDate", ignore = true)
    @Mapping(target = "createdAt",   ignore = true)
    @Mapping(target = "updatedAt",   ignore = true)
    void updateVO(ContractSaveReq req, @MappingTarget ContractVO vo);
}
