Skip to content

Comments

Promotion re-evaluation for line_item CRUD#478

Open
arjun289 wants to merge 1 commit intodevelopfrom
promo-order-eval
Open

Promotion re-evaluation for line_item CRUD#478
arjun289 wants to merge 1 commit intodevelopfrom
promo-order-eval

Conversation

@arjun289
Copy link
Collaborator

@arjun289 arjun289 commented Feb 19, 2019

Why?

If an order has promotion applied to it, then if any of the line items
are touched(updated, removed) or a new line item is added, promotion
associated with it needs to be re-evaluated so that right adjustments
are present for the order.

This change addresses the need by:

This change

  • Adds a module to handle promotion re-evaluation whenever line items
    of an order are added, removed or updated.
  • The ineligible adjustments for an order are now removed so that
    only eligible adjustments are present.
    [delivers #163001984]

Checklist

  • I have read CONTRIBUTING.md.
  • My code follows the style guidelines of this project.
  • I have commented my code, particularly in hard-to-understand areas.
  • My code does not generate any (new) credo and compile-time warnings.
  • I have updated the documentation wherever necessary.
  • I have added tests to cover my changes.

@codecov
Copy link

codecov bot commented Feb 19, 2019

Codecov Report

Merging #478 into develop will increase coverage by 0.54%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #478      +/-   ##
===========================================
+ Coverage    79.87%   80.41%   +0.54%     
===========================================
  Files          176      177       +1     
  Lines         2216     2242      +26     
===========================================
+ Hits          1770     1803      +33     
+ Misses         446      439       -7
Impacted Files Coverage Δ
...lib/core/data/model/promotion/order_eligibility.ex 100% <ø> (ø) ⬆️
apps/snitch_core/lib/core/data/model/order.ex 73.68% <ø> (+15.78%) ⬆️
apps/snitch_core/lib/core/data/model/line_item.ex 87.5% <ø> (ø) ⬆️
apps/snitch_core/lib/core/domain/promotion/cart.ex 100% <100%> (ø)
...core/data/model/adjustment/promotion_adjustment.ex 97.82% <100%> (+0.04%) ⬆️
...ch_core/lib/core/data/model/promotion/promotion.ex 90.47% <100%> (+7.54%) ⬆️
..._core/lib/core/data/model/general_configuration.ex 63.63% <0%> (-9.1%) ⬇️
apps/snitch_core/lib/core/data/schema/order.ex 100% <0%> (+13.33%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d33176c...f024b0c. Read the comment docs.

If an order has promotion applied to it, then if any of the line items
are touched(updated, removed) or a new line item is added, promotion
associated with it needs to be re-evaluated so that right adjustments
are present for the order.

This change
- Adds a module to handle promotion re-evaluation whenever line items
  of an order are added, removed or updated.
- The ineligible adjustments for an order are now removed so that
  only eligible adjustments are present.
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