Implement getTariffProductForProductTypeName().
Use the type names of PERMIT_TYPE, not real indices as they can change.
This commit is contained in:
		@@ -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;
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user