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

import cz.muni.fi.pa165.soccermanager.dto.ChampionshipDto;
import cz.muni.fi.pa165.soccermanager.dto.request.CreateChampionshipRequest;
import cz.muni.fi.pa165.soccermanager.entity.Championship;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.MappingTarget;

@Mapper
public interface ChampionshipMapper {

    ChampionshipDto map(Championship championship);

    @Mapping(target = "id", ignore = true)
    Championship map(CreateChampionshipRequest request);

    @Mapping(target = "id", ignore = true)
    void mapOnUpdate(@MappingTarget Championship target, ChampionshipDto source);
}
