<?php

declare(strict_types=1);

namespace Kylin\Retail\Enums;

/**
 * 库存操作类型枚举
 */
enum InventoryType: string
{
    case StockIn  = 'stock_in';  // 入库
    case StockOut = 'stock_out'; // 出库
    case Sale     = 'sale';      // 销售出库
    case Return   = 'return';    // 退货入库
    case Loss     = 'loss';      // 报损
    case Check    = 'check';     // 盘点调整

    public function label(): string
    {
        return match ($this) {
            self::StockIn  => '入库',
            self::StockOut => '出库',
            self::Sale     => '销售出库',
            self::Return   => '退货入库',
            self::Loss     => '报损',
            self::Check    => '盘点调整',
        };
    }

    public function isIncrease(): bool
    {
        return in_array($this, [self::StockIn, self::Return]);
    }
}
