<?php

namespace Database\Factories;

use App\Models\Business;
use App\Models\Service;
use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Support\Str;

class ServiceFactory extends Factory
{
    protected $model = Service::class;

    public function definition(): array
    {
        $name = fake()->words(3, true);

        return [
            'business_id' => Business::factory(),
            'name' => Str::headline($name),
            'slug' => Str::slug($name).'-'.fake()->unique()->numberBetween(100, 999),
            'category' => fake()->randomElement(['Hair Services', 'Beauty', 'Consultation', 'Spa']),
            'price' => fake()->numberBetween(25, 250),
            'duration_minutes' => fake()->randomElement([30, 45, 60, 90]),
            'description' => fake()->sentence(),
            'buffer_before_minutes' => 0,
            'buffer_after_minutes' => 0,
            'status' => Service::STATUS_ACTIVE,
            'sort_order' => 1,
        ];
    }
}
