fixes of parking service after latest change in middleware #478 #503
Labels
No labels
_CRITICAL_
API
app
backEnd
Blocked-waiting-for-further-changes
bug
bug-only-on-server-for-mobile-not-webpage
Bug-Report-After-Merge
cleanup
close
design
duplicate
enhancement
feature request
frontEnd
further-changes-needed
future-problem-not-fixint-this-period
help wanted
invalid
last-week-issue-to-fix
library
low-priority
needs input
needs review
not-implemented.
project documentation
question
research
reviewed
Script
security
SQL
style
Team 1
Team 2
team leaders
test-creation
testing
topLevel
unassigned
Under-review
wontfix
No milestone
No project
No assignees
5 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Andras/BoundlessFlowCampus2K!503
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fixes/parking-service-#478"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Changes in this pr
This is an adoption on the parking service after latest changes in the middleware.
Will manually merge this into both weekly branches once this PR passes review!
Review
Whats done
Tested on Windows using Chrome
Inspected following files
What needs to be done
Conclusion
What needs to be done
Thanks for the review I can try to answer you.
What I fixed:
*) Good catch about the spotId I missed to add the number. this is fixed now.
*) Fixes of some can be disabled, charging or reserved.
The changes that will be included later on and is not part of this pr.
Explanations:
I think later on we want to be able to click on a parking by a button and make it occupy for now it is just a mockup that simulates the behavior. We can keep the logic.
if you see this no data to upload waiting...` this is a nomal behaivor as there is no more data to upload as I said we will make it better once we know how to combine db handler and mockupapi
Nice work!
What works
What needs to be fixed
I noticed that now when the spots have numbers, they start on the number 2. Which means that spot A1, B1 does not exist. In the for loop, j starts at 1, so it should probably just be j.
@a24julot
Good catch! this was part of the what I got from the new structure.
Now it is fixed:
Great job! Everything is fixed according to me, @a24timsv will also review as he has a better understanding of the structure than I do.
Might be going on a bit of a rant here, but I just want to 100% understand what's going on.
As of right now, the dataflow of everything in the parkingApiMockup is all over the place. It looks as it is designed to simulate parking sensors that randomly change with the SpotGenerator, but it also looks as the SpotGenerator accesses some database directly, skipping MQTT entirely or going backwards in the dataflow.
If we are simulating hardware, as the tempSensor does, the dataflow is strictly:
generateMockup -> readMockup -> MQTT -> middleware -> Postgres -> Service/API -> frontend.
This flow is easy to grasp and keeps everything clean. I think that the tempSensor is a good template for doing sensors overall.
If the intent is to create a parking spot API, with the ability to set and get spots, then we are not simulating hardware anymore. I know that Andras is mentioning "an API to connect the subsystem" in #42. But I don't really know what the subsystem would even be and why it would be needed. To me, a parking service (like the one on Sandtorget) just uses sensors of some kind to count or keep track cars.
It is completely fine to create something bigger if you think that it's a better solution, but I would like some explanation of how data would flow in this kind of system. What components talk to what? What layer talks to which and how? Is there some form of model or similar?
As for
it comes down to, again, what kind of thing we are building here. But we should try to create a scope for this feature so we don't keep on expanding something all the time so it never actually completes.
@a24timsv
The data flow is not in all over places. I can explain why
We have parkingapimock map:
This handles all endpoints that gets requested by the fronted.
The endpoints are:
The reason why it connects to db when we query data is because this how it was done it sensorTemp and it is part of the security where we don't manupluate the data the we can make a query that is kind of hard coded.
ONLY insert, update and delete which is part of modifying data and is more sensitive is handled by middle-ware and this is something what we in the team mockup team have decided. I think you were in the discussion we made sure you understood.
The readBooking db handler is:
This was the second design as we tried to follow tempSensor and later on we came to conclusion that this is not optimal and we will move it to parkingApiMockup. Right now this pard db is a temporary solution as in the beginning it was not so much clear for us what and how each micro service will work. This experiment will make clearer the roomBooking and ParkingAPi
Hopefully I made it clear.
Would it be possible to get a model that shows the data flow and structure?
@a24vinla Yes we have an issue for this #308
we will update once we gather all information.
Really good review! This will be merged into the team branch.