<?php

namespace DropshippingExportFreeVendor\WPDesk\Library\DropshippingExport\Config;

use DropshippingExportFreeVendor\WPDesk\Library\DropshippingExport\Infrastructure\Config\Abstraction\AbstractSingleConfig;
use DropshippingExportFreeVendor\WPDesk\Library\DropshippingExport\Infrastructure\Menu\Abstraction\AbstractMenu;
use DropshippingExportFreeVendor\WPDesk\Library\DropshippingExport\Infrastructure\Menu\MainMenu;
use DropshippingExportFreeVendor\WPDesk\Library\DropshippingExport\Infrastructure\Menu\SubMenu;
use DropshippingExportFreeVendor\WPDesk\Library\DropshippingExport\Action\View\ExportManagerViewAction;
use DropshippingExportFreeVendor\WPDesk\Library\DropshippingExport\Action\View\ExportOptionsViewAction;
use DropshippingExportFreeVendor\WPDesk\Library\DropshippingExport\Action\View\ExportTypeViewAction;
use DropshippingExportFreeVendor\WPDesk\Library\DropshippingExport\Action\View\ExportMapperViewAction;
use DropshippingExportFreeVendor\WPDesk\Library\DropshippingExport\Action\View\ExportLogicViewAction;
use DropshippingExportFreeVendor\WPDesk\Library\DropshippingExport\Action\View\ExportStatusViewAction;
use DropshippingExportFreeVendor\WPDesk\Library\DropshippingExport\Action\View\ExportSettingsAction;
class MenuConfig extends AbstractSingleConfig
{
    public const ID = 'menu';
    public const MENU_PREFIX = 'dropshipping_export_';
    public const SLUG_MANAGER = self::MENU_PREFIX . 'manager';
    public const SLUG_EXPORT = self::MENU_PREFIX . 'type';
    public const SLUG_SETTINGS = self::MENU_PREFIX . 'settings';
    public const SLUG_MARKETING = self::MENU_PREFIX . 'how_to_use';
    public const ACTION_DEFAULT = AbstractMenu::DEFAULT_ACTION;
    public const ACTION_EXPORT_LOGIC = 'export_logic';
    public const ACTION_MAPPER = 'mapper';
    public const ACTION_OPTIONS = 'options';
    public const ACTION_IMPORTING = 'exporting';
    public function get(): array
    {
        $menu_img = $this->get_config()->get_param('assets.img.core_dir_url')->get() . 'logo.png';
        return [(new MainMenu())->set_position(26.2)->set_title('Dropshipping Export')->set_capability('manage_options')->set_icon($menu_img)->set_hidden(\true)->set_slug(self::SLUG_MANAGER)->set_default_view(ExportManagerViewAction::class)->add_submenus([(new SubMenu())->set_position(0)->set_title(__('Export Manager', 'dropshipping-export-free'))->set_capability('manage_options')->set_slug(self::SLUG_MANAGER)->set_default_view(ExportManagerViewAction::class), (new SubMenu())->set_position(1)->set_title(__('Export products', 'dropshipping-export-free'))->set_capability('manage_options')->set_slug(self::SLUG_EXPORT)->set_default_view(ExportTypeViewAction::class)->add_view_actions([self::ACTION_EXPORT_LOGIC => ExportLogicViewAction::class, self::ACTION_MAPPER => ExportMapperViewAction::class, self::ACTION_OPTIONS => ExportOptionsViewAction::class, self::ACTION_IMPORTING => ExportStatusViewAction::class]), (new SubMenu())->set_position(2)->set_title(__('Settings', 'dropshipping-export-free'))->set_capability('manage_options')->set_slug(self::SLUG_SETTINGS)->set_default_view(ExportSettingsAction::class)])];
    }
    public function get_id(): string
    {
        return self::ID;
    }
}
