package dev.lions.unionflow.server.mapper.collectefonds;

import dev.lions.unionflow.server.api.dto.collectefonds.CampagneCollecteResponse;
import dev.lions.unionflow.server.entity.collectefonds.CampagneCollecte;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.MappingTarget;

@Mapper(componentModel = "cdi", builder = @org.mapstruct.Builder(disableBuilder = true))
public interface CampagneCollecteMapper {

    @Mapping(target = "organisationId", source = "organisation.id")
    CampagneCollecteResponse toDto(CampagneCollecte entity);

    @Mapping(target = "id", ignore = true)
    @Mapping(target = "dateCreation", ignore = true)
    @Mapping(target = "dateModification", ignore = true)
    @Mapping(target = "creePar", ignore = true)
    @Mapping(target = "modifiePar", ignore = true)
    @Mapping(target = "version", ignore = true)
    @Mapping(target = "actif", ignore = true)
    @Mapping(target = "organisation", ignore = true)
    @Mapping(target = "montantCollecteActuel", ignore = true)
    @Mapping(target = "nombreDonateurs", ignore = true)
    @Mapping(target = "statut", ignore = true)
    @Mapping(target = "dateOuverture", ignore = true)
    void updateEntityFromDto(CampagneCollecteResponse dto, @MappingTarget CampagneCollecte entity);
}
