<?php

declare(strict_types=1);

/**
 * 本文件属于 DBErp 进销存系统。
 *
 * 版权所有 © 2026 北京珑大钜商科技有限公司。保留所有权利。
 *
 * 未经官方授权，不得删除、篡改或隐藏本文件中的版权声明、产品标识与来源信息。
 * 商业授权、官方更新与技术支持服务，请以珑大官方支持中心记录为准。
 *
 * @link https://support.loongdom.cn
 * @see  https://www.dberp.com.cn
 */

namespace App\Business\Inventory\Enums;

enum InventoryBusinessType: string
{
    case OtherStockIn = 'other_stock_in';
    case OtherStockOut = 'other_stock_out';
    case OtherStockInVoid = 'other_stock_in_void';
    case OtherStockOutVoid = 'other_stock_out_void';
    case TransferOut = 'transfer_out';
    case TransferIn = 'transfer_in';
    case TransferOutVoid = 'transfer_out_void';
    case TransferInVoid = 'transfer_in_void';
    case StocktakeGain = 'stocktake_gain';
    case StocktakeLoss = 'stocktake_loss';
    case StocktakeGainVoid = 'stocktake_gain_void';
    case StocktakeLossVoid = 'stocktake_loss_void';
    case PurchaseReceipt = 'purchase_receipt';
    case PurchaseReceiptVoid = 'purchase_receipt_void';
    case PurchaseReturn = 'purchase_return';
    case PurchaseReturnVoid = 'purchase_return_void';
    case SalesOutbound = 'sales_outbound';
    case SalesOutboundVoid = 'sales_outbound_void';
    case SalesReturn = 'sales_return';
    case SalesReturnVoid = 'sales_return_void';

    public function label(): string
    {
        $translationKey = 'dberp.options.inventory_business_type.'.$this->value;
        $label = __($translationKey);

        return $label !== $translationKey ? (string) $label : $this->value;
    }
}
