From 0af858daea3c0aad5a625d7d5ecc59f25fd7797b Mon Sep 17 00:00:00 2001 From: Gerhard Hoffmann Date: Tue, 30 Jan 2024 10:20:42 +0100 Subject: [PATCH] Added multimap for Customer. Using std::optional. Added member functions: QVector &getAllPaymentOptions() QVector const &getAllPaymentOptions() const std::optional> getPaymentRateForAllKeys() const std::optional> getPaymentRateForKey(int key) const std::optional> getDailyTicketsForAllKeys() const std::optional> getDailyTicketsForKey(int key) const std::optional getCustomerForType(ATBCustomer::CustomerType customerType) std::optional getWeekDayWorkTime(QTime const &time, Qt::DayOfWeek dayOfWeek) Removed: QVector const &getDailyTickets() const; --- library/include/mobilisis/configuration.h | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/library/include/mobilisis/configuration.h b/library/include/mobilisis/configuration.h index 51970b8..490eec0 100644 --- a/library/include/mobilisis/configuration.h +++ b/library/include/mobilisis/configuration.h @@ -26,6 +26,7 @@ #include "tariff_timestep_config.h" #include +#include using namespace std; using namespace rapidjson; @@ -51,6 +52,7 @@ public: multimap TimeRange; multimap TimeStepConfig; multimap TimeBase; + multimap Customer; /// /// Parse JSON string @@ -61,7 +63,14 @@ public: ATBPaymentOption &getPaymentOptions(); ATBPaymentOption const &getPaymentOptions() const; - QVector const &getDailyTickets() const; + QVector &getAllPaymentOptions(); + QVector const &getAllPaymentOptions() const; + std::optional> getPaymentRateForAllKeys() const; + std::optional> getPaymentRateForKey(int key) const; + std::optional> getDailyTicketsForAllKeys() const; + std::optional> getDailyTicketsForKey(int key) const; + std::optional getCustomerForType(ATBCustomer::CustomerType customerType); + std::optional getWeekDayWorkTime(QTime const &time, Qt::DayOfWeek dayOfWeek); private: /// @@ -71,5 +80,5 @@ private: /// MemberType IdentifyJsonMember(const char* member_name); - ATBPaymentOption currentPaymentOptions; + QVector currentPaymentOptions; };