Website Summary Files Commits Branches @commit @diff @stats
path: root / src / EventSystem
diff options
context:
space:
mode:
Commitfc33efaf7a9ed956a1601a59d8c55ddb5b6ea4b8 (patch)
Author
 Syndamia <kamen.d.mladenov@protonmail.com>
2022-05-05 17:43:31 +0300
Committer
 Syndamia <kamen.d.mladenov@protonmail.com>
2022-05-05 17:43:31 +0300
Files62faf893f85cbf0d5b16d0769c53d04f6558c2f1 /src/EventSystem
FMI-OOP-P1_TicketSystem-fc33efaf7a9ed956a1601a59d8c55ddb5b6ea4b8.tar
FMI-OOP-P1_TicketSystem-fc33efaf7a9ed956a1601a59d8c55ddb5b6ea4b8.tar.gz
FMI-OOP-P1_TicketSystem-fc33efaf7a9ed956a1601a59d8c55ddb5b6ea4b8.zip
Parenta49328cf504ddd943254aab8769017da1cb49b2c (diff)
Autocommit at 05.05.2022 @ 17:43
3 files changed, 6 insertions, 4 deletions
-rw-r--r--src/EventSystem/EventSystem.cpp6
-rw-r--r--src/EventSystem/EventSystem.h3
-rw-r--r--src/EventSystem/StatusCodes.h1
diff --git a/src/EventSystem/EventSystem.cpp b/src/EventSystem/EventSystem.cpp
index 1a490ad..8ea368d 100644
--- a/src/EventSystem/EventSystem.cpp
+++ b/src/EventSystem/EventSystem.cpp
@@ -57,8 +57,6 @@ StatusCode EventSystem::reserveTicket(const char* name, const Date& date, const
unsigned ind = indexOfEvent(name, date);
if (ind == events.get_count())
return E_EventDoesNotExist;
- if (!events[ind].ticketIsFree(seatRow, seatColumn))
- return E_TicketIsNotFree;
return events[ind].reserveTicket(Ticket(seatRow, seatColumn), password, note);
}
@@ -71,6 +69,10 @@ StatusCode EventSystem::cancelTicketReservation(const char* name, const Date& da
return events[ind].cancelReservation(seatRow, seatColumn);
}
+StatusCode buyTicket(const char* name, const Date& date, unsigned row, unsigned seat) {
+
+}
+
List<Ticket> EventSystem::queryFreeTickets(const char* name, const Date& dt) {
unsigned ind = indexOfEvent(name, dt);
diff --git a/src/EventSystem/EventSystem.h b/src/EventSystem/EventSystem.h
index f994a4c..3fedf40 100644
--- a/src/EventSystem/EventSystem.h
+++ b/src/EventSystem/EventSystem.h
@@ -24,7 +24,8 @@ public:
StatusCode reserveTicket(const char* name, const Date& date, const char* password, const char* note, unsigned seatRow, unsigned seatColumn);
StatusCode cancelTicketReservation(const char* name, const Date& date, unsigned seatRow, unsigned seatColumn);
- StatusCode buyTicket();
+ StatusCode buyTicket(const char* name, const Date& date, unsigned row, unsigned seat);
+ StatusCode buyTicket(const char* name, const Date& date, unsigned row, unsigned seat, const char* password);
List<Ticket> queryFreeTickets(const char* name, const Date& dt);
void queryReservations(unsigned eventIndex);
diff --git a/src/EventSystem/StatusCodes.h b/src/EventSystem/StatusCodes.h
index 449a81f..841bd45 100644
--- a/src/EventSystem/StatusCodes.h
+++ b/src/EventSystem/StatusCodes.h
@@ -14,7 +14,6 @@ enum StatusCode {
E_EventWillOverlap,
E_EventDoesNotExist,
- E_TicketIsNotFree,
E_TicketAlreadyBought,
E_TicketAlreadyReserved,
E_ReservationDoesNotExist,