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

Add "Lane" enum to Promotion #6

Merged
merged 3 commits into from
Oct 2, 2023
Merged

Add "Lane" enum to Promotion #6

merged 3 commits into from
Oct 2, 2023

Conversation

mamhoff
Copy link
Contributor

@mamhoff mamhoff commented Sep 28, 2023

This implements the "lane" concept in the simplest way I can imagine: By just adding an enum with sortable values, we can identify the order in which stacked promotions should be applied. We do not need an additional ActiveRecord model that is sortable, as we don't want to burden administrators with creating and maintaining the lanes, and three lanes should be enough.

In order to implement stacked promotions, we need some way for the user
to specify the order in which promotions run. It's really hard to
imagine a UI where all promotions are sorted, so we're opting here for a
coarse ordering via promotion "lanes". We imagine three lanes, "pre",
"post" and "default", ordered via their enum integer. The system should
first evaluate "pre" promotions, then it should evaluate "default"
promotions, and then it should evaluate "post" promotions.
Every promotion now belongs to a lane, and users can configure that lane
on the promotions form.
We need the lanes to be sorted by enum integer value, and we don't want
that to rely on the enum declaration.
@mamhoff mamhoff changed the base branch from standardrb to main September 28, 2023 14:10
Copy link
Collaborator

@davecandlescience davecandlescience left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@mamhoff mamhoff merged commit e1e71e6 into main Oct 2, 2023
@mamhoff mamhoff deleted the simple-lanes branch October 2, 2023 18:30
mamhoff added a commit that referenced this pull request Jul 1, 2024
mamhoff added a commit that referenced this pull request Oct 25, 2024
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