Line data Source code
1 4 : (ns matchscore.domain.event-participant.query
2 : (:require
3 : [matchscore.domain.event-participant.repository.postgres :as event-participant-postgres-repo]))
4 :
5 :
6 4 : (defn get-event-participant
7 : "Retrieves an event participant by composite key (event-id, participant-id).
8 : Returns EventParticipant map or nil."
9 : [repo event-id participant-id]
10 15 : (event-participant-postgres-repo/find-by-id repo event-id participant-id))
11 :
12 :
13 4 : (defn get-participants-by-event-id
14 : "Retrieves all participants for a given event, ordered by registered_at asc.
15 : Returns a vector of EventParticipant maps."
16 : [repo event-id]
17 4 : (event-participant-postgres-repo/find-by-event-id repo event-id))
18 :
19 :
20 4 : (defn get-participants-by-event-ids
21 : "Retrieves all participants for multiple events in one batch query.
22 : Returns a vector of EventParticipant maps."
23 : [repo event-ids]
24 8 : (event-participant-postgres-repo/find-by-event-ids repo event-ids))
25 :
26 :
27 4 : (defn get-user-participants-by-event-ids
28 : "Retrieves a user's participants across multiple events in one batch query.
29 : Returns a vector of EventParticipant maps."
30 : [repo event-ids user-id]
31 10 : (event-participant-postgres-repo/find-by-event-ids-and-user-id repo event-ids user-id))
|