Website Summary Files Commits Branches @commit @diff @stats
path: root / src / EventSystem / EventSystem.h
blob: cccb7e6172d61cdb18e93ca4542e0f5782ced169 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#ifndef HEADER_EVENTSYSTEM
#define HEADER_EVENTSYSTEM

#include "../List/OrderedList.hpp"
#include "../DateTime/DateTime.h"

#include "Event.h"
#include "StatusCodes.h"

class EventSystem {
	OrderedList<Event> events;
	unsigned indSoonestUpcoming;

	void updateSoonestUpcoming();

public:
	EventSystem();
	EventSystem(const Event* events, unsigned eventCount);

	StatusCode createEvent(const Hall* hall, String name, DateTime time);
	StatusCode cancelEvent();

	StatusCode reserveTicket(unsigned eventIndex, char* note, unsigned seatRow, unsigned seatColumn);
	StatusCode cancelTicketReservation();
	StatusCode buyTicket();

	void queryUpcoming(unsigned hallIndex);
	unsigned queryFreeSeats(unsigned eventIndex);
	void queryReservations(unsigned eventIndex);
	void queryBoughtTickets(DateTime start, DateTime end, unsigned hall);
	void queryMostVisited();
	void queryInsufficientlyVisited();
	void reportReservations(unsigned eventIndex);
};

#endif