Skip to content

[PN 79] Accumulative Discount - #338

Open
MostafaKadry wants to merge 19 commits into
developfrom
PN-79-accumulative-discount
Open

[PN 79] Accumulative Discount#338
MostafaKadry wants to merge 19 commits into
developfrom
PN-79-accumulative-discount

Conversation

@MostafaKadry

Copy link
Copy Markdown
Collaborator

No description provided.

MohamedAliSmk and others added 19 commits July 19, 2026 16:52
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.
…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.
- 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.
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