<?php

declare(strict_types=1);

namespace App\Enums;

enum SubscriptionStatus: string
{
    case Incomplete = 'incomplete';
    case Trialing = 'trialing';
    case Active = 'active';
    case PastDue = 'past_due';
    case Canceled = 'canceled';
    case Expired = 'expired';

    /** Whether plan entitlements should currently apply. */
    public function grantsEntitlements(): bool
    {
        return in_array($this, [self::Trialing, self::Active, self::PastDue], true);
    }
}
