checkin for tariff02.json
This commit is contained in:
@@ -589,6 +589,15 @@ bool Configuration::ParseJson(Configuration* cfg, const char* json)
|
||||
QString const &s = QString::fromStdString(k->value.GetString());
|
||||
this->currentPaymentOptions.last().pop_product_name = s;
|
||||
}
|
||||
} else if (strcmp(inner_obj_name, "pop_use_only_upto_datetime") == 0) {
|
||||
if (k->value.IsString()) {
|
||||
QString const &s = QString::fromStdString(k->value.GetString());
|
||||
this->currentPaymentOptions.last().pop_use_only_upto_datetime = s;
|
||||
}
|
||||
} else if (strcmp(inner_obj_name, "pop_use_only_for_duration") == 0) {
|
||||
if (k->value.IsInt()) {
|
||||
this->currentPaymentOptions.last().pop_use_only_for_duration = k->value.GetInt();
|
||||
}
|
||||
} else if (strcmp(inner_obj_name, "pop_payment_method_id") == 0) {
|
||||
this->currentPaymentOptions.last().pop_payment_method_id = k->value.GetInt();
|
||||
} else if (strcmp(inner_obj_name, "pop_day_end_time") == 0) {
|
||||
@@ -719,6 +728,8 @@ bool Configuration::ParseJson(Configuration* cfg, const char* json)
|
||||
break;*/
|
||||
case MemberType::WeekDaysWorkTimeType:
|
||||
if (strcmp(inner_obj_name, "pwd_id") == 0) WeekDaysWorktime.pwd_id = k->value.GetInt();
|
||||
if (strcmp(inner_obj_name, "pwd_pop_id") == 0) WeekDaysWorktime.pwd_pop_id = k->value.GetInt();
|
||||
if (strcmp(inner_obj_name, "pwd_next_id") == 0) WeekDaysWorktime.pwd_next_id = k->value.GetInt();
|
||||
else if (strcmp(inner_obj_name, "pwd_period_week_day_id") == 0) WeekDaysWorktime.pwd_period_week_day_id = k->value.GetInt();
|
||||
else if (strcmp(inner_obj_name, "pwd_period_day_in_week_id") == 0) WeekDaysWorktime.pwd_period_day_in_week_id = k->value.GetInt();
|
||||
else if (strcmp(inner_obj_name, "pwd_time_from") == 0) WeekDaysWorktime.pwd_time_from = k->value.GetString();
|
||||
@@ -871,7 +882,7 @@ std::optional<QDateTime> Configuration::getInterpolationEnd(QDateTime const &sta
|
||||
ATBInterpolation interpolation = ipolCheck.value();
|
||||
switch (duration.pun_interpolation_id) {
|
||||
case static_cast<int>(ATBInterpolation::NO_INTERPOLATION):
|
||||
//qCritical() << "(" << __func__ << ":" << __LINE__ << ") TODO";
|
||||
qCritical() << "(" << __func__ << ":" << __LINE__ << ") NO_INTERPOLATION";
|
||||
break;
|
||||
case static_cast<int>(ATBInterpolation::STATIC_WALLCLOCK_TIME_VALUES):
|
||||
//qCritical() << "(" << __func__ << ":" << __LINE__ << ") TODO";
|
||||
@@ -1271,6 +1282,18 @@ Configuration::getDailyTicketsForKey(int key) const {
|
||||
return value;
|
||||
}
|
||||
|
||||
std::optional<ATBPaymentOption>
|
||||
Configuration::getPaymentOptionForId(int key) const {
|
||||
ATBPaymentOption option;
|
||||
std::optional<ATBPaymentOption> value;
|
||||
|
||||
for (auto[it, rangeEnd] = this->PaymentOption.equal_range(key); it != rangeEnd; ++it) {
|
||||
value = value.value_or(it->second);
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
std::optional<QVector<ATBPaymentOption>>
|
||||
Configuration::getPaymentOptionsForAllKeys() const {
|
||||
QVector<ATBPaymentOption> paymentOptions;
|
||||
@@ -1363,6 +1386,25 @@ Configuration::getCustomerForType(ATBCustomer::CustomerType customerType) {
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
std::optional<QVector<ATBWeekDaysWorktime>>
|
||||
Configuration::getAllWeekDayWorkTimes() {
|
||||
QVector<ATBWeekDaysWorktime> worktimes;
|
||||
std::optional<QVector<ATBWeekDaysWorktime>> value;
|
||||
|
||||
worktimes.clear();
|
||||
|
||||
for (std::multimap<int, ATBWeekDaysWorktime>::const_iterator it = this->WeekDaysWorktime.cbegin();
|
||||
it != this->WeekDaysWorktime.cend(); ++it) {
|
||||
worktimes.append(it->second);
|
||||
}
|
||||
|
||||
if (worktimes.size() > 0) {
|
||||
value = value.value_or(worktimes);
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
std::optional<ATBWeekDaysWorktime>
|
||||
Configuration::getWeekDayWorkTime(QTime const &time, Qt::DayOfWeek dayOfWeek) {
|
||||
ATBWeekDaysWorktime worktime;
|
||||
|
Reference in New Issue
Block a user