if realtime_parking_site_input.realtime_capacity is UnsetValue and realtime_parking_site_input.realtime_free_capacity is higher then parking_site.capacity, set realtime_parking_site_input.realtime_free_capacity to parking_site.capacity and make a warning about this (eg self.logger.warn(LogMessageType.PARKING_SITE_CAPACITY, 'At {parking_site.uid} from {source.uid}, realtime_free_capacity (realtime_parking_site_input.realtime_free_capacity) was higher then capacity (parking_site.capacity).
if realtime_parking_site_input.realtime_capacity is NOT UnsetValue and realtime_parking_site_input.realtime_free_capacity is higher then realtime_parking_site_input.realtime_capacity, set realtime_parking_site_input.realtime_free_capacity to realtime_parking_site_input.realtime_capacity and make a warning about this (eg self.logger.warn(LogMessageType.PARKING_SITE_CAPACITY, 'At {parking_site.uid} from {source.uid}, realtime_free_capacity ({realtime_parking_site_input.realtime_free_capacity}) was higher then realtime_capacity ({realtime_parking_site_input.realtime_capacity}).
Same for every sub-category (realtime_capacity_woman / realtime_free_capacity_woman / capacity_woman, ... etc).
Before saving, there should be a check if realtime values are higher then the actual capacity. The check should be done here: https://github.com/ParkenDD/park-api-v3/blob/main/webapp/services/import_service/generic/generic_import_service.py#L271 .
Following checks should be done:
realtime_parking_site_input.realtime_capacity
is UnsetValue andrealtime_parking_site_input.realtime_free_capacity
is higher thenparking_site.capacity
, setrealtime_parking_site_input.realtime_free_capacity
toparking_site.capacity
and make a warning about this (egself.logger.warn(LogMessageType.PARKING_SITE_CAPACITY, 'At {parking_site.uid} from {source.uid}, realtime_free_capacity (realtime_parking_site_input.realtime_free_capacity) was higher then capacity (parking_site.capacity).
realtime_parking_site_input.realtime_capacity
is NOT UnsetValue andrealtime_parking_site_input.realtime_free_capacity
is higher thenrealtime_parking_site_input.realtime_capacity
, setrealtime_parking_site_input.realtime_free_capacity
torealtime_parking_site_input.realtime_capacity
and make a warning about this (egself.logger.warn(LogMessageType.PARKING_SITE_CAPACITY, 'At {parking_site.uid} from {source.uid}, realtime_free_capacity ({realtime_parking_site_input.realtime_free_capacity}) was higher then realtime_capacity ({realtime_parking_site_input.realtime_capacity}).
Same for every sub-category (
realtime_capacity_woman
/realtime_free_capacity_woman
/capacity_woman
, ... etc).