Add and implement utilities:
int getMinimalParkingTime(Configuration const *cfg, PaymentMethod methodId); int getMaximalParkingTime(Configuration const *cfg, PaymentMethod methodId); uint32_t getMinimalParkingPrice(Configuration const *cfg, PaymentMethod methodId); uint32_t getFirstDurationStep(Configuration const *cfg, PaymentMethod methodId);
This commit is contained in:
parent
56e2843ddb
commit
5b8d9c62cc
@ -82,4 +82,9 @@ namespace Utilities {
|
||||
bool isCarryOverSet(Configuration const *cfg, PaymentMethod paymentMethodId);
|
||||
bool isCarryOverNotSet(Configuration const *cfg, PaymentMethod paymentMethodId);
|
||||
PaymentMethod getPaymentMethodId(Configuration const *cfg);
|
||||
|
||||
int getMinimalParkingTime(Configuration const *cfg, PaymentMethod methodId);
|
||||
int getMaximalParkingTime(Configuration const *cfg, PaymentMethod methodId);
|
||||
uint32_t getMinimalParkingPrice(Configuration const *cfg, PaymentMethod methodId);
|
||||
uint32_t getFirstDurationStep(Configuration const *cfg, PaymentMethod methodId);
|
||||
}
|
||||
|
@ -373,3 +373,21 @@ PaymentMethod Utilities::getPaymentMethodId(Configuration const *cfg) {
|
||||
|
||||
return PaymentMethod::Undefined;
|
||||
}
|
||||
|
||||
int Utilities::getMinimalParkingTime(Configuration const *cfg, PaymentMethod methodId) {
|
||||
return std::max((int)cfg->PaymentOption.find(methodId)->second.pop_min_time, 0);
|
||||
}
|
||||
|
||||
int Utilities::getMaximalParkingTime(Configuration const *cfg, PaymentMethod methodId) {
|
||||
return std::max((int)cfg->PaymentOption.find(methodId)->second.pop_max_time, 0);
|
||||
}
|
||||
|
||||
uint32_t Utilities::getMinimalParkingPrice(Configuration const *cfg, PaymentMethod methodId) {
|
||||
return std::max((int)cfg->PaymentOption.find(methodId)->second.pop_min_price, 0);
|
||||
}
|
||||
|
||||
uint32_t Utilities::getFirstDurationStep(Configuration const *cfg, PaymentMethod methodId) {
|
||||
int popId = cfg->PaymentOption.find(methodId)->second.pop_id;
|
||||
int punId = cfg->PaymentRate.find(popId)->second.pra_payment_unit_id;
|
||||
return cfg->Duration.find(punId)->second.pun_id;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user