package de.oaa.xxx.location.repository;

import de.oaa.xxx.location.entity.LocationEventAttendeeEntity;
import org.springframework.data.jpa.repository.JpaRepository;

import java.util.List;
import java.util.Optional;
import java.util.UUID;

public interface LocationEventAttendeeRepository extends JpaRepository<LocationEventAttendeeEntity, UUID> {

    List<LocationEventAttendeeEntity> findByEventIdOrderByRegisteredAtAsc(UUID eventId);

    Optional<LocationEventAttendeeEntity> findByEventIdAndUserId(UUID eventId, UUID userId);

    long countByEventId(UUID eventId);

    void deleteByEventId(UUID eventId);

    void deleteByUserId(UUID userId);
}
