<?php

declare(strict_types=1);

namespace Australcode\Rewards\Service\Licensing;

defined( 'ABSPATH' ) || exit;

/**
 * Port to the Freemius SDK for license gating.
 *
 * The minimal contract {@see LicenseGate} needs from the Freemius SDK. It
 * isolates the rest of the plugin from the concrete SDK API (`acrwd_fs()`): the
 * gate depends on this interface, not on the global \Freemius class. This keeps
 * the gate's consumers untouched if the SDK changes and makes gating trivial to
 * test (fake the port, no SDK boot needed).
 *
 * Production implementation:
 * {@see \Australcode\Rewards\Infrastructure\Licensing\FreemiusSdkGateway}.
 */
interface FreemiusGateway {

	/**
	 * True if premium code should be available now.
	 *
	 * Maps to acrwd_fs()->can_use_premium_code() — covers active paid licenses
	 * AND trials. The central "is Pro active?" gate.
	 */
	public function can_use_premium_code(): bool;

	/**
	 * Number of sites the active license allows.
	 *
	 * null = unlimited (or no usable license). An int = finite cap. Maps to the
	 * SDK license quota (is_unlimited() ⇒ null).
	 */
	public function license_quota(): ?int;

	/**
	 * URL of the native Freemius pricing/upgrade page for this product.
	 *
	 * Maps to acrwd_fs()->get_upgrade_url(). In-admin upsell CTAs route here
	 * instead of a hardcoded admin slug — the custom License page was removed in
	 * the Freemius migration; licensing lives on the SDK's Pricing/Account pages.
	 */
	public function upgrade_url(): string;
}
