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

Promotion advertiser #5739

Merged
merged 4 commits into from
May 3, 2024
Merged

Conversation

mamhoff
Copy link
Contributor

@mamhoff mamhoff commented May 2, 2024

Summary

This creates an extension point for advertising promotions, akin to Spree::Product#possible_promotions method.

It implements both the current implementation and a Null advertiser, so that we can move the current implementation to solidus_legacy_promotions.

Checklist

Check out our PR guidelines for more details.

The following are mandatory for all PRs:

The following are not always needed:

  • 📖 I have updated the README to account for my changes.
  • 📑 I have documented new code with YARD.
  • 🛣️ I have opened a PR to update the guides.
  • ✅ I have added automated tests to cover my changes.
  • 📸 I have attached screenshots to demo visual changes.

mamhoff added 2 commits May 2, 2024 16:55
This adds a configurable promotion advertiser that is supposed to make
the code in Spree::Product#possible_promotions not depend on the
presence of the current promotion system.
This creates a promotion advertiser class that fulfills the API of the
current promotion advertiser and can be used when there's no promotion
system configured.
@mamhoff mamhoff requested a review from a team as a code owner May 2, 2024 14:58
@github-actions github-actions bot added the changelog:solidus_core Changes to the solidus_core gem label May 2, 2024
Copy link

codecov bot commented May 2, 2024

Codecov Report

Attention: Patch coverage is 91.66667% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 88.84%. Comparing base (f2c12f6) to head (ef46ab1).
Report is 3 commits behind head on main.

Files Patch % Lines
core/app/models/spree/null_promotion_advertiser.rb 75.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5739   +/-   ##
=======================================
  Coverage   88.84%   88.84%           
=======================================
  Files         704      706    +2     
  Lines       16762    16772   +10     
=======================================
+ Hits        14892    14901    +9     
- Misses       1870     1871    +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@tvdeyen tvdeyen left a comment

Choose a reason for hiding this comment

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

Great work. Just a small typo

core/lib/spree/core/promotion_configuration.rb Outdated Show resolved Hide resolved
mamhoff added 2 commits May 3, 2024 09:55
This allows us to switch out the promotion advertiser.
This removes some promotion-system dependent code from the
Spree::Product class.
@mamhoff mamhoff force-pushed the promotion-advertiser branch from 02d3646 to ef46ab1 Compare May 3, 2024 07:55
mamhoff added a commit to friendlycart/solidus_friendly_promotions that referenced this pull request May 3, 2024
This is to create the API needed for fulfilling the contract described
in solidusio/solidus#5739.
mamhoff added a commit to friendlycart/solidus_friendly_promotions that referenced this pull request May 3, 2024
Again, this is to fulfil the API requirements specified in
solidusio/solidus#5739.
Copy link
Member

@kennyadsl kennyadsl left a comment

Choose a reason for hiding this comment

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

Solid work, as always. Thanks Martin!

@kennyadsl kennyadsl merged commit 5e44217 into solidusio:main May 3, 2024
14 checks passed
mamhoff added a commit to friendlycart/solidus_friendly_promotions that referenced this pull request Jul 1, 2024
This is to create the API needed for fulfilling the contract described
in solidusio/solidus#5739.
mamhoff added a commit to friendlycart/solidus_friendly_promotions that referenced this pull request Jul 1, 2024
Again, this is to fulfil the API requirements specified in
solidusio/solidus#5739.
mamhoff added a commit to mamhoff/solidus that referenced this pull request Jul 1, 2024
This is to create the API needed for fulfilling the contract described
in solidusio#5739.
mamhoff added a commit to mamhoff/solidus that referenced this pull request Jul 1, 2024
Again, this is to fulfil the API requirements specified in
solidusio#5739.
mamhoff added a commit to friendlycart/solidus_friendly_promotions that referenced this pull request Oct 25, 2024
This is to create the API needed for fulfilling the contract described
in solidusio/solidus#5739.
mamhoff added a commit to friendlycart/solidus_friendly_promotions that referenced this pull request Oct 25, 2024
Again, this is to fulfil the API requirements specified in
solidusio/solidus#5739.
mamhoff added a commit to friendlycart/solidus_friendly_promotions that referenced this pull request Oct 25, 2024
This is to create the API needed for fulfilling the contract described
in solidusio/solidus#5739.
mamhoff added a commit to friendlycart/solidus_friendly_promotions that referenced this pull request Oct 25, 2024
Again, this is to fulfil the API requirements specified in
solidusio/solidus#5739.
mamhoff added a commit to mamhoff/solidus that referenced this pull request Oct 25, 2024
This is to create the API needed for fulfilling the contract described
in solidusio#5739.
mamhoff added a commit to mamhoff/solidus that referenced this pull request Oct 25, 2024
Again, this is to fulfil the API requirements specified in
solidusio#5739.
mamhoff added a commit to mamhoff/solidus that referenced this pull request Oct 25, 2024
This is to create the API needed for fulfilling the contract described
in solidusio#5739.
mamhoff added a commit to mamhoff/solidus that referenced this pull request Oct 25, 2024
Again, this is to fulfil the API requirements specified in
solidusio#5739.
Astr0surf3r pushed a commit to Astr0surf3r/solidus that referenced this pull request Nov 14, 2024
This is to create the API needed for fulfilling the contract described
in solidusio#5739.
Astr0surf3r pushed a commit to Astr0surf3r/solidus that referenced this pull request Nov 14, 2024
Again, this is to fulfil the API requirements specified in
solidusio#5739.
Astr0surf3r pushed a commit to Astr0surf3r/solidus that referenced this pull request Nov 14, 2024
This is to create the API needed for fulfilling the contract described
in solidusio#5739.
Astr0surf3r pushed a commit to Astr0surf3r/solidus that referenced this pull request Nov 14, 2024
Again, this is to fulfil the API requirements specified in
solidusio#5739.
Astr0surf3r pushed a commit to Astr0surf3r/solidus that referenced this pull request Nov 19, 2024
This is to create the API needed for fulfilling the contract described
in solidusio#5739.
Astr0surf3r pushed a commit to Astr0surf3r/solidus that referenced this pull request Nov 19, 2024
Again, this is to fulfil the API requirements specified in
solidusio#5739.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog:solidus_core Changes to the solidus_core gem
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants