<?php

namespace App\Http\Requests\Api\SeminarSignUp;
use Illuminate\Foundation\Http\FormRequest;
use App\Rules\RegionLimitedRules;

class StoreRequest extends FormRequest
{
    public function rules(): array
    {
        return [
            'trackNo'   => ['required',new RegionLimitedRules()],
            'firstName'     => 'required',
            'lastName'      => 'required',
            'companyName'   => 'required',
            'companyEmail'  => 'required|email',
            'backupEmail'   => 'sometimes|nullable|email',
            'phoneNumber'    => 'required',
            'country'   => 'required',
            // 'registeredSession'   => 'required',    // 如果選擇台灣track則必填
            // 'lunchOptions'   => 'required',         // 如果選擇台灣track則必填
            'typeOfIndustry'   => 'required',
            'typeOfJob'   => 'required',
            'jobTitle'   => 'required',
            'trackOfInterest'   => 'required',
            'areaOfInterest'   => 'required',
            'howToKnowAboutTheEvent'   => 'required',
            'consentAcceptEmail'   => 'required',
            'consentPrivacyPolicy'   => 'required',
            
        ];
    }

    public function messages(): array
    {
        return [
            /*'trackNo.required'  => 'column [trackNo] is required.',
            'firstName.required'    => 'column [firstName] is required.',
            'lastName.required'     => 'column [lastName] is required.',
            'companyName.required'  => 'column [companyName] is required.',
            'companyEmail.required' => 'column [companyEmail] is required.',
            'companyEmail.email'    => 'column [companyEmail] is format error',
            'backupEmail.email'     => 'column [backupEmail] is format error',
            'phoneNumber.required'  => 'column [phoneNumber] is required.',
            'phoneNumber.regex'  => 'column [phoneNumber] is format error.',
            'country.required'  => 'column [country] is required.',
            // 'registeredSession.required'  => 'column [registeredSession] is required.',     // 如果選擇台灣track則必填
            // 'lunchOptions.required'  => 'column [lunchOptions] is required.',     // 如果選擇台灣track則必填
            'typeOfIndustry.required'  => 'column [typeOfIndustry] is required.',
            'typeOfJob.required'  => 'column [typeOfJob] is required.',
            'jobTitle.required'  => 'column [jobTitle] is required.',
            'trackOfInterest.required'  => 'column [trackOfInterest] is required.',
            'areaOfInterest.required'  => 'column [areaOfInterest] is required.',
            'howToKnowAboutTheEvent.required'  => 'column [howToKnowAboutTheEvent] is required.',
            'consentAcceptEmail.required'  => 'column [consentAcceptEmail] is required.',
            'consentPrivacyPolicy.required'  => 'column [consentPrivacyPolicy] is required.',*/
        ];
    }
}
