<?php

namespace App\Enums;

/**
 * The recurring flower delivery plan a subscriber has chosen.
 */
enum SubscriptionPlan: string
{
    case Basic = 'basic';
    case Premium = 'premium';
    case Luxury = 'luxury';

    /**
     * Get the display label for the plan.
     */
    public function label(): string
    {
        return match ($this) {
            self::Basic => 'Basic',
            self::Premium => 'Premium',
            self::Luxury => 'Luxury',
        };
    }

    /**
     * Get the authoritative price for the plan, in rupees.
     *
     * This is the single source of truth for plan pricing and must never be
     * sourced from client input.
     */
    public function price(): float
    {
        return match ($this) {
            self::Basic => 350.00,
            self::Premium => 600.00,
            self::Luxury => 900.00,
        };
    }
}
