package vn.azteam.tpf.service.mapper;

import vn.azteam.tpf.domain.*;
import vn.azteam.tpf.service.dto.TBGuidelineDetailsObjectUpdateDTO;

import org.mapstruct.*;

/**
 * Mapper for the entity TBGuidelineDetailsObjectUpdate and its DTO TBGuidelineDetailsObjectUpdateDTO.
 */
@Mapper(componentModel = "spring", uses = {TBObjectParameterMapper.class,
                                            TBGuidelineActivityMapper.class})
public interface TBGuidelineDetailsObjectUpdateMapper extends EntityMapper<TBGuidelineDetailsObjectUpdateDTO, TBGuidelineDetailsObjectUpdate> {

    @Mapping(source = "tbObjectParameter.id", target = "tbObjectParameterId")
    @Mapping(source = "tbGuidelineActivity.id", target = "tbGuidelineActivityId")
    TBGuidelineDetailsObjectUpdateDTO toDto(TBGuidelineDetailsObjectUpdate tBGuidelineDetailsObjectUpdate);

    @Mapping(source = "tbObjectParameterId", target = "tbObjectParameter")
    @Mapping(source = "tbGuidelineActivityId", target = "tbGuidelineActivity")
    TBGuidelineDetailsObjectUpdate toEntity(TBGuidelineDetailsObjectUpdateDTO tBGuidelineDetailsObjectUpdateDTO);

    default TBGuidelineDetailsObjectUpdate fromId(Long id) {
        if (id == null) {
            return null;
        }
        TBGuidelineDetailsObjectUpdate tBGuidelineDetailsObjectUpdate = new TBGuidelineDetailsObjectUpdate();
        tBGuidelineDetailsObjectUpdate.setId(id);
        return tBGuidelineDetailsObjectUpdate;
    }
}
