<?php

namespace Database\Factories;

use App\Models\Customer;
use App\Models\Seat;
use Illuminate\Database\Eloquent\Factories\Factory;

/** @extends Factory<Seat> */
class SeatFactory extends Factory
{
    protected $model = Seat::class;

    public function definition(): array
    {
        return [
            'customer_id' => Customer::factory(),
            'email' => 'seat-'.$this->faker->unique()->numerify('########').'@example.test',
            'name' => $this->faker->name(),
            'role' => 'member',
            'status' => 'active',
            'invited_at' => now(),
            // Eloquents create() liest die DB-Vorgabe nicht ins In-Memory-Modell
            // zurueck — ohne diese Zeile bliebe nc_state hier null statt 'none',
            // wie bei jedem anderen Feld mit Spalten-Vorgabe in diesem Bestand
            // (siehe CustomerFactory::status, InstanceFactory::status).
            'nc_state' => Seat::STATE_NONE,
        ];
    }

    public function owner(): static
    {
        return $this->state(['role' => 'owner', 'status' => 'active']);
    }
}
