Admin Ticket management
In the previous section, we saw Ticket management by the customer. The customer has control over their tickets alone and can't do anything with other customers' tickets. In the admin mode, we can have control over any tickets available in the application. In this section, we'll see Ticket management done by admin.
Allowing a admin to view all tickets
As admin has full control to view all tickets in the application, we keep the view ticket method very simple in TicketServiceImpl
class without any restrictions.
Getting all tickets – service (TicketServiceImpl)
Here we will discuss about the admin implementation part to get all the tickets in the application:
@Override public List<Ticket> getAllTickets() { return tickets; }
In the preceding code, we don't have any specific restrictions and simply return all tickets from our ticket list.
Getting all tickets – API (ticket controller)
In the ticket controller API, we will add a method to get all the tickets for...