Minor: Moved

getMinimalParkingTime(), getMaximalParkingTime(), getMinimalParkingPrice()
computeWeekDaysPrice() and   computeWeekDaysDurationUnit() to Utilities
namespace.
This commit is contained in:
Gerhard Hoffmann 2023-12-12 10:53:10 +01:00
parent a95a39a557
commit c51d350618

View File

@ -266,18 +266,6 @@ double Calculator::GetCostFromDuration(Configuration* cfg,
return t.getPrice();
}
int Calculator::getMinimalParkingTime(Configuration const *cfg, PaymentMethod methodId) {
return std::max((int)cfg->PaymentOption.find(methodId)->second.pop_min_time, 0);
}
int Calculator::getMaximalParkingTime(Configuration const *cfg, PaymentMethod methodId) {
return std::max((int)cfg->PaymentOption.find(methodId)->second.pop_max_time, 0);
}
uint32_t Calculator::getMinimalParkingPrice(Configuration const *cfg, PaymentMethod methodId) {
return std::max((int)cfg->PaymentOption.find(methodId)->second.pop_min_price, 0);
}
bool Calculator::checkDurationMinutes(int minParkingTime,
int maxParkingTime,
int durationMinutes) {
@ -322,17 +310,6 @@ int Calculator::findNextWorkTimeRange(QDateTime const &dt,
return nextWorkTimeRange;
}
uint32_t Calculator::computeWeekDaysPrice(Configuration const *cfg, PaymentMethod id) const {
int pop_id = cfg->PaymentOption.find(id)->second.pop_id;
return cfg->PaymentRate.find(pop_id)->second.pra_price;
}
double Calculator::computeWeekDaysDurationUnit(Configuration const *cfg, PaymentMethod id) const {
int pop_id = cfg->PaymentOption.find(id)->second.pop_id;
int durationId = cfg->PaymentRate.find(pop_id)->second.pra_payment_unit_id;
return (double)(cfg->Duration.find(durationId)->second.pun_duration);
}
using namespace Utilities;
Ticket Calculator::private_GetCostFromDuration(Configuration const* cfg,