There are some open issues unde this:
- #2857372: Create backreference field for promotion on coupons
- #2857374: Extend Promotion entity class with method for Coupons
- #2855838: Deleting a promotion does not delete its coupons

And, as Bojan suggested, it's best to have one PR for this.
It also helps with some possible conflicts for code and updates needed.

p.s. I will add them as child issues for this

Comments

vasike created an issue. See original summary.

vasike’s picture

Status: Active » Needs review

PR available with solution for the child issues
https://github.com/drupalcommerce/commerce/pull/660

Extra: it seems the CouponsFieldPostUpdateTest was broken
https://github.com/drupalcommerce/commerce/pull/660/commits/3bc2de5d17e2...
Extra commit there so maybe we could get a green for PR.

bojanz’s picture

Title: Complete Promotion Coupons reference "system" » Complete the coupon <-> promotion data model
Category: Plan » Task

Dunno if this is a better title, but let's try it.

  • bojanz committed 4aaf1d7 on 8.x-2.x authored by vasike
    Issue #2857560 by vasike, bojanz: Complete the coupon <-> promotion data...
bojanz’s picture

Status: Needs review » Fixed

Thanks! After discussing with mglaman we agreed to remove the getCouponsCodes() and hasCouponCode() methods. Other small tweaks were applied.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.