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

[16.0] improves loyalty_partner_applicability #265

Open
wants to merge 4 commits into
base: 16.0
Choose a base branch
from

Conversation

lmignon
Copy link
Contributor

@lmignon lmignon commented Jan 27, 2025

@lmignon lmignon force-pushed the 16.0-improve-loyalty-partner-applicability branch from a73a208 to 53c040d Compare January 27, 2025 13:18
@lmignon lmignon force-pushed the 16.0-improve-loyalty-partner-applicability branch 2 times, most recently from e6217d0 to e4fb7c8 Compare February 5, 2025 07:40
@rousseldenis rousseldenis added enhancement New feature or request needs review labels Feb 5, 2025
@rousseldenis rousseldenis added this to the 16.0 milestone Feb 5, 2025
Before this commit, the partner applicability was not working according
to the addon description. For programs with multiple rules, rules defined
for specific partners were being applied to any partner as long as the
partner had a rule defined for them. The same applied to the coupon, where
a coupon defined for a specific partner could be used by any partner as long
the partner had a ruele defined for them in the same program where
the coupon was defined.

This commit fixes the issue by ensuring that the partner applicability
is only checked for the partner that the rule or coupon is defined for.
It's done by removing the rules not applicable to the the partner linked
to the sale order when the system is requesting the rules to be applied
to the products in the sale order. When a coupon is applied we also checke
if the partner is linked to the rule at the origin of the coupon. Or to
a rule linked to the loyalty card program.
…alty programs to partners

This change introduces a new mixin to allow the definition of the applicability
of a loyalty program to a partner. This mixin is used in the loyalty program model
to define the applicability of the program to partners. The mixin is also used
in the loyalty rule model to define the applicability of the rule to partners.

With this change, the applicability of a loyalty program to a partner can be
now defined at the program and rule level.
Rename rule_partners_domain to partner_domain on loyalty.rule

Since the previous implementation was not correct and defacto defined
the applicability of the rule at program level (If a rule was restricted
to a partner, all the rules of the program was available to the partner
even if the other rules where restricted to other partners), this change
add a migration script to aggreate the partner domain of the rules of the
program and set it at the program level. The new domain is the OR of the
domain of the rules of the program.
…ng loyalty programs to partners

The partner applicability of a loyalty rule can now be defined at the level of the loyalty program
in addition to the level of the loyalty rule. This commit adapts the module to this new way of
defining the partner applicability of a loyalty program when computing the domain to use for
the mass mailing of a loyalty program.
@lmignon lmignon force-pushed the 16.0-improve-loyalty-partner-applicability branch from e4fb7c8 to 956ab07 Compare February 5, 2025 08:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request needs review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[16.0] Improve partner applicability on loyalty programs
2 participants