<?php

namespace App\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;

class ProductSKUStoreRequest extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     */
    public function authorize(): bool
    {
        return auth()->check();
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules(): array
    {
        return [
            'product_id'            => 'required|exists:products,id',
            'order_id'              => 'nullable|exists:orders,id',
            'status'                => 'nullable|string',
            'rfid'                  => 'nullable|string',
            'factory_number'        => 'nullable|string',
            'manufacture_date'      => 'nullable|date',
            'service_life'          => 'nullable|integer',
            'certificate_number'    => 'nullable|string',
            'certificate_date'      => 'nullable|date',
            'certificate_issuer'    => 'nullable|string',
            'certificate_type'      => 'nullable|string',
            'statement_number'      => 'nullable|string',
            'statement_date'        => 'nullable|date',
            'upd_number'            => 'nullable|string',
            'comment'               => 'nullable|string',
        ];
    }
}
