Add private_GetCostFromDuration() and helpers

getMinimalParkingTime(), getMaximalParkingTime(), checkDurationMinutes().
This commit is contained in:
Gerhard Hoffmann 2023-11-26 19:53:29 +01:00
parent c4cec1c04b
commit c749de2bf9

View File

@ -8,6 +8,7 @@ using namespace std;
class Calculator
{
public:
/// <summary>
/// Gets duration in seconds from cost
/// </summary>
@ -44,6 +45,21 @@ private:
uint32_t GetCostFromDuration(Configuration *cfg, QDateTime const &start, quint64 durationMinutes) const;
uint32_t GetCostFromDuration(Configuration *cfg, QDateTime const &start, QDateTime const &end) const;
PaymentMethod getPaymentMethodId(Configuration const *cfg);
int getMinimalParkingTime(Configuration const *cfg, PaymentMethod methodId);
int getMaximalParkingTime(Configuration const *cfg, PaymentMethod methodId);
uint32_t private_GetCostFromDuration(Configuration const* cfg,
QDateTime const &start,
QDateTime &end,
int durationMinutes,
bool nextDay = false,
bool prepaid = false,
bool overtime = false);
bool checkDurationMinutes(bool overTime,
int minParkingTime, int maxParkingTime,
int durationMinutes);
//
uint32_t GetPriceForTimeStep(Configuration *cfg, int timeStep) const;