Skip to content

feat(presentation_group_keys): change cached aggregation to support presentation breakdowns#5501

Open
tiagolupepic wants to merge 14 commits into
mainfrom
feat/change-cached-aggregation-to-support-breakdowns
Open

feat(presentation_group_keys): change cached aggregation to support presentation breakdowns#5501
tiagolupepic wants to merge 14 commits into
mainfrom
feat/change-cached-aggregation-to-support-breakdowns

Conversation

@tiagolupepic
Copy link
Copy Markdown
Contributor

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_by before assign to cached aggregation
presentation_breakdowns column.
This affects the Fees::ChargeService and Charges::PayInAdvanceAggregationService. In
the 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.

…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
Also change the CachedAggregation to store the breakdowns (accumulated)
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.

1 participant