Skip to content

Commit

Permalink
feat(instant_charge): Add scenarios (#903)
Browse files Browse the repository at this point in the history
* feat(instant_charge): Add scenarios

* feat(instant_charge): Add percentage scenario

---------

Co-authored-by: Romain Sempé <[email protected]>
  • Loading branch information
vincent-pochet and rsempe authored Mar 10, 2023
1 parent 890dd86 commit d291ca1
Show file tree
Hide file tree
Showing 4 changed files with 635 additions and 3 deletions.
2 changes: 0 additions & 2 deletions app/services/charges/apply_instant_charge_model_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,6 @@ def amount_excluding_event
previous_result = BaseService::Result.new
previous_result.aggregation = aggregation_result.aggregation - aggregation_result.instant_aggregation
previous_result.count = aggregation_result.count - 1

# TODO: Make it works with percentage model
previous_result.options = aggregation_result.options

charge_model.apply(charge:, aggregation_result: previous_result, properties:).amount
Expand Down
2 changes: 1 addition & 1 deletion db/schema.rb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit d291ca1

Please sign in to comment.