<?php

namespace App\Models;

use App\Core\Database;

/**
 * SubscriptionPlan Model
 * Represents SaaS pricing and request limit plans.
 */
class SubscriptionPlan extends BaseModel
{
    protected static string $table = 'subscription_plans';

    /**
     * Get plan by name
     */
    public static function findByName(string $name): ?array
    {
        return Database::selectOne(
            "SELECT * FROM " . static::$table . " WHERE name = ? LIMIT 1",
            [$name]
        );
    }
}
