<?php

declare(strict_types=1);

namespace Kylin\Retail\Enums;

/**
 * 订单状态枚举
 */
enum OrderStatus: string
{
    case Pending   = 'pending';    // 待支付
    case Paid      = 'paid';       // 已支付
    case Completed = 'completed';  // 已完成
    case Refunding = 'refunding';  // 退款中
    case Refunded  = 'refunded';   // 已退款
    case Cancelled = 'cancelled';  // 已取消

    public function label(): string
    {
        return match ($this) {
            self::Pending   => '待支付',
            self::Paid      => '已支付',
            self::Completed => '已完成',
            self::Refunding => '退款中',
            self::Refunded  => '已退款',
            self::Cancelled => '已取消',
        };
    }
}
