<?php

namespace App\Enums;

use App\Enums\Traits\HasLabels;

/**
 * @OA\Schema(
 *   schema="UserStatus",
 *   type="string",
 *   enum={"0", "1", "2"},
 *   description="User status: 0=Active, 1=Suspended, 2=Deleting",
 *   example="0"
 * )
 */
enum UserStatus: int
{
    use HasLabels;

    case Active = 0;    // 正常
    case Suspended = 1; // 停權
    case Deleting = 2;  // 刪除中
    
    // 返回對應的顯示文字
    public function labels(): string
    {
        return match($this) {
            self::Active => __('enums.user.status.Active'),
            self::Suspended => __('enums.user.status.Suspended'),
            self::Deleting => __('enums.user.status.Deleting'),
        };
    }

}