<?php

declare(strict_types=1);

namespace Kylin\Hr\Enums;

/**
 * 请假类型枚举
 */
enum LeaveType: int
{
    case Personal = 1;       // 事假
    case Sick = 2;           // 病假
    case Annual = 3;         // 年假
    case Marriage = 4;       // 婚假
    case Maternity = 5;      // 产假
    case Paternity = 6;      // 陪产假
    case Bereavement = 7;    // 丧假
    case Compensatory = 8;   // 调休
    case Business = 9;       // 出差
    case Other = 10;         // 其他

    /**
     * 获取标签
     */
    public function label(): string
    {
        return match ($this) {
            self::Personal      => '事假',
            self::Sick          => '病假',
            self::Annual        => '年假',
            self::Marriage      => '婚假',
            self::Maternity     => '产假',
            self::Paternity     => '陪产假',
            self::Bereavement   => '丧假',
            self::Compensatory  => '调休',
            self::Business      => '出差',
            self::Other         => '其他',
        };
    }

    /**
     * 是否带薪
     */
    public function isPaid(): bool
    {
        return match ($this) {
            self::Personal, self::Other => false,
            default => true,
        };
    }
}
