<?php

namespace App\Models;

use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;

class AdminUser extends Authenticatable
{
    use Notifiable;

    protected $table = 'admin_users';

    protected $fillable = [
        'email','password',
        'full_name','nickname','phone',
        'role','status',
        'is_consult_available','consult_types',
        'totp_secret','totp_enabled','totp_confirmed_at',
        'last_login_at','last_login_ip',
    ];

    protected $hidden = [
        'password',
        'remember_token',
        'totp_secret',
    ];

    protected $casts = [
        'is_consult_available' => 'boolean',
        'consult_types' => 'array',          // ✅ JSON <-> array 자동 변환
        'totp_enabled' => 'boolean',
        'totp_confirmed_at' => 'datetime',
        'last_login_at' => 'datetime',
    ];
}
