-
Notifications
You must be signed in to change notification settings - Fork 1
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
[FEATURE] Add place building block support #476
Conversation
Hey @mihail-varbanov this is the initial PR for setting up the service for the places building block. The places building block has not yet been deployed but we can let you know when it has. Before then if you have any feedback on the code. Please let me know. Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @manav2modi,
1. I have no significant comments about the model.
1.1. I am not a fan of the json_annotation
package but I see that you are in Rokmetro. Let it be so.
1.2. My feeling is that latitude and longitude should not be nullable. Is there a case where we could have a place without a geographical location defined?
1.3. What is the idea of a UserPlace object? Just to indicate whether the current user has visited the place? Why did you decide to add such functionality? Is there any specification on this? If yes, could you place apply it in #475 definition. If not, why is this a hurry to add it while it is not clear if we need it, what exactly, etc.
1.4. Also, I wanted to point out that we would probably need to define a relation between a place and the existing objects that also represent location like Gateway Buildings (wayfinding/buildings API in Gateway BB), for example. Maybe some field like external_id
, entetity_id
would handle this case, as well as the other that could arise. I consider that this could be handled later when we face up the necessity for this.
2. Regarding the service:
2.1. If ids
, types
and tags
parameters of getAllPlaces
API are supposed to contain a number of single objects of that type (like comma separated list?), they would better be of Set<String>
type and let the API build the URL parameters properly.
2.2. You should ensure that all methods in Places service do not fire exceptions outside its APIs. Particularly Uri.parse
and Place.fromJson
are candidates to fire an expectation (and this is one of the reasons I am not a fan of json_annotation
). So please make sure you handle all exceptions that potentially could raise.
2.3. I would recommend adding List JSON serialization methods to your Place model (JSON <=> List), instead of applying the current implementation every time you need to deserialize List from JSON. In addition, if a given Place instance does not follow your types expectations (for example if appId or orgId comes as an integer value instead of String) you should omit this Place instance from the result list and let it collect the other valid Places (unlike your implementation does now).
3. In general, I think things are happening in the wrong order (in Bulgaria we say to put the cart before the horse). We should first get some spec of what is expected as a functionality in the client application, then we should design the model and the APIs in Places BB, and just after them to do what you are trying to do now. Have the first two steps been taken yet? If yes, can I get more details, specs, etc. about them?
Hey @mihail-varbanov thanks for the review! 1.2. I have made them not nullable now. 1.3. The UserPlace currently is for if the current user has visited the place. This was something that was discussed with the client and something they had showed interest in. We will be confirming with them as we go ahead and build this out. 1.4. Yep that is on the roadmap and something we plan to add. 2.1. I have made that change. 2.2. I have made that change. 2.3 I have made that change.
Thanks for your help! Let me know if you have any more comments |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @manav2modi,
Thanks for the quick update!
2.1. I have made that change.
Is there any particular reason you made these parameters List<String>
instead of Set<String>
as I suggested? Is the order of these values significant for GET /places
API?
Something else that I missed yesterday is the PlacesService
name. Could you please remove the Service
suffix from this name so that it matches the services naming convention that is currently adopted in the app?
…//github.com/rokwire/app-flutter-plugin into 475-feature-add-place-building-block-support
Closing this since it was based off the wrong branch Corrected PR - #483 |
Description
Add place building block support
Fixes #475
Review Time Estimate
Please give your idea of how soon this pull request needs to be reviewed by selecting one of the options below. This can be based on the criticality of the issue at hand and/or other relevant factors.
Type of changes
Please select a relevant option:
Checklist:
Please select all applicable options: