Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve complex rule conditions calculations #4668

Merged

Conversation

poulch
Copy link
Member

@poulch poulch commented Feb 9, 2024

What type of PR is this?

  • 💅 Refactor
  • 🌟 Feature
  • 🔥 Bug Fix
  • 🔩 Maintenance
  • 🛠 Workflow CI/CD changes

Related Issues or Documents

  • closes #

Usage Instructions, Screenshots, Recordings

Have you written tests?

  • Yes!
  • No... here is why: Writing tests are mandatory, please replace this text with why test are not included in this PR

[Optional] Description

@poulch poulch requested a review from a team as a code owner February 9, 2024 13:03
@poulch poulch requested review from andrzejewsky and Droniu and removed request for a team February 9, 2024 13:03
Copy link

changeset-bot bot commented Feb 9, 2024

⚠️ No Changeset found

Latest commit: 53b541d

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@poulch poulch merged commit 6a9879e into 4645-suppoer-order-api Feb 9, 2024
13 of 14 checks passed
@poulch poulch deleted the 4645-improve-complex-conditions-calculations branch February 9, 2024 13:33
poulch added a commit that referenced this pull request Feb 9, 2024
* 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>
@poulch poulch restored the 4645-improve-complex-conditions-calculations branch July 1, 2024 11:27
@poulch poulch deleted the 4645-improve-complex-conditions-calculations branch July 1, 2024 11:31
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.

2 participants