<?php

namespace Database\Factories;

use App\Models\Subscription;
use App\Models\User;
use App\Models\Plan;
use Illuminate\Database\Eloquent\Factories\Factory;

class SubscriptionFactory extends Factory
{
    public function definition(): array
    {
        return [
            'user_id' => User::factory(),
            'plan_id' => Plan::factory(),
            'subscription_status' => 'active',
            'start_date' => now(),
            'end_date' => now()->addYear(),
        ];
    }
    
    public function pending(): static
    {
        return $this->state(fn (array $attributes) => [
            'subscription_status' => 'pending',
        ]);
    }
}
