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

[FEATURE] Add place building block support #476

Closed

Conversation

manav2modi
Copy link
Contributor

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.

  • Immediately
  • Within a week
  • When possible

Type of changes

Please select a relevant option:

  • Bug fix (non-breaking change which fixes an issue).
  • New feature (non-breaking change which adds functionality).
  • Breaking change (fix or feature that would cause existing functionality to not work as expected).
  • Other (any another change that does not fall in one of the above categories.)

Checklist:

Please select all applicable options:

  • I have signed the Rokwire Contributor License Agreement (CLA). (Any contributor who is not an employee of the University of Illinois whose official duties include contributing to the Rokwire software, or who is not paid by the Rokwire project, needs to sign the CLA before their contribution can be accepted.)
  • I have updated the CHANGELOG.
  • I have read the Contributor Guidelines.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • My change requires updating the documentation.
  • I have made necessary changes to the documentation.
  • I have added tests related to my changes.
  • My changes generate no new warnings.
  • New and existing unit tests pass locally with my changes.
  • Any dependent changes have been merged and published in downstream modules.

@manav2modi manav2modi linked an issue Sep 19, 2024 that may be closed by this pull request
@manav2modi
Copy link
Contributor Author

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!

Copy link
Collaborator

@mihail-varbanov mihail-varbanov left a 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?

@manav2modi
Copy link
Contributor Author

manav2modi commented Sep 24, 2024

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.

  1. Here is the PR for the setup of the Places building block - https://github.com/rokwire/places-building-block/pull/1 It is currently in review and should get merged soon. https://docs.google.com/document/d/1RolvPH7mbvtEKW4Z5MWh5aHe3s7snaFeA34t5p_oquk/edit - This is the documentation regarding the Places Building block

Thanks for your help! Let me know if you have any more comments

Copy link
Collaborator

@mihail-varbanov mihail-varbanov left a 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?

@manav2modi manav2modi changed the base branch from develop to support/v1.7 October 1, 2024 18:09
@manav2modi manav2modi changed the base branch from support/v1.7 to develop October 1, 2024 18:10
@manav2modi
Copy link
Contributor Author

manav2modi commented Oct 7, 2024

Closing this since it was based off the wrong branch Corrected PR - #483

@manav2modi manav2modi closed this Oct 7, 2024
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

Successfully merging this pull request may close these issues.

[FEATURE] Add place building block support
2 participants