<?php

namespace App\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;

class StoreContractRequest extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     */
    public function authorize(): bool
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
     */
    public function rules(): array
    {
        return [
            'client_id' => ['required', 'numeric'],
            'issue_date' => ['nullable', 'date'],
            'begin_date' => ['required', 'date'],
            'expire_date' => ['required', 'date'],
            'surname' => ['required', 'string', 'max:60'],
            'name' => ['required', 'string', 'max:60'],
            'other_name' => ['nullable', 'string', 'max:100'],
            'post' => ['nullable', 'string', 'max:240'],
            'in_use' => ['nullable', 'numeric'],
            'phone' => ['required', 'string', 'max:140'],
            'cell' => ['nullable', 'string', 'max:140'],
            'email' => ['required', 'email', 'max:140'],
            'fax' => ['nullable', 'string', 'max:140'],
            'internet' => ['nullable', 'string', 'max:140'],
            'api' => ['nullable', 'string', 'max:140'],
            'payment_type' => ['nullable', 'string', 'max:140'],
        ];
    }
}
