- RESETABLE<double> fee;
- RESETABLE<double> free;
- RESETABLE<int> traffType;
- RESETABLE<double> passiveCost;
- RESETABLE<std::string> name;
- RESETABLE<TARIFF::PERIOD> period;
+ TariffConf get(const TariffConf& defaultValue) const noexcept
+ {
+ TariffConf res;
+ res.fee = fee.value_or(defaultValue.fee);
+ res.free = free.value_or(defaultValue.free);
+ res.traffType = traffType.value_or(defaultValue.traffType);
+ res.passiveCost = passiveCost.value_or(defaultValue.passiveCost);
+ res.name = name.value_or(defaultValue.name);
+ res.period = period.value_or(defaultValue.period);
+ res.changePolicy = changePolicy.value_or(defaultValue.changePolicy);
+ res.changePolicyTimeout = changePolicyTimeout.value_or(defaultValue.changePolicyTimeout);
+ return res;
+ }
+
+ std::optional<double> fee;
+ std::optional<double> free;
+ std::optional<Tariff::TraffType> traffType;
+ std::optional<double> passiveCost;
+ std::optional<std::string> name;
+ std::optional<Tariff::Period> period;
+ std::optional<Tariff::ChangePolicy> changePolicy;
+ std::optional<time_t> changePolicyTimeout;