<?php

namespace App\Http\Requests\V1\AccountSubject;

use Illuminate\Foundation\Http\FormRequest;

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

    public function rules(): array
    {
        return [
            'code' => ['required', 'string', 'max:10'],
            'name' => ['required', 'string', 'max:100'],
            'category' => ['nullable', 'string', 'in:asset,liability,capital,revenue,expense'],
        ];
    }

    public function messages(): array
    {
        return [
            'code.required' => '계정과목 코드를 입력하세요.',
            'name.required' => '계정과목명을 입력하세요.',
            'category.in' => '유효한 분류를 선택하세요.',
        ];
    }
}
