Sylius/Sylius — pull request #692 by winzou (2013-12-06 09:57:43+00:00)
Title: [Promotion] [WIP] Add revert mechanism to promotion actions

Ref #674

Reverting is OK.

I don't really know how to handle the `$order->removePromotionAdjustments();` in `OrderPromotionListener` (https://github.com/Sylius/Sylius/blob/master/src/Sylius/Bundle/CoreBundle/EventListener/OrderPromotionListener.php#L77). For sure it has nothing to do here, but what logic do we want?

#### Case 1
We always revert promotion before applying them:

foreach ($this->repository->findActive() as $promotion) {
$this->applicator->revert($subject, $promotion);
if ($this->checker->isEligible($subject, $promotion)) {
$this->applicator->apply($subject, $promotion);
}
}

#### Case 2
We let Actions take care of it, they can internally call their `revert` method from their `apply` method. It's their responsability to keep themselves up to date.

I'm in favor of case 2, as it let the Action do all the job (if already up to date, do nothing), instead of systematically revert and add again their promotion.