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

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

/**
 * Mapper for the entity {@link UtenteApp} and its DTO {@link UtenteAppDTO}.
 */
@Mapper(componentModel = "spring")
public interface UtenteAppMapper extends EntityMapper<UtenteAppDTO, UtenteApp> {
    @Mapping(target = "internalUser", source = "internalUser", qualifiedByName = "userLogin")
    UtenteAppDTO toDto(UtenteApp s);

    @Named("userLogin")
    @BeanMapping(ignoreByDefault = true)
    @Mapping(target = "id", source = "id")
    @Mapping(target = "login", source = "login")
    UserDTO toDtoUserLogin(User user);
}
