<?php
/**
 * Free product reward type implementation.
 *
 * Lite version: Provides only presentation/UI methods.
 * Full functionality (issue, claim, redeem) is available in Pro version.
 *
 * @package Awesomemotive\Rewardswp\RewardTypes
 * @since 1.0.0
 */

namespace Awesomemotive\Rewardswp\RewardTypes;

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

use Awesomemotive\Rewardswp\Abstracts\AbstractRewardType;

/**
 * Free Product Reward Type
 *
 * This is the Lite version that provides only presentation methods.
 * The Pro version (ProFreeProductRewardType) extends this class
 * and adds full coupon functionality via traits.
 *
 * @since 1.0.0
 */
class FreeProductRewardType extends AbstractRewardType {
	/**
	 * Get reward type slug.
	 *
	 * @since 1.0.0
	 *
	 * @return string
	 */
	public function get_type(): string {
		return 'free_product';
	}

	/**
	 * Get admin title.
	 *
	 * @since 1.0.0
	 *
	 * @return string
	 */
	public function get_admin_title(): string {
		return __( 'Free product', 'rewardswp' );
	}

	/**
	 * Get panel title.
	 *
	 * @since 1.0.0
	 *
	 * @return string
	 */
	public function get_panel_title(): string {
		return __( 'Free product coupon', 'rewardswp' );
	}

	/**
	 * Get panel instructions.
	 *
	 * @since 1.0.0
	 *
	 * @return string
	 */
	public function get_panel_instructions(): string {
		return '';
	}

	/**
	 * Get icon name.
	 *
	 * @since 1.0.0
	 *
	 * @return string
	 */
	public function get_icon_name(): string {
		return 'reward-free-product';
	}

	/**
	 * Get supported integrations.
	 *
	 * @since 1.0.0
	 *
	 * @return array
	 */
	public function available_for(): array {
		return [ 'woocommerce', 'easy_digital_downloads' ];
	}

	/**
	 * Get default configuration.
	 *
	 * @since 1.0.0
	 *
	 * @return array
	 */
	public function get_defaults(): array {
		return [
			'reward_expiration' => '+3 months',
			'product_value'     => '',
			'description'       => '',
			'redemption_limit'  => '',
		];
	}

	/**
	 * Get admin title for advocate.
	 *
	 * @since 1.0.0
	 *
	 * @return string
	 */
	public function get_admin_advocate_title(): string {
		return __( 'Reward Advocates with a Free Product', 'rewardswp' );
	}

	/**
	 * Get admin title for friend.
	 *
	 * @since 1.0.0
	 *
	 * @return string
	 */
	public function get_admin_friend_title(): string {
		return __( 'Reward Friends with a Free Product', 'rewardswp' );
	}

	/**
	 * Retrieve the reward formatted amount.
	 *
	 * @since 1.0.0
	 *
	 * @param float  $amount Optional. Unused for free product rewards.
	 * @param string $format Optional. Format identifier. Default 'default'.
	 *
	 * @return string
	 */
	public function get_reward_formatted_amount( float $amount = 0, string $format = 'default' ): string {
		return __( 'Free product', 'rewardswp' );
	}

	/**
	 * Lite stub: Issue reward not available.
	 *
	 * @since 1.0.0
	 *
	 * @param \Awesomemotive\Rewardswp\Models\Referral $referral Referral instance.
	 * @param string                                   $recipient_type Recipient type.
	 * @param array                                    $args Arguments.
	 *
	 * @return \Awesomemotive\Rewardswp\Models\Reward|null
	 */
	public function issue_reward( \Awesomemotive\Rewardswp\Models\Referral $referral, string $recipient_type, array $args = [] ): ?\Awesomemotive\Rewardswp\Models\Reward {
		return null;
	}

	/**
	 * Lite stub: Claim reward not available.
	 *
	 * @since 1.0.0
	 *
	 * @param array $args Arguments.
	 *
	 * @return \Awesomemotive\Rewardswp\Models\Reward|null
	 */
	public function claim_reward( array $args = [] ): ?\Awesomemotive\Rewardswp\Models\Reward {
		return null;
	}

	/**
	 * Lite stub: Redeem reward not available.
	 *
	 * @since 1.0.0
	 *
	 * @param \Awesomemotive\Rewardswp\Models\Reward $reward Reward instance.
	 * @param array                                  $args Arguments.
	 *
	 * @return bool|null
	 */
	public function redeem_reward( \Awesomemotive\Rewardswp\Models\Reward $reward, array $args = [] ): ?bool {
		return false;
	}

	/**
	 * Lite stub: Prepare rewards not available.
	 *
	 * @since 1.0.0
	 *
	 * @param \Awesomemotive\Rewardswp\Models\Reward[] $rewards Rewards array.
	 * @param array                                    $args Arguments.
	 *
	 * @return array
	 */
	public function prepare_rewards_objects_for_view( array $rewards, array $args = [] ): array {
		return [];
	}

	/**
	 * Lite stub: Empty rewards content not available.
	 *
	 * @since 1.0.0
	 *
	 * @return string
	 */
	public function get_empty_rewards_content(): string {
		return '';
	}

	/**
	 * Lite stub: Claim panel content not available.
	 *
	 * @since 1.0.0
	 *
	 * @param array $args Arguments.
	 *
	 * @return string
	 */
	public function get_claim_panel_content( array $args = [] ): string {
		return '';
	}

	/**
	 * Lite stub: Panel subtitle not available.
	 *
	 * @since 1.0.0
	 *
	 * @param \Awesomemotive\Rewardswp\Models\Reward|null $reward Reward instance.
	 *
	 * @return string
	 */
	public function get_panel_subtitle( ?\Awesomemotive\Rewardswp\Models\Reward $reward = null ): string {
		return '';
	}
}
