<?php

namespace App\Enums;

use App\Enums\Traits\HasLabels;

/**
 * @OA\Schema(
 *   schema="UserGender",
 *   type="string",
 *   enum={"male", "female", "other", "unset"},
 *   example="male"
 * )
 */
enum UserGender: string
{
    use HasLabels;

    case Male = 'male';
    case Female = 'female';
    case Other = 'other';
    case Unset = 'unset'; 

    // 返回對應的顯示文字
    public function labels(): string
    {
        return match($this) {
            self::Male => __('enums.Male'),
            self::Female => __('enums.Female'),
            self::Other => __('enums.Other'),
            self::Unset => __('enums.Unset'),
        };
    }
    
}