- Issue created by @jsacksick
- 🇮🇱Israel jsacksick
Well the plan was described, I guess if I didn't do it at the time, it was no longer needed by the project I was working on back then.
Currently, the validation logic lives on the Giftcard redemption inline form plugin.
I'm working on a decoupled project that will rely on Commerce API for applying Giftcards (See
✨
Giftcard integration
Needs review
), but instead of "duplicating" the validation logic from the JSON API resource defined, we should, like it is done for coupons, move the validation logic to a GiftcardValidConstraint
(i.e a constraint plugin).
The "commerce_giftcards" entity reference field currently has a constraint applied to it: GiftcardOrderCurrency
, but I believe it makes more sense to replace this by a constraint plugin that performs all the checks that currently live in the inline form.
The validation should check that the GC has a non zero balance, that its currency matches the order currency and that it can be used for the order store.
Active
1.0
Code
Well the plan was described, I guess if I didn't do it at the time, it was no longer needed by the project I was working on back then.