[PN 79] Accumulative Discount - #338
Open
MostafaKadry wants to merge 19 commits into
Open
Conversation
Implemented functionality to check if an item qualifies for active promotions based on quantity, affecting discount editing capabilities. Updated UI to reflect promotional offer statuses and adjusted related computed properties for better user experience. Enhanced backend API to support promotional checks for items.
- Introduced new fields for coupon management: apply_scope, applicable_brand, applicable_item_group, and excluded_brands. - Updated coupon validation to compute line-level discounts based on eligible items. - Enhanced the UI components for coupon application, allowing users to specify scope and exclusions. - Improved the logic for applying discounts to ensure compliance with new coupon rules. - Added functionality to revalidate applied coupons based on cart changes, ensuring accurate discount application.
…support - Introduced a new resource for calculating coupon discounts with item-level exclusions. - Updated CouponDialog to build invoice payloads for coupon validation. - Enhanced CouponManagement to include an option for excluding already discounted items. - Modified applyCoupon logic to handle new discount calculations and validations. - Added item-level discount flags and logic to ensure proper discount application in the cart. - Updated API endpoints to support new promotion types and constraints. - Enhanced test coverage for coupon and promotion functionalities, ensuring correct behavior with item-level discounts.
…iscount_support' into staging
…iscount_support' into staging
…al schemes - Introduced a new validation function to prevent duplicate promotion types for the same item across active promotional schemes. - Updated the validation logic in the Promotional Scheme to include the new check, enhancing the integrity of promotional configurations.
- Refactored coupon validation logic to utilize a new API call for reliable response parsing. - Introduced a Promotion Interaction Matrix to determine item eligibility for promotions based on various states. - Updated the coupon handling logic to exclude already discounted items and apply brand exclusions effectively. - Enhanced test coverage for coupon eligibility and interaction scenarios, ensuring accurate discount application.
Pn 79 accumulative discount
- Introduced GWP (Gift With Purchase) promotion type, allowing free items based on purchase quantities. - Updated invoice and cart logic to calculate GWP discounts accurately, ensuring correct display of free item quantities. - Enhanced promotional scheme management to include GWP-specific fields and validation. - Refactored discount calculation methods to accommodate GWP logic, ensuring seamless integration with existing discount structures. - Improved test coverage for GWP scenarios, validating correct application of promotions across various conditions.
- Introduced a dedicated method to check for GWP promotions, improving code readability and maintainability. - Updated validation and cleanup methods to utilize the new GWP check, ensuring accurate handling of promotional conditions. - Enhanced logic to correctly manage same item conditions for GWP promotions, aligning with the overall discount structure.
- Introduced functions to identify and clear offer discounts from cart items, improving the handling of promotional discounts. - Updated the logic to ensure that discounts are accurately applied or removed based on server responses and item conditions. - Refactored existing discount handling to streamline the process of clearing discounts when offers are invalidated.
…ment and validation
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.
No description provided.