<?php

namespace App\Http\Requests\Tenant;

use Illuminate\Foundation\Http\FormRequest;

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

    public function rules(): array
    {
        return [
            'tenant_id' => 'required|integer|exists:tenants,id',
            'company_name' => 'sometimes|string|max:100',
            'email' => 'nullable|email|max:100',
            'phone' => 'nullable|string|max:20',
            'address' => 'nullable|string|max:500',
            'business_num' => 'nullable|string|max:20',
            'ceo_name' => 'nullable|string|max:100',
            'logo' => 'nullable|string|max:255',
            // 확장 필드 (JSON)
            'options' => 'nullable|array',
            'options.business_type' => 'nullable|string|max:100',
            'options.business_category' => 'nullable|string|max:100',
            'options.zip_code' => 'nullable|string|max:10',
            'options.address_detail' => 'nullable|string|max:255',
            'options.tax_invoice_email' => 'nullable|email|max:100',
            'options.manager_name' => 'nullable|string|max:100',
            'options.payment_bank' => 'nullable|string|max:100',
            'options.payment_account' => 'nullable|string|max:50',
            'options.payment_account_holder' => 'nullable|string|max:100',
            'options.payment_day' => 'nullable|string|max:10',
        ];
    }
}
