<?php

namespace App\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;

class OrderRequest extends FormRequest
{
    /**
     * @return array<array<string>>
     */
    public function rules(): array
    {
        return [
            // Order
            'customer_id'            => ['required', 'exists:customers,id'],
            'contact_id'             => ['nullable', 'exists:contacts,id'],
            'customer_po'            => ['required', 'string'],
            'order_type'             => ['required', 'string'],
            'order_date'             => ['required', 'date'],
            'due_date'               => ['required', 'date'],
            'status'                 => ['required'],
            'rush'                   => ['nullable'],
            'new_art'                => ['nullable'],
            'digitizing'             => ['nullable'],
            'repeat'                 => ['nullable'],
            'purchased_garments'     => ['nullable'],
            'customer_supplied_file' => ['nullable'],
            'notes'                  => ['nullable'],

            // Order Products

            // Product Sizes

            // Product Services

            // Service Files
        ];
    }

    public function authorize(): bool
    {
        return true;
    }
}
