getBusinessHours(): return values with correct type.

This commit is contained in:
Gerhard Hoffmann 2024-01-31 15:10:45 +01:00
parent 25a39fdc61
commit 0b779b7846

View File

@ -405,18 +405,22 @@ uint32_t Utilities::getFirstDurationStep(Configuration const *cfg, PaymentMethod
BusinessHours Utilities::getBusinessHours(Configuration const *cfg, PaymentMethod methodId) {
int businessHours = cfg->PaymentOption.find(methodId)->second.pop_business_hours;
qCritical() << __func__ << ":" << __LINE__ << businessHours;
switch (businessHours) {
case NoRestriction_24_7: return NoRestriction_24_7;
case OnlyWorkingDays: return OnlyWorkingDays;
case OnlyWeekDays: return OnlyWeekDays;
case OnlyWeekEnd: return OnlyWeekEnd;
case OnlyOfficialHolidays: return OnlyOfficialHolidays;
case OnlySpecialDays: return OnlySpecialDays;
case OnlySchoolHolidays: return OnlySchoolHolidays;
case SpecialAndSchoolHolidays: return SpecialAndSchoolHolidays;
case OnlyOpenForBusinessDays: return OnlyOpenForBusinessDays;
case NoRestriction_24_7: return BusinessHours::NoRestriction_24_7;
case OnlyWorkingDays: return BusinessHours::OnlyWorkingDays;
case OnlyWeekDays: return BusinessHours::OnlyWeekDays;
case OnlyWeekEnd: return BusinessHours::OnlyWeekEnd;
case OnlyOfficialHolidays: return BusinessHours::OnlyOfficialHolidays;
case OnlySpecialDays: return BusinessHours::OnlySpecialDays;
case OnlySchoolHolidays: return BusinessHours::OnlySchoolHolidays;
case SpecialAndSchoolHolidays: return BusinessHours::SpecialAndSchoolHolidays;
case OnlyOpenForBusinessDays: return BusinessHours::OnlyOpenForBusinessDays;
case AllDaysWithRestrictedHours: return BusinessHours::AllDaysWithRestrictedHours;
}
return NoBusinessHoursDefined;
return BusinessHours::NoBusinessHoursDefined;
}
uint32_t Utilities::computeWeekDaysPrice(Configuration const *cfg, PaymentMethod id) {