<?php

namespace App\Http\Requests;


class CustomerProfileRequest extends ApiBaseRequest
{

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules(): array
    {
        return [
            "package_id"=>"required|integer",
            "first_name"=>"required|string",
            "last_name"=>"required|string",
            'email'=>['required', 'email','unique:users,email'],
            'password'=>'required|min:8|regex:'.$this->password_validation_rule,
            'birth_date'=>'required|date_format:m/d/Y|before:18 years ago|after:-150 years',
            'full_ssn'=>'required|min:4|max:4',
//            'full_ssn'=>'required|min:9|max:11',
            'street_no'=>'required|string|max:5|regex:'.$this->street_validation_rule,
            'street_name'=>'required|max:50|regex:'.$this->street_validation_rule,
            'city'=>'required|string|regex:'.$this->script_validation_rule,
            'state'=>'required|string|regex:'.$this->script_validation_rule,
            'zip_code'=>'required|string|regex:'.$this->script_validation_rule,
            'ssn'=>'required',
            'amount'=>'required',
            'phone'=>'required|string|regex:'.$this->script_validation_rule,
        ];
    }

    public function messages(): array
    {
        return [
            'street_name.max' => 'The street name may not be greater than 50 characters.',
            'street_name.regex' => 'The street name may not be special characters.',
        ];
    }
}
