GetDurationFromCost():

Check if given price is below minimal parking price.
This commit is contained in:
Gerhard Hoffmann 2024-07-31 10:25:03 +02:00
parent e4cb992aae
commit e5629ba4fd

View File

@ -145,6 +145,14 @@ std::string Calculator::GetDurationFromCost(Configuration* cfg,
qCritical() << DBG_HEADER << " time steps:" << tsteps;
if (paymentMethodId == PaymentMethod::Degressive) {
if (static_cast<int>(cost) < cfg->getPaymentOptions(paymentOptionIndex).pop_min_price) {
// minimal price is set by GetTimeSteps()
qCritical() << DBG_HEADER << " provided price (cost):" << cost;
qCritical() << DBG_HEADER << "configured minimal price:" << cfg->getPaymentOptions(paymentOptionIndex).pop_min_price;
return CalcState::BELOW_MIN_PARKING_PRICE.toStdString();
}
if (prepaid == false) {
int const pop_id = cfg->getPaymentOptions(paymentOptionIndex).pop_id;
int const pop_accumulate_prices = cfg->getPaymentOptions(paymentOptionIndex).pop_accumulate_prices;