Sequence Diagram ‐ Using a Ticket - bounswe/bounswe2026group11 GitHub Wiki

Sequence Diagram for Ticket Scanning Flow

  1. Participant logs in

    The participant enters credentials through the mobile application interface. The request is sent to LoginService.login(credentials).

  2. Session is created

    After successful authentication, LoginService retrieves the user information and calls SessionService.createSession(userId). A session token is generated and returned to the mobile application together with the participant's user details.

  3. Participant opens the profile page

    After landing on the main page, the participant navigates to the profile page and selects the My Tickets section to view currently active tickets.

  4. Active tickets are fetched

    The mobile application requests active tickets by calling TicketService.getTickets(userId, TicketStatus.ACTIVE). TicketService returns the list of active tickets that belong to the participant.

  5. Participant selects a ticket

    The participant taps on the relevant ticket from the list. The mobile application then requests detailed ticket information through TicketService.getTicketDetails(ticketId).

  6. Ticket details are enriched

    To prepare the ticket detail page, TicketService calls EventService.getEvent(eventId) and retrieves the related event information. Using the ticket and event data, the service creates the ticket detail response, including the QR code that will be scanned by the host.

  7. QR code is displayed

    The mobile application shows the ticket detail page with the generated QR code on the screen. At this point, the participant is ready to present the QR code at the event entrance.

  8. Host initiates scanning

    The host opens the event page and presses the scan button. The scanned QR payload is sent to TicketService.scanTicket(QR) for validation and processing.

  9. Ticket is validated

    TicketService validates whether the QR code is authentic, still active, and belongs to a valid ticket. If the QR code is valid, the ticket is accepted for event participation.

  10. Participation is updated

    After successful validation, TicketService calls ParticipationService.updateParticipation(event, user, ParticipationStatus.PARTICIPATED). This updates the participant's attendance record so that the system marks the user as having attended the event.

  11. Successful scan response is returned

    Once participation is updated, the system returns a successful scan response to the mobile application. The host sees a confirmation message indicating that the ticket has been scanned successfully.

  12. Ticket status is polled

    After the scan, the mobile application periodically calls TicketService.getTicketStatus(ticketId) to detect status changes. According to the diagram, this polling happens every 3 seconds.

  13. UI is updated

    When the new ticket status is returned, the mobile application updates the ticket information on the screen. The participant sees that the ticket has been successfully scanned and is no longer unused.

  14. Alternative flow: invalid or expired QR

    If the QR code is invalid or expired, validation fails inside TicketService. In this case, the system returns an error response and the host is informed that the QR code cannot be accepted.