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

import cz.muni.fi.pa165.soccermanager.dto.LeagueDto;
import cz.muni.fi.pa165.soccermanager.dto.request.CreateLeagueRequest;
import cz.muni.fi.pa165.soccermanager.entity.League;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.MappingTarget;

import java.util.List;

@Mapper
public interface LeagueMapper {

    LeagueDto map(League source);

    List<LeagueDto> map(List<League> source);

    @Mapping(target = "id", ignore = true)
    void mapOnUpdate(@MappingTarget League target, LeagueDto source);

    @Mapping(target = "id", ignore = true)
    League map(CreateLeagueRequest request);
}
