package com.iqser.red.service.persistence.management.v1.processor.utils;

import java.util.function.BiConsumer;
import java.util.stream.Collectors;

import com.iqser.red.service.persistence.management.v1.processor.entity.dossier.DossierEntity;
import com.iqser.red.service.persistence.management.v1.processor.entity.dossier.ReportTemplateEntity;
import com.iqser.red.service.persistence.service.v1.api.shared.model.dossiertemplate.dossier.Dossier;

public class DossierMapper implements BiConsumer<DossierEntity, Dossier> {

    @Override
    public void accept(DossierEntity dossierEntity, Dossier dossier) {

        dossier.setReportTemplateIds(dossierEntity.getReportTemplates().stream().map(ReportTemplateEntity::getTemplateId).collect(Collectors.toSet()));
    }

}
