Implement getTariffProductForProductTypeName().
Use the type names of PERMIT_TYPE, not real indices as they can change.
This commit is contained in:
parent
7aded2b7fb
commit
c1d5ffcf3c
@ -717,6 +717,27 @@ Configuration::getTariffProductForAllKeys() const {
|
||||
return value;
|
||||
}
|
||||
|
||||
std::optional<QVector<ATBTariffProduct>>
|
||||
Configuration::getTariffProductForProductTypeName(QString const &permitTypeName) const {
|
||||
QVector<ATBTariffProduct> products;
|
||||
std::optional<QVector<ATBTariffProduct>> value;
|
||||
|
||||
products.clear();
|
||||
|
||||
for(const auto &product: this->TariffProduct) {
|
||||
ATBTariffProduct const &v = product.second;
|
||||
if (v.m_tariff_product_name == permitTypeName) {
|
||||
products.append(v);
|
||||
}
|
||||
}
|
||||
|
||||
if (products.size() > 0) {
|
||||
value = value.value_or(products);
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
std::optional<QVector<ATBTariffProduct>>
|
||||
Configuration::getTariffProductForProductId(PermitType permitType) const {
|
||||
QVector<ATBTariffProduct> products;
|
||||
|
Loading…
Reference in New Issue
Block a user