package vn.azteam.tpf.service.mapper;

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

import org.mapstruct.*;
import vn.azteam.tpf.service.dto.TBSuppliesUsingDetailsDTO;

/**
 * Mapper for the entity TBNurseryDetails and its DTO TBNurseryDetailsDTO.
 */
@Mapper(componentModel = "spring", uses = {TBActivityMapper.class})
public interface TBNurseryDetailsMapper extends EntityMapper<TBNurseryDetailsDTO, TBNurseryDetails> {

    @Mapping(source = "tbActivity.id", target = "tbActivityId")
    TBNurseryDetailsDTO toDto(TBNurseryDetails tBNurseryDetails);

    @Mapping(source = "tbActivityId", target = "tbActivity")
    TBNurseryDetails toEntity(TBNurseryDetailsDTO tBNurseryDetailsDTO);

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