Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plausibility check for realtime free values #220

Open
the-infinity opened this issue Nov 20, 2024 · 1 comment
Open

Plausibility check for realtime free values #220

the-infinity opened this issue Nov 20, 2024 · 1 comment

Comments

@the-infinity
Copy link
Collaborator

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:

  • 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).

@AbdullahiFatola
Copy link

@the-infinity I have a created a PR for this. Kindly review if it is as described in the ticket.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants