<?php

namespace ModulesGarden\HostingQuotaNotifications\App\Helper\Home;

use ModulesGarden\HostingQuotaNotifications\App\Helper\Constants\Status;
use ModulesGarden\HostingQuotaNotifications\App\Helper\Logger\SendMail;
use ModulesGarden\HostingQuotaNotifications\App\Helper\Logger\ModuleAction;
use ModulesGarden\HostingQuotaNotifications\App\Helper\Logger\OpenTicket;
use ModulesGarden\HostingQuotaNotifications\App\Helper\Lang\Lang;
/**
 * Class Data
 *
 * @author Artur Pilch <artur.pi@modulesgarden.com>
 */
class Data
{
    public static function getMessagesType()
    {
        return [
            SendMail::SEND_EMAIL,
            OpenTicket::OPEN_TICKET,
            ModuleAction::MODULE_SUSPEND,
            ModuleAction::MODULE_TERMINATE
        ];
    }

    public static function setOut()
    {
        $out = [];
        foreach (self::getMessagesType() as $item)
        {
            $out[$item][Status::SUCCESS] = 0;
            $out[$item][Status::ERROR]   = 0;
        }
        return $out;
    }

    public static function getIcons()
    {
        return [
            SendMail::SEND_EMAIL           => 'email',
            OpenTicket::OPEN_TICKET        => 'receipt',
            ModuleAction::MODULE_SUSPEND   => 'pause',
            ModuleAction::MODULE_TERMINATE => 'stop',
        ];
    }

    public static function getLangsAndIcons()
    {
        $icons = self::getIcons();
        $out   = [];
        foreach (self::getMessagesType() as $item)
        {
            $out[$item]['lang']               = Lang::getAbsoulteLang('logs', $item);
            $out[$item]['icon']               = $icons[$item];
            $out[$item]['descriptionError']   = Lang::getAbsoulteLang('descriptionError', $item);
            $out[$item]['descriptionSuccess'] = Lang::getAbsoulteLang('descriptionSuccess', $item);
        }
        return $out;
    }
}