package it.sw.pa.comune.artegna.service.mapper;

import it.sw.pa.comune.artegna.domain.Conferma;
import it.sw.pa.comune.artegna.domain.UtenteApp;
import it.sw.pa.comune.artegna.service.dto.ConfermaDTO;
import it.sw.pa.comune.artegna.service.dto.UtenteAppDTO;
import org.mapstruct.*;

/**
 * Mapper for the entity {@link Conferma} and its DTO {@link ConfermaDTO}.
 */
@Mapper(componentModel = "spring")
public interface ConfermaMapper extends EntityMapper<ConfermaDTO, Conferma> {
    @Mapping(target = "confermataDa", source = "confermataDa", qualifiedByName = "utenteAppUsername")
    ConfermaDTO toDto(Conferma s);

    @Named("utenteAppUsername")
    @BeanMapping(ignoreByDefault = true)
    @Mapping(target = "id", source = "id")
    @Mapping(target = "username", source = "username")
    UtenteAppDTO toDtoUtenteAppUsername(UtenteApp utenteApp);
}
