File: D:/HostingSpaces/SBogers10/kemi.komma.pro/app/KommaApp/Shop/Discounts/DiscountServiceInterface.php
<?php
namespace App\KommaApp\Shop\Discounts;
use Illuminate\Support\Collection;
/**
* Class DiscountService
*
* Can add discount to discountables
*
* @see DiscountableInterface
* @package App\KommaApp\Shop\Discounts
*/
interface DiscountServiceInterface
{
/**
* Applies discounts if needed to the Discountable given
*
* @param DiscountableInterface $discountable
* @return DiscountServiceInterface
*/
public function updateDiscounts(DiscountableInterface $discountable): DiscountServiceInterface;
/**
* Exchanges a coupon code into a discount. Returns true if the coupon code can be applied. false if not
* @param string $couponCode
* @param DiscountableInterface $discountable
*/
public function applyCouponCode(string $couponCode, DiscountableInterface $discountable): void;
/**
* Loop over a collection of DiscountModel items and insert the correct discount condition in it
*
* @param Collection $discounts
* @return Collection
*/
public function insertDiscountConditionAndActionsIfNotInsertedAlready(Collection $discounts): Collection;
}