feat: filter out coupons associated with archived loyalty programs in fetchCoupons
This commit is contained in:
parent
047f8a0987
commit
52f7760d61
@ -155,6 +155,15 @@ patch(OrderPaymentValidation.prototype, {
|
||||
// ─── PosStore patches ─────────────────────────────────────────────────────────
|
||||
|
||||
patch(PosStore.prototype, {
|
||||
/**
|
||||
* fetchCoupons — filter out coupons/cards of archived programs.
|
||||
*/
|
||||
async fetchCoupons(domain, limit = 1) {
|
||||
const activeDomain = [["program_id.active", "=", true]];
|
||||
const newDomain = domain ? activeDomain.concat(domain) : activeDomain;
|
||||
return await super.fetchCoupons(newDomain, limit);
|
||||
},
|
||||
|
||||
/**
|
||||
* afterProcessServerData — purge orphaned lines from ALL orders after load.
|
||||
*/
|
||||
|
||||
Loading…
Reference in New Issue
Block a user