<?php

namespace Mehrab\User\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;
use Mehrab\Service\Models\Service;

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

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        //* password doesnt need exact register rules
        return [
            'mobile' => ['required','regex:/^(09)[0-9]{9}/', 'digits:11', 'numeric','unique:users,mobile'],
            'password' => ['required','string', 'min:6'],
            'name' => ['nullable','string','min:2','max:200'],
            'lname' => ['nullable','string','min:2','max:200'],
            'national_code' => ['nullable','numeric','digits:10','unique:users,national_code'],
            'email' => ['nullable','email','unique:users,email'],
            'amount' => ['nullable','numeric'],
            'zip_code' => ['nullable','numeric'],
            'address' => ['nullable','string','min:2','max:2000'],
            'profile_pic' => ['nullable','image','mimes:jpg,jpeg,png','max:2048'],
            'certificate_card_pic' => ['nullable','image','mimes:jpg,jpeg,png','max:2048'],
            'national_card_pic' => ['nullable','image','mimes:jpg,jpeg,png','max:2048'],
        ];
    }

}
