From b844597fd23bc57aa97e231fc90eecfd6322cecc Mon Sep 17 00:00:00 2001 From: Syndamia Date: Sat, 7 May 2022 08:28:27 +0300 Subject: Reorganized whole architecture --- src/Services/EventSystem.h | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 src/Services/EventSystem.h (limited to 'src/Services/EventSystem.h') diff --git a/src/Services/EventSystem.h b/src/Services/EventSystem.h new file mode 100644 index 0000000..4eeac61 --- /dev/null +++ b/src/Services/EventSystem.h @@ -0,0 +1,46 @@ +#ifndef HEADER_EVENTSYSTEM +#define HEADER_EVENTSYSTEM + +#include "../List/OrderedList.hpp" +#include "../Date/Date.h" + +#include "Event.h" +#include "StatusCodes.h" + +class EventSystem { + OrderedList events; + unsigned indSoonestUpcoming; + + void updateSoonestUpcoming(); + unsigned indexOfEvent(const Date& date); + unsigned indexOfEvent(const char* name, const Date& date); + +public: + EventSystem(); + EventSystem(const Event* events, unsigned eventCount); + + StatusCode createEvent(const Hall* hall, String name, Date date); + StatusCode cancelEvent(const char* name, const Date& date); + + StatusCode reserveTicket(const char* name, const Date& date, const char* password, const char* note, unsigned seatRow, unsigned seatColumn); + StatusCode reserveTicket(const char* name, const Date& date, const char* password, const char* note, const Ticket& ticket); + + StatusCode cancelTicketReservation(const char* name, const Date& date, unsigned seatRow, unsigned seatColumn); + StatusCode cancelTicketReservation(const char* name, const Date& date, const Ticket& ticket); + + StatusCode buyTicket(const char* name, const Date& date, unsigned row, unsigned seat); + StatusCode buyTicket(const char* name, const Date& date, const Ticket& ticket); + StatusCode buyTicket(const char* name, const Date& date, unsigned row, unsigned seat, const char* password); + StatusCode buyTicket(const char* name, const Date& date, const Ticket& ticket, const char* password); + + const Hall* queryEventHall(const char* name, const Date& date); + OrderedList queryTickets(const char* name, const Date& date); + OrderedList queryReservations(const char* name, const Date& date); + + void queryMostVisited(); + void queryInsufficientlyVisited(); + void reportBoughtTickets(Date start, Date end, unsigned hall); + void reportReservations(unsigned eventIndex); +}; + +#endif -- cgit v1.3.1-23-gd82d