Populate Data API wrapper and integration #98
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 passedSite
, through the Populate Data (a.k.a. The Big Indexer) service. To do so, we're also introducing thePopulateData::Gobierto
API wrapper, which is just an abstraction to request and use resources with ease.Finally, it replaces some
TODO
s 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 thelocation_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:
And most of the form fields are auto-filled when one of the budget lines is selected.