<?php

namespace App\Http\Requests\Catalog;

use Illuminate\Foundation\Http\FormRequest;

class StoreProductRequest extends FormRequest
{
    public function authorize(): bool
    {
        return true;
    }

    public function rules(): array
    {
        return [
            'category_id' => ['nullable', 'uuid'],
            'sku' => ['nullable', 'string', 'max:255'],
            'name' => ['required', 'string', 'max:255'],
            'description' => ['nullable', 'string'],
            'price' => ['required', 'numeric', 'min:0'],
            'compare_price' => ['nullable', 'numeric', 'min:0'],
            'currency_code' => ['required', 'string', 'size:3'],
            'status' => ['required', 'string', 'in:active,inactive'],
            'stock_mode' => ['required', 'string', 'in:tracked,untracked'],
            'stock_quantity' => ['required', 'integer', 'min:0'],
            'availability_status' => ['nullable', 'string', 'in:available,out_of_stock'],
            'initial_stock_quantity' => ['nullable', 'integer', 'min:0'],
        ];
    }
}
