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