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

Populate Data API wrapper and integration #98

Merged
merged 4 commits into from
Dec 6, 2016

Conversation

danguita
Copy link
Contributor

@danguita danguita commented Dec 5, 2016

Connects to #91.

What does this PR do?

This PR introduces the BudgetLineCollectionBuilder service object, which is responsible of retrieving and building Budget line records for the passed Site, through the Populate Data (a.k.a. The Big Indexer) service. To do so, we're also introducing the PopulateData::Gobierto API wrapper, which is just an abstraction to request and use resources with ease.

Finally, it replaces some TODOs around there regarding this matter. Before today we were just fetching hardcoded data while working in this feature.

Want to mention a detail in the implementation that will probably be updated later today: Regarding the Populate Data wrapper classes, the PopulateData::Gobierto::Entity one is now taking the location_name param into account and that was not the expected behavior. We plan to just drop it after doing some maintenance on the ES indices.

How should this be manually tested?

The BudgetLineCollectionBuilder service is now taking part of the Consultation item management actions, so you can check that the select user control in properly populated in both create and update actions:

  • https://gobierto.dev/admin/budgets/consultations/<consultation_id>/items/new
  • https://gobierto.dev/admin/budgets/consultations/<consultation_id>/items/<consultation_item_id>/edit

Note that the select input has a custom option formatting, as follows:

screen shot 2016-12-05 at 5 26 36 pm

And most of the form fields are auto-filled when one of the budget lines is selected.

- This service is responsible of retrieving and building Budget line
  records through the Populate Data service by using the API wrapper
  classes.
@ferblape ferblape self-assigned this Dec 6, 2016
@ferblape
Copy link
Member

ferblape commented Dec 6, 2016

I have just updated the entity filters to use only the municipality_id. When we add request filtering in Populate data we'll be able to fetch the entities faster.

@ferblape ferblape merged commit 83c1b60 into master Dec 6, 2016
@danguita
Copy link
Contributor Author

danguita commented Dec 6, 2016

@ferblape Thanks! Let me push a couple of small adjustments to keep consistency across the API wrapper classes.

@danguita
Copy link
Contributor Author

danguita commented Dec 6, 2016

@ferblape Here you go: #104. Not a big deal at all, I'm just about to merge it.

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.

2 participants