Website Summary Files Commits Branches @commit @diff @stats
path: root / src / Services / EventService.cpp
diff options
context:
space:
mode:
Commitd570684aeffc41bd60ed09290f412cd923d346bc (patch)
Author
 Syndamia <kamen.d.mladenov@protonmail.com>
2022-05-07 14:38:14 +0300
Committer
 Syndamia <kamen.d.mladenov@protonmail.com>
2022-05-07 14:38:14 +0300
Files7e1892b65c6c78d6a73ec788bbc2ab3cc9f0158d /src/Services/EventService.cpp
FMI-OOP-P1_TicketSystem-d570684aeffc41bd60ed09290f412cd923d346bc.tar
FMI-OOP-P1_TicketSystem-d570684aeffc41bd60ed09290f412cd923d346bc.tar.gz
FMI-OOP-P1_TicketSystem-d570684aeffc41bd60ed09290f412cd923d346bc.zip
Parent5f698bc932d117abca4b23209b57d3c40d3b3696 (diff)
Autocommit at 07.05.2022 @ 14:38
1 files changed, 4 insertions, 2 deletions
-rw-r--r--src/Services/EventService.cpp6
diff --git a/src/Services/EventService.cpp b/src/Services/EventService.cpp
index 960f7cb..3eec0b5 100644
--- a/src/Services/EventService.cpp
+++ b/src/Services/EventService.cpp
@@ -104,10 +104,10 @@ StatusCode EventService::ticketIsReserved(const char* name, const Date& date, co
}
StatusCode EventService::buyTicket(const char* name, const Date& date, const Ticket& ticket) {
- return buyTicket(name, date, ticket, nullptr);
+ return buyTicket(name, date, ticket, nullptr, nullptr);
}
-StatusCode EventService::buyTicket(const char* name, const Date& date, const Ticket& ticket, const char* password, char** reservationNoteOutput) {
+StatusCode EventService::buyTicket(const char* name, const Date& date, const Ticket& ticket, const char* password, String* reservationNoteOutput) {
unsigned eInd = indexOfEvent(name, date);
if (eInd == events.get_count())
return E_EventDoesNotExist;
@@ -123,6 +123,8 @@ StatusCode EventService::buyTicket(const char* name, const Date& date, const Tic
if (!correctReservationPassword(events[eInd].get_reservations()[rInd], password))
return E_WrongReservationPassword;
+ if (reservationNoteOutput != nullptr)
+ *reservationNoteOutput = events[eInd].get_reservations()[rInd].get_note();
events[eInd].get_reservations().removeAt(rInd);
}