Sequence Diagram ‐ Using a Ticket - bounswe/bounswe2026group11 GitHub Wiki
Sequence Diagram for Ticket Scanning Flow
-
Participant logs in
The participant enters credentials through the mobile application interface. The request is sent to
LoginService.login(credentials). -
Session is created
After successful authentication,
LoginServiceretrieves the user information and callsSessionService.createSession(userId). A session token is generated and returned to the mobile application together with the participant's user details. -
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.
-
Active tickets are fetched
The mobile application requests active tickets by calling
TicketService.getTickets(userId, TicketStatus.ACTIVE).TicketServicereturns the list of active tickets that belong to the participant. -
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). -
Ticket details are enriched
To prepare the ticket detail page,
TicketServicecallsEventService.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. -
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.
-
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. -
Ticket is validated
TicketServicevalidates 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. -
Participation is updated
After successful validation,
TicketServicecallsParticipationService.updateParticipation(event, user, ParticipationStatus.PARTICIPATED). This updates the participant's attendance record so that the system marks the user as having attended the event. -
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.
-
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. -
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.
-
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.