737 Parking restructure re-branch #892

Merged
a24julot merged 11 commits from 737-Parking-restructure-re-branch into team_1_week_5 2026-05-12 08:23:09 +00:00
Collaborator

A restructure of the original Parking API. Now simulates the existing parking spots on campus with its special attributes (charging, disabled and reserved). The refresh time for the spot is 30 seconds as of now (can be changed in the read folder). It currently only sends data accessible to the frontend, which you find in its Wiki page. The next step is to add frontend components for the data.

A restructure of the original Parking API. Now simulates the existing parking spots on campus with its special attributes (charging, disabled and reserved). The refresh time for the spot is 30 seconds as of now (can be changed in the read folder). It currently only sends data accessible to the frontend, which you find in its [Wiki page](https://git.webug.se/Andras/BoundlessFlowCampus2K/wiki/Parking-endpoints). The next step is to add frontend components for the data.
Needed to move everything from one branch to another, thus the large commit
Added the parkingService to the entrypoint and build script (Windows)
Now the service can contact the DB and retrieve data (yippie).
Also added an endpoint that gives info on a specific spot
Now all endpoints deliver the correct data, also added an endpoint to view all available zones (for dropdown or similar)
Wrote the README and did some cleanup in SpotGenerator
Added a new endpoint that shows special spots, with the attributes charging, disabled and reserved.
Went outside (woah) and checked what all spots have for attributes.
Removed unused code and comments that are not necessary
Added parkingService components to the installation and build scripts
a24julot 2026-05-11 12:29:10 +00:00
Collaborator

The frontend api endpoints seems to be broken maybe ngnx. In the useParking.js file remove the api from the url the it should work :)

The frontend api endpoints seems to be broken ~~maybe ngnx~~. In the useParking.js file remove the api from the url the it should work :)
@ -112,2 +24,3 @@
};
var data = zones;
return Results.Json(data);
Collaborator

you don't need row 24 for creation of data variable. You can directly return Results.Json(zones)

you don't need row 24 for creation of data variable. You can directly return `Results.Json(zones)`
Author
Collaborator

Agreed, I added it mostly because other mockups was returning a data variable. I'll just return the zones instead, maybe making it easier to read.

Agreed, I added it mostly because other mockups was returning a data variable. I'll just return the zones instead, maybe making it easier to read.
a24sakma marked this conversation as resolved
@ -0,0 +18,4 @@
return result;
}
public async Task<IEnumerable<ParkingData?>> FetchZoneLatest(string zoneCode)
Collaborator

I don't think you need latest in the end of FetchZone.
For temperature and energy it makes sense because we want latest temperature or energy right. but not for parking. What do you think?

I have seen it is used everywhere if it is a lot of effort then we can skip it.

I don't think you need latest in the end of FetchZone. For temperature and energy it makes sense because we want latest temperature or energy right. but not for parking. What do you think? I have seen it is used everywhere if it is a lot of effort then we can skip it.
Author
Collaborator

The latest suffix refers to that the method returns the spot information with the latest timestamps, as updates to a spot doesn't directly delete entries in the database it needs to fetch the latest data for the representation to be "now", so to speak.

The latest suffix refers to that the method returns the spot information with the latest timestamps, as updates to a spot doesn't directly delete entries in the database it needs to fetch the latest data for the representation to be "now", so to speak.
a24sakma marked this conversation as resolved
Collaborator

What works:

  • interfaces
  • endpoints
  • services
  • nginx

What needs to be changed:

  • check the above comments
  • update useParking url.
# What works: - interfaces - endpoints - services - nginx # What needs to be changed: - check the above comments - update useParking url.
Fixed the API_URL so the frontend doesn't break
Removed redundant variable
Collaborator

Nice, it is ready to merge.

Nice, it is ready to merge.
a24julot merged commit 8e8e072df3 into team_1_week_5 2026-05-12 08:23:09 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Andras/BoundlessFlowCampus2K!892
No description provided.