HEX
Server: Microsoft-IIS/8.5
System: Windows NT YDAWBH120 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) AMD64
User: tentjecom_web (0)
PHP: 7.4.14
Disabled: NONE
Upload Files
File: D:/HostingSpaces/ASmits/kemi.nl/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;
}