Skip to content

DemoCmdTTTM_FrontEnd

Vifeng edited this page Sep 20, 2024 · 1 revision

Table of contents



Overview

EventHub is a ticketing application intended for professionals in the event sector and the general public.

The main goal of EventHub is to facilitate the management and sale of tickets for events, by providing an interface for venue managers and end users. On one side, professionals can manage events, venues, sessions and prices. On the other side, the general public can view shows, make reservations and buy tickets.

This document take you thru a series of requests to test the application behavior.

Use case

A customer browsed the events, selected one and choose his seat. After all these steps he will create a ticket reservation. Then he wants to make a booking and secure his tickets for a certain time. Thus he can proceed to the payment of his booking.

Few functionality rules :

  • The booking is possible if its date is before the session event.
  • The payment is possible if the booking is still valid, indeed a booking has a expiry time which is currently hard coded in PaymentService.java.

Video

A demonstration video of these commands can be found here : https://youtu.be/hJsLGcKklNU

Create a ticket reservation

Make a reservation for the Seat of id 4 ("4B, orchestre") of the Event of id 1 ("Orange Blossom")

curl 'http://localhost:8080/api/ticketReservations' -i -X POST \
    -H 'Content-Type: application/json' \
    -d '{"ticketReservationKey":{"seatId":{"id":4,"isSeated":true,"seatNo":4,"rowNo":"B","categorySpatial":{"id":1,"name":"orchestre"},"categoryTariff":{"id":1,"name":"categorie 1","tarification":{"id":1,"basePrice":10.0,"taxeRate":0.2,"discountStudentRate":0.5,"discountSeniorRate":0.1,"discountChildRate":0.2,"discountUnemployedRate":0.3,"event":{"id":1,"name":"Orange Blossom","description":"concert rock super bien","dateStart":"05-01-2024","dateEnd":"25-02-2024","closedDay":"Lundi","imageUrl":"img/orangeBlossom.jpeg"}}},"seatStatus":{"id":2,"name":"available"},"configurationHall":{"id":1,"name":"debout","hall":{"id":1,"name":"Hall 1","capacityOfHall":300,"venue":{"id":1,"name":"Le Trianon","address":{"street":"sesame street","city":"Paris","zipcode":"75001","country":"France"},"employees":[{"id":1,"username":"username","password":"Secret1*","email":"[email protected]"}]}},"capacityOfConfiguration":120}},"sessionEventId":{"id":1,"dateAndTimeStartSessionEvent":"05-01-2026 20:00:00","durationInMinutes":90,"event":{"id":1,"name":"Orange Blossom","description":"concert rock super bien","dateStart":"05-01-2024","dateEnd":"25-02-2024","closedDay":"Lundi","imageUrl":"img/orangeBlossom.jpeg"},"configurationHall":{"id":1,"name":"debout","hall":{"id":1,"name":"Hall 1","capacityOfHall":300,"venue":{"id":1,"name":"Le Trianon","address":{"street":"sesame street","city":"Paris","zipcode":"75001","country":"France"},"employees":[{"id":1,"username":"username","password":"Secret1*","email":"[email protected]"}]}},"capacityOfConfiguration":120}}},"isBooked":false}'

the new location : http://localhost:8080/api/ticketReservations/sessionevent/1/seat/4
Notice the seatStatus changed to "available" because it's not booked yet

"seatStatus": {
            "id": 1,
            "name": "available"
          }

Create a new booking

curl 'http://localhost:8080/api/bookings/customer/2/reservationKey' -i -X POST \
    -H 'Content-Type: application/json' \
    -H 'Accept: application/json' \
    -d '{"seatId":{"id":4,"isSeated":true,"seatNo":4,"rowNo":"B","categorySpatial":{"id":1,"name":"orchestre"},"categoryTariff":{"id":1,"name":"categorie 1","tarification":{"id":1,"basePrice":10.0,"taxeRate":0.2,"discountStudentRate":0.5,"discountSeniorRate":0.1,"discountChildRate":0.2,"discountUnemployedRate":0.3,"event":{"id":1,"name":"Orange Blossom","description":"concert rock super bien","dateStart":"05-01-2024","dateEnd":"25-02-2024","closedDay":"Lundi","imageUrl":"img/orangeBlossom.jpeg"}}},"seatStatus":{"id":2,"name":"available"},"configurationHall":{"id":1,"name":"debout","hall":{"id":1,"name":"Hall 1","capacityOfHall":300,"venue":{"id":1,"name":"Le Trianon","address":{"street":"sesame street","city":"Paris","zipcode":"75001","country":"France"},"employees":[{"id":1,"username":"username","password":"Secret1*","email":"[email protected]"}]}},"capacityOfConfiguration":120}},"sessionEventId":{"id":1,"dateAndTimeStartSessionEvent":"05-01-2026 20:00:00","durationInMinutes":90,"event":{"id":1,"name":"Orange Blossom","description":"concert rock super bien","dateStart":"05-01-2024","dateEnd":"25-02-2024","closedDay":"Lundi","imageUrl":"img/orangeBlossom.jpeg"},"configurationHall":{"id":1,"name":"debout","hall":{"id":1,"name":"Hall 1","capacityOfHall":300,"venue":{"id":1,"name":"Le Trianon","address":{"street":"sesame street","city":"Paris","zipcode":"75001","country":"France"},"employees":[{"id":1,"username":"username","password":"Secret1*","email":"[email protected]"}]}},"capacityOfConfiguration":120}}}'

new location : http://localhost:8080/api/bookings/3

Notice the price of the booking

  "totalPriceHt": 10.0,

and the seat status which has changed to booked

 "seatStatus": {
            "id": 1,
            "name": "booked"
          }

Make a payment

curl 'http://localhost:8080/api/payments/booking/3' -i -X POST \
    -H 'Content-Type: application/json'

New location : http://localhost:8080/api/payments/2

notice the seat status:

"seatStatus": {
            "id": 3,
            "name": "sold"
        }

Notice the total price of the booking

    "totalPriceHt": 10.0,

and the payment status

"paymentStatus": {
    "id": 1,
    "paymentStatusName": "paid"
  }
Clone this wiki locally