feat(presentation_group_keys): change cached aggregation to support presentation breakdowns#5501
Open
tiagolupepic wants to merge 14 commits into
Open
feat(presentation_group_keys): change cached aggregation to support presentation breakdowns#5501tiagolupepic wants to merge 14 commits into
tiagolupepic wants to merge 14 commits into
Conversation
…n_by from charge This commit changes the service to include the presentation_by using the presentation_group_keys_values to the filters where they'll be used later for each aggregator in order to compute the breakdowns.
- Change the CachedAggregation to store breakdowns from aggregators into model - Change fee logic to build presentation_breakdowns relations
…ociate to breakdowns result.
…d pay_in_advance_breakdowns
Also change the CachedAggregation to store the breakdowns (accumulated)
…s from CachedAggregation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This commit changes the CachedAggregation model to support presentation breakdowns
Continuing the epic to introduce the presentation_group_keys, we're changing one more piece
related to fees.
First, we're changing the model CachedAggregation to store the presentation breakdowns,
we opt in to use a single jsonb column in cached_aggregations table, we just want to store the data
and we're not going to perform any query in this column.
In order to keep it consistent, we're storing only the group related to presentation group keys,
this means, we're removing the keys that belongs to
grouped_bybefore assign to cached aggregationpresentation_breakdowns column.
This affects the
Fees::ChargeServiceandCharges::PayInAdvanceAggregationService. Inthe first service, we did a small refactor to avoid compute twice the presentation breakdowns by group_by.
Finally, we're changing the WeightedSum service to retrieve the presentation_breakdowns when
the cached aggregation is available, with this flow fixed, we're making sure the recurring billing
are consistent with other services like SumService and etc.