/**
* Gets a criteria for all permitted promotions of the provided
* sales channel context, that do require an individual code
* and have not yet been used in an order.
*
* @param list<string> $codes
*/
public function __construct( array
$codes,
string
$salesChannelId ) { $activeDateRange =
new ActiveDateRange();
parent::
__construct( MultiFilter::CONNECTION_AND,
[ new EqualsFilter('active', true
),
new EqualsFilter('promotion.salesChannels.salesChannelId',
$salesChannelId),
$activeDateRange,
new EqualsFilter('useCodes', true
),
new EqualsFilter('useIndividualCodes', true
),
new EqualsAnyFilter('promotion.individualCodes.code',
$codes),
// a payload of null means, they have not yet been redeemed