<?php

namespace App\Http\Requests;

use App\Models\AmcContract;
use Gate;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Http\Response;

class UpdateAmcContractRequest extends FormRequest
{
    public function authorize()
    {
        return Gate::allows('amc_contract_edit');
    }

    public function rules()
    {
        return [
            'client_id' => [
                'required',
                'integer',
            ],
            'assets.*' => [
                'integer',
            ],
            'assets' => [
                'required',
                'array',
            ],
            'amc_start_date' => [
                'required',
                'date_format:' . config('panel.date_format'),
            ],
            'amc_expiry_date' => [
                'required',
                'date_format:' . config('panel.date_format'),
            ],
        ];
    }
}
