package cz.muni.fi.pa165.soccermanager.mapper;

import cz.muni.fi.pa165.soccermanager.dto.UserDto;
import cz.muni.fi.pa165.soccermanager.dto.request.CreateUserRequest;
import cz.muni.fi.pa165.soccermanager.factory.UserFactory;
import cz.muni.fi.pa165.soccermanager.entity.User;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;

import java.util.List;

@Mapper(uses = UserFactory.class)
public interface UserMapper {

    UserDto map(User source);

    @Mapping(target = "password", ignore = true)
    @Mapping(target = "id", ignore = true)
    User map(CreateUserRequest request);

    List<UserDto> map(List<User> source);

}
