Sequence Diagram — Join Request Flow with Quota Check - bounswe/bounswe2026group11 GitHub Wiki

Sequence Diagram for Join Event Flow

  1. Participant selects an event to join

    The participant selects an event and initiates the join operation.
    The request is sent to EventService.getEvent(eventId) to retrieve the event information.

  2. Event information is retrieved

    EventService returns the selected Event object.
    This object contains the event’s capacity and visibility (public or protected), which are required to evaluate whether the participant can join the event.

  3. 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.

  4. 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.

  5. 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.

  6. 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.

  7. Protected event: join request is created

    If the event is protected, participants cannot directly join the event.
    Instead, the system calls EventService.createJoinRequest(event, user) to create a JoinRequest for the participant.

  8. 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.

  9. Join request is returned successfully

    The system returns the newly created JoinRequest with status Pending.
    This indicates that the participant’s request has been successfully submitted but still requires host approval.

  10. Public event: participation is created directly

    If the event is public, the participant can directly join the event without host approval.
    The system calls ParticipationService.createEventParticipation(event, user) to create a participation record.

  11. 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.

  12. Successful participation response is returned

    The system returns a success response indicating that the participant has successfully joined the public event.

  13. Summary of possible outcomes

    The sequence diagram includes three possible outcomes:

    • the join attempt fails because the event is already full,
    • a JoinRequest is successfully created for a protected event,
    • or a Participation record is successfully created for a public event.