<?php
/**
 * Free shipping 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 Shipping Reward Type
 *
 * This is the Lite version that provides only presentation methods.
 * The Pro version (ProFreeShippingRewardType) extends this class
 * and adds full coupon functionality via traits.
 *
 * @since 1.0.0
 */
class FreeShippingRewardType extends AbstractRewardType {
	/**
	 * Get reward type slug.
	 *
	 * @since 1.0.0
	 *
	 * @return string
	 */
	public function get_type(): string {
		return 'free_shipping';
	}

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

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

	/**
	 * Get panel instructions.
	 *
	 * @since 1.0.0
	 *
	 * @return string
	 */
	public function get_panel_instructions(): string {
		return __( 'Use this coupon code for free shipping on your next order!', 'rewardswp' );
	}

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

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

	/**
	 * Get default configuration.
	 *
	 * @since 1.0.0
	 *
	 * @return int[]
	 */
	public function get_defaults(): array {
		return [
			'free_shipping'     => true,
			'discount_type'     => 'fixed_card',
			'reward_expiration' => '+3 months',
		];
	}

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

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

	/**
	 * Retrieve the reward formatted amount.
	 *
	 * @since 1.0.0
	 *
	 * @param float  $amount Optional. Unused for free shipping 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 shipping', '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 '';
	}
}
