<?php

namespace App\Classes\ValueObjects\Constants;

final class BankAccountType {

    public const PERSONAL = 1;

    public const EXTERNAL = 2;

    public const ALIPAY_1688 = 3;

    public const ALIPAY_RECIPIENT = 4;

    /**
     * Get all account type labels.
     *
     * @return array
     */
    public static function labels(): array
    {
        return [
            self::PERSONAL => 'PERSONAL',
            self::EXTERNAL => 'EXTERNAL',
            self::ALIPAY_1688 => 'ALIPAY_1688',
            self::ALIPAY_RECIPIENT => 'ALIPAY_RECIPIENT',
        ];
    }

    /**
     * Get label for a specific account type.
     *
     * @param int|string $type
     * @return string
     */
    public static function label($type): string
    {
        return self::labels()[(int) $type] ?? 'Unknown';
    }
}
