Sequence Diagram — Join Request Flow with Quota Check - bounswe/bounswe2026group11 GitHub Wiki
Sequence Diagram for Join Event Flow
-
Participant selects an event to join
The participant selects an event and initiates the join operation.
The request is sent toEventService.getEvent(eventId)to retrieve the event information. -
Event information is retrieved
EventServicereturns the selectedEventobject.
This object contains the event’s capacity and visibility (public or protected), which are required to evaluate whether the participant can join the event. -
Current participations are fetched
To verify quota availability, the system calls
ParticipationService.getParticipations(eventId).
This returns the current number of participations associated with the event. -
Quota restriction is evaluated
The system compares the current participation count with the event capacity.
If the number of participations has already reached the capacity, the event cannot accept additional participants. -
Alternative flow: join request fails due to quota restriction
If
participationCount >= capacity, the join attempt fails.
The system returns a failure response to the participant indicating that the event is full. -
Quota is available
If
participationCount < capacity, the system continues by checking the type of the event.
The next steps depend on whether the event is protected or public. -
Protected event: join request is created
If the event is protected, participants cannot directly join the event.
Instead, the system callsEventService.createJoinRequest(event, user)to create aJoinRequestfor the participant. -
Join request notification is created
After the join request is created, the system calls
NotificationService.createJoinRequestNotification(joinRequest).
This prepares a notification so that the event host can be informed about the new join request. -
Join request is returned successfully
The system returns the newly created
JoinRequestwith statusPending.
This indicates that the participant’s request has been successfully submitted but still requires host approval. -
Public event: participation is created directly
If the event is public, the participant can directly join the event without host approval.
The system callsParticipationService.createEventParticipation(event, user)to create a participation record. -
Participation status is updated
After the participation record is created, the system calls
ParticipationService.updateEventParticipation(event, user, Participated)
to update the participant’s participation status. -
Successful participation response is returned
The system returns a success response indicating that the participant has successfully joined the public event.
-
Summary of possible outcomes
The sequence diagram includes three possible outcomes:
- the join attempt fails because the event is already full,
- a
JoinRequestis successfully created for a protected event, - or a
Participationrecord is successfully created for a public event.