<?php

namespace App\Model;

final class CommandTypes
{
    public const string DEPLOY_IMAGE = 'deploy-image';
    public const string RESTORE_IMAGE = 'restore-image';
    public const string CREATE_IMAGE = 'create-image';
    public const string CREATE_IMAGE_GIT = 'create-image-git';
    public const string UPDATE_IMAGE_GIT = 'update-image-git';
    public const string CONVERT_IMAGE = 'convert-image';
    public const string CREATE_IMAGE_AUX_FILE = 'create-image-aux-file';
    public const string BACKUP_IMAGE = 'backup-image';
    public const string IMPORT_IMAGE = 'import-image';
    public const string EXPORT_IMAGE = 'export-image';
    public const string RENAME_IMAGE = 'rename-image';
    public const string CONVERT_IMAGE_TO_VIRTUAL = 'convert-image-to-virtual';
    public const string TRANSFER_IMAGE = 'transfer-image';
    public const string POWER_ON = 'power-on';
    public const string REBOOT = 'reboot';
    public const string SHUTDOWN = 'shutdown';
    public const string LOGIN = 'login';
    public const string LOGOUT = 'logout';
    public const string PARTITION_AND_FORMAT = 'partition-and-format';
    public const string INSTALL_OGLIVE = 'install-oglive';
    public const string RUN_SCRIPT = 'run-script';
    public const string REMOVE_CACHE_IMAGE = 'remove-cache-image';
    public const string HARDWARE_INVENTORY = 'hardware-inventory';
    public const string SOFTWARE_INVENTORY = 'software-inventory';
    public const string KILL_JOB = 'kill-job';

    private const array COMMAND_TYPES = [
        self::DEPLOY_IMAGE => 'Deploy Image',
        self::RESTORE_IMAGE => 'Update Cache',
        self::CREATE_IMAGE => 'Create Image',
        self::CREATE_IMAGE_GIT => 'Create Image Git',
        self::UPDATE_IMAGE_GIT => 'Update Image Git',
        self::CONVERT_IMAGE => 'Convert Image',
        self::CONVERT_IMAGE_TO_VIRTUAL => 'Convert Image to Virtual',
        self::CREATE_IMAGE_AUX_FILE => 'Create Image Aux File',
        self::BACKUP_IMAGE => 'Backup Image',
        self::IMPORT_IMAGE => 'Import image',
        self::EXPORT_IMAGE => 'Export image',
        self::RENAME_IMAGE => 'Rename Image',
        self::POWER_ON => 'Encender',
        self::REBOOT => 'Reiniciar',
        self::SHUTDOWN => 'Apagar',
        self::LOGIN => 'Login',
        self::LOGOUT => 'Logout',
        self::PARTITION_AND_FORMAT => 'Partition and Format',
        self::TRANSFER_IMAGE => 'Transfer Image',
        self::INSTALL_OGLIVE => 'Instalar OgLive',
        self::RUN_SCRIPT => 'Run Script',
        self::REMOVE_CACHE_IMAGE => 'Remove Cache Image',
        self::HARDWARE_INVENTORY => 'Hardware Inventory',
        self::SOFTWARE_INVENTORY => 'Software Inventory',
        self::KILL_JOB => 'Kill Job',
    ];

    public static function getCommandTypes(): array
    {
        return self::COMMAND_TYPES;
    }

    public static function getCommandType(string $type): ?string
    {
        return self::COMMAND_TYPES[$type] ?? null;
    }
}
