<?php

namespace App\Http\Requests\BarobillSetting;

use Illuminate\Foundation\Http\FormRequest;

class SaveBarobillSettingRequest extends FormRequest
{
    public function authorize(): bool
    {
        return true;
    }

    public function rules(): array
    {
        return [
            'corp_num' => ['required', 'string', 'size:10'],
            'cert_key' => ['nullable', 'string', 'max:500'],
            'barobill_id' => ['nullable', 'string', 'max:100'],
            'corp_name' => ['required', 'string', 'max:100'],
            'ceo_name' => ['required', 'string', 'max:50'],
            'addr' => ['nullable', 'string', 'max:200'],
            'biz_type' => ['nullable', 'string', 'max:100'],
            'biz_class' => ['nullable', 'string', 'max:100'],
            'contact_id' => ['nullable', 'string', 'email', 'max:100'],
            'contact_name' => ['nullable', 'string', 'max:50'],
            'contact_tel' => ['nullable', 'string', 'max:20'],
            'is_active' => ['boolean'],
            'auto_issue' => ['boolean'],
        ];
    }

    public function attributes(): array
    {
        return [
            'corp_num' => __('validation.attributes.corp_num'),
            'cert_key' => __('validation.attributes.cert_key'),
            'barobill_id' => __('validation.attributes.barobill_id'),
            'corp_name' => __('validation.attributes.corp_name'),
            'ceo_name' => __('validation.attributes.ceo_name'),
            'addr' => __('validation.attributes.addr'),
            'biz_type' => __('validation.attributes.biz_type'),
            'biz_class' => __('validation.attributes.biz_class'),
            'contact_id' => __('validation.attributes.contact_id'),
            'contact_name' => __('validation.attributes.contact_name'),
            'contact_tel' => __('validation.attributes.contact_tel'),
        ];
    }
}
