Skip to content

Optimize application retrival API wrt Numbers #2517

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

Closed
otsakir opened this issue Sep 25, 2017 · 3 comments
Closed

Optimize application retrival API wrt Numbers #2517

otsakir opened this issue Sep 25, 2017 · 3 comments
Assignees
Labels

Comments

@otsakir
Copy link
Contributor

otsakir commented Sep 25, 2017

Being able to produce application-centric listings that also include Incoming Number information is not easily done. One can retrieve application IDs when retrieving Numbers but when retrieving applications the bound Number SID is not part of the response. Even retrieving a number-by-application-id is not possible.

Here are some solutions i can think of:

  1. Include 'Number SID' in the Application API response. It will add a little complexity in the data layer and require a join between IncomingPhoneNumbers and Applications at DB layer.
  2. Improve IncomingPhoneNumbers API search capabilities by being able to return numbers for a specific set of applications SIDs. So the request will contain an array of Applications SIDs and only the numbers that are bound to these apps will be returned. The downside here seems to be that we can't use a GET method to send an array in the body. So, we either switch the method to POST and break our REST semantics or we pass the data in the GET query and have size limitations.

These are just some thoughts. We probably need a design document here and some thining from the core team.

@gvagenas
Copy link
Contributor

gvagenas commented Sep 26, 2017

Orestis,

There is one-to-many relationship between Applications and Numbers.
So the 1st option will not work since there might be several Numbers that use the same Application and thus we cannot have Number SID in the Application API response. Instead we could have Number SIDs {plural} but this doesn't seem to me like a clean way (but its doable)

Related to your option (2), since you need to be able to produce an application-centric listing as you mention, a proper solution would be to have Application API to make a join between the Application and Numbers to get the list of Numbers that use the application so your list would be:

Application SidA - Number SidA
Application SidA - Number SidB
Application SidA - Number SidC
Application SidA - Number SidD

Wouldn't that work?

@otsakir
Copy link
Contributor Author

otsakir commented Sep 27, 2017

@gvagenas , i think what you suggest would work great. I can create a design document for core team to review and let you know.

Is this ok with you ?

@gvagenas
Copy link
Contributor

Sure go ahead @otsakir

@otsakir otsakir self-assigned this Oct 2, 2017
otsakir added a commit that referenced this issue Oct 6, 2017
- Updated Application entity
- Provided integration test
- Some work on ApplicationDao layer

Refers #2517
otsakir added a commit that referenced this issue Oct 6, 2017
Also updated application.xml in all places in codebase

Refers #2517
otsakir added a commit that referenced this issue Oct 6, 2017
- Added entity, converter and updated related components
- Added unit test for converter

Refers #2517
otsakir added a commit that referenced this issue Oct 6, 2017
otsakir added a commit that referenced this issue Oct 9, 2017
… date_created.

Also simplified getApplications() interface.

Refers #2517, PR #2550
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants