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

Implement parking history functionality in the occupation logic #6

Closed
oxedom opened this issue May 31, 2023 · 0 comments
Closed

Implement parking history functionality in the occupation logic #6

oxedom opened this issue May 31, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@oxedom
Copy link
Owner

oxedom commented May 31, 2023

Description:
Currently, our occupation logic for parking spots does not keep track of their history. We need to implement a feature that allows us to save the parking history of a certain spot. This will enable us to track the number of cars that visited the spot in a session, calculate the percentage of time it was occupied, and determine the average parking duration.

Proposed Solution:
To implement the parking history functionality, we can introduce the following changes:

Create a data structure to store the history of each parking spot. This can be achieved by using a list or an array of objects, where each object represents a session.

Each object in the history list will contain the necessary information, including the number of cars that visited the spot in that session and the parking duration for each car.

Update the occupation logic to record the history of a parking spot. When a car leaves the spot, the current session's data (number of cars and their duration's) should be added to the history list.

To calculate the percentage of time the spot was occupied, iterate over the history list and sum up the duration's of all sessions. Divide this sum by the total available time to get the occupancy percentage.

To determine the average parking duration, iterate over the history list and calculate the average duration per session.

Additional Considerations:

Ensure that the parking history is stored persistently, either in a database or a file, so that it is not lost when the system restarts.
Provide a way to access and display the parking history information, such as through a reporting feature or an API endpoint.
Acceptance Criteria:

The occupation logic should be updated to record the parking history of each spot.
The history should include the number of cars that visited the spot in a session and the parking duration for each car.
The percentage of time the spot was occupied should be calculated correctly.
The average parking duration should be calculated accurately.
The parking history should be stored persistently and accessible for reporting purposes.

@oxedom oxedom added the enhancement New feature or request label May 31, 2023
@oxedom oxedom changed the title Implement parking history functionality in the occupation logic #1 - Implement parking history functionality in the occupation logic Jul 7, 2023
@oxedom oxedom changed the title #1 - Implement parking history functionality in the occupation logic Implement parking history functionality in the occupation logic Jul 7, 2023
oxedom added a commit that referenced this issue Jul 8, 2023
…story occupations, renamed functions to make them cleared, changed loadingscreen text' - #6
@oxedom oxedom closed this as completed Jul 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant