package vn.azteam.tpf.service.mapper;

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

import org.mapstruct.*;

/**
 * Mapper for the entity TBBlockDetailsReport and its DTO TBBlockDetailsReportDTO.
 */
@Mapper(componentModel = "spring", uses = {TBBlockDetailsMapper.class, TBSuppliesTypeMapper.class, TBSuppliesInWarehouseMapper.class})
public interface TBBlockDetailsReportMapper extends EntityMapper<TBBlockDetailsReportDTO, TBBlockDetailsReport> {

    @Mapping(source = "tbBlockDetails.id", target = "tbBlockDetailsId")
    @Mapping(source = "tbSuppliesType.id", target = "tbSuppliesTypeId")
    @Mapping(source = "tbSuppliesInWarehouse.id", target = "tbSuppliesInWarehouseId")
    TBBlockDetailsReportDTO toDto(TBBlockDetailsReport tBBlockDetailsReport);

    @Mapping(source = "tbBlockDetailsId", target = "tbBlockDetails")
    @Mapping(source = "tbSuppliesTypeId", target = "tbSuppliesType")
    @Mapping(source = "tbSuppliesInWarehouseId", target = "tbSuppliesInWarehouse")
    TBBlockDetailsReport toEntity(TBBlockDetailsReportDTO tBBlockDetailsReportDTO);

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