<?php

declare(strict_types=1);

namespace Kylin\Education\Enums;

/**
 * 课程状态
 */
enum CourseStatus: string
{
    case DRAFT = 'draft';               // 草稿
    case PENDING_REVIEW = 'pending_review'; // 待审核
    case PUBLISHED = 'published';       // 已发布
    case REJECTED = 'rejected';         // 已驳回
    case ARCHIVED = 'archived';         // 已归档

    public function label(): string
    {
        return match ($this) {
            self::DRAFT => '草稿',
            self::PENDING_REVIEW => '待审核',
            self::PUBLISHED => '已发布',
            self::REJECTED => '已驳回',
            self::ARCHIVED => '已归档',
        };
    }

    public function badgeClass(): string
    {
        return match ($this) {
            self::DRAFT => 'bg-secondary',
            self::PENDING_REVIEW => 'bg-warning',
            self::PUBLISHED => 'bg-success',
            self::REJECTED => 'bg-danger',
            self::ARCHIVED => 'bg-dark',
        };
    }
}
