Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for order promotion API (#4648)
* Update schema * Add checkout option to add button submenu * Update rules * Refactor Condition * Split model to order and catalog * Prepare context * Store condtion type * Support multiple inputs depend on condition type * handleOpenModal * Use rule union * Fix create object from static methods * Fix add new rule * Refactor model * Use BaseRule type in form * Update schema and support field with new names * Filter AddButton submenu by discount type * Filter add button options by discount type * Fix showing conditions * Show saved conditions * Fix catalog conditions * Show base rule summary for order rules * Bump macaw to fix select onChange prop * Use Rule interface, add OrderRule tests * Refactor types * Refactor model * Update scheme, add type to promotion query * Handle discount type field * Bump macaw * Handle range input * Fix order rule label on list * Improve rule summary * Show option label in summary instead of value * Rename models * Refactor rule summary * Refactor rule summary * Comment useEnrichConditions, fix validation schema * Rename hooks, fix tests * Model refactor * Fix ts issues * Fix tests * Refactor to condition value * Fix tests * Remove hooks from context * Keep hooks close to components * Pass RuleForm as child * Last improvments * Refactor rule model * Add changeset * Add discount type component * Add type to initial form values * Bump macaw * Refactor Add button * Update test * Refactor DiscountRule isLoaded * Add type support * Remve useeffect * Add changeset * Extract messages * Init context * Context intro * Remove empty import * Fix tests, fix useDiscountRulesContext imports * Add changeset * Support mutliple condition types * Update label map after rule add * Add sorting * Extract messages * Add changeset * Refactor RuleList * Refactor rule summary to support order conditions * Update test * Add changeset * Update schema * Changeset add * Add test to order rule, update catalog rule test, add test ids * Allow to change discount type at create page * Update types * Refactor useConditionNames * Handle complex condition in promotion rule (#4667) * Update schema with gifts * Improve complex rule conditions calculations (#4668) * Update src/discounts/models/helpers.test.ts Co-authored-by: Renata <renata.gajzlerowicz@gmail.com> --------- Co-authored-by: Renata <renata.gajzlerowicz@gmail.com>
- Loading branch information