package <%=packageName%>.service.mapper;

import <%=packageName%>.domain.*;
import <%=packageName%>.service.dto.BigScreenConfigDTO;

import org.mapstruct.*;

/**
 * Mapper for the entity {@link BigScreenConfig} and its DTO {@link BigScreenConfigDTO}.
 */
@Mapper(componentModel = "spring", uses = {BigScreenMapper.class})
public interface BigScreenConfigMapper extends EntityMapper<BigScreenConfigDTO, BigScreenConfig> {

    @Mapping(source = "bigScreen", target = "bigScreen", qualifiedByName = "title")
    @Mapping(source = "componentJson", target = "component")
    BigScreenConfigDTO toDto(BigScreenConfig bigScreenConfig);

    @Mapping(source = "component", target = "componentJson")
    BigScreenConfig toEntity(BigScreenConfigDTO bigScreenConfigDTO);

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