<?php
/**
 * Interface for discounters.
 *
 * @package flo-sync
 */

namespace NMFS\Sync\Items\Campaigns\Models;

use WC_Coupon;

defined( 'ABSPATH' ) || exit;

interface Discounter_Interface {
	/**
	 * Gets the discounter display name
	 *
	 * @return string
	 */
	public function get_name(): string;

	/**
	 * Get the WooCommerce coupon.
	 *
	 * @return WC_Coupon
	 */
	public function get_coupon(): WC_Coupon;

	/**
	 * Get the priority.
	 *
	 * @return int
	 */
	public function get_priority(): int;

	/**
	 * Checks if this discount is applicable for these products.
	 *
	 * @param float           $cart_total Cart total inc VAT.
	 * @param Product_Model[] $products   Products to check.
	 *
	 * @return bool
	 */
	public function is_applicable( float $cart_total, array $products ): bool;

	/**
	 * Get the products with discounts.
	 *
	 * @param Product_Model[] $products   Prices must be inc VAT.
	 * @param float           $cart_total Cart total inc VAT.
	 *
	 * @return Product_Model[] Updated list of products with discounts, inc VAT.
	 */
	public function get_discounted_products( array $products, float $cart_total ): array;
}
