import * as icon from '@mdi/js';
import { MenuAsideItem } from './interfaces';

const menuAside: MenuAsideItem[] = [
  {
    href: '/dashboard',
    icon: icon.mdiViewDashboardOutline,
    label: 'Operations dashboard',
    permissions: [
      'READ_ACCOUNTS',
      'READ_PRODUCTS',
      'READ_ORDERS',
      'READ_INVENTORY_ITEMS',
    ],
  },
  {
    href: '/integrations',
    icon: icon.mdiLinkVariant,
    label: 'Integration Center',
    permissions: 'READ_API_DOCS',
  },
  {
    label: 'Buyer workspace',
    icon: icon.mdiCart,
    permissions: 'READ_BUYER_PORTAL',
    menu: [
      {
        href: '/buyer-portal',
        icon: icon.mdiViewDashboardOutline,
        label: 'Portal overview',
        permissions: 'READ_BUYER_PORTAL',
      },
      {
        href: '/buyer-portal#catalog',
        icon: icon.mdiPackageVariantClosed,
        label: 'Contract catalog',
        permissions: 'READ_BUYER_PORTAL',
      },
      {
        href: '/buyer-portal#purchase-order',
        icon: icon.mdiClipboardTextOutline,
        label: 'Draft purchase order',
        permissions: 'CREATE_ORDERS',
      },
      {
        href: '/buyer-portal#samples',
        icon: icon.mdiPackageVariant,
        label: 'Sample request',
        permissions: 'CREATE_SAMPLE_REQUESTS',
      },
      {
        href: '/buyer-portal#orders',
        icon: icon.mdiHistory,
        label: 'Order history',
        permissions: 'READ_BUYER_PORTAL',
      },
      {
        href: '/buyer-portal#team-queue',
        icon: icon.mdiClipboardList,
        label: 'Team queues',
        permissions: 'READ_BUYER_TEAM_QUEUE',
      },
      {
        href: '/buyer-portal#buyer-quotes',
        icon: icon.mdiFileDocumentOutline,
        label: 'Quote follow-up',
        permissions: 'READ_BUYER_TEAM_QUEUE',
      },
      {
        href: '/buyer-portal#saved-guides',
        icon: icon.mdiBookmarkMultiple,
        label: 'Saved order guides',
        permissions: 'READ_BUYER_TEAM_QUEUE',
      },
    ],
  },
  {
    label: 'Customer operations',
    icon: icon.mdiDomain,
    permissions: [
      'READ_ACCOUNTS',
      'READ_LOCATIONS',
      'READ_CONTACTS',
      'READ_PRICE_LISTS',
      'READ_ACCOUNT_PRICE_LISTS',
      'READ_QUOTES',
      'READ_ORDERS',
    ],
    menu: [
      {
        href: '/accounts/accounts-list',
        label: 'Accounts',
        icon: icon.mdiDomain,
        permissions: 'READ_ACCOUNTS',
      },
      {
        href: '/locations/locations-list',
        label: 'Ship-to locations',
        icon: icon.mdiMapMarker,
        permissions: 'READ_LOCATIONS',
      },
      {
        href: '/contacts/contacts-list',
        label: 'Contacts',
        icon: icon.mdiAccountMultiple,
        permissions: 'READ_CONTACTS',
      },
      {
        href: '/price_lists/price_lists-list',
        label: 'Price lists',
        icon: icon.mdiCashMultiple,
        permissions: 'READ_PRICE_LISTS',
      },
      {
        href: '/account_price_lists/account_price_lists-list',
        label: 'Account pricing',
        icon: icon.mdiLinkVariant,
        permissions: 'READ_ACCOUNT_PRICE_LISTS',
      },
      {
        href: '/quotes/quotes-list',
        label: 'Quotes',
        icon: icon.mdiFileDocumentOutline,
        permissions: 'READ_QUOTES',
      },
      {
        href: '/orders/orders-list',
        label: 'Orders',
        icon: icon.mdiClipboardTextOutline,
        permissions: 'READ_ORDERS',
      },
    ],
  },
  {
    label: 'Catalog and inventory',
    icon: icon.mdiPackageVariantClosed,
    permissions: [
      'READ_PRODUCT_CATEGORIES',
      'READ_PRODUCTS',
      'READ_INVENTORY_ITEMS',
      'READ_SAMPLE_REQUESTS',
      'READ_SAVED_LISTS',
    ],
    menu: [
      {
        href: '/product_categories/product_categories-list',
        label: 'Categories',
        icon: icon.mdiTagMultiple,
        permissions: 'READ_PRODUCT_CATEGORIES',
      },
      {
        href: '/products/products-list',
        label: 'Products',
        icon: icon.mdiPackageVariantClosed,
        permissions: 'READ_PRODUCTS',
      },
      {
        href: '/inventory_items/inventory_items-list',
        label: 'Inventory',
        icon: icon.mdiWarehouse,
        permissions: 'READ_INVENTORY_ITEMS',
      },
      {
        href: '/sample_requests/sample_requests-list',
        label: 'Sample requests',
        icon: icon.mdiPackageVariant,
        permissions: 'READ_SAMPLE_REQUESTS',
      },
      {
        href: '/saved_lists/saved_lists-list',
        label: 'Saved order guides',
        icon: icon.mdiBookmarkMultiple,
        permissions: 'READ_SAVED_LISTS',
      },
    ],
  },
  {
    label: 'Fulfillment',
    icon: icon.mdiTruckDelivery,
    permissions: [
      'READ_CARTS',
      'READ_CART_ITEMS',
      'READ_ORDER_ITEMS',
      'READ_SHIPMENTS',
      'READ_QUOTE_ITEMS',
      'READ_PRICE_LIST_ITEMS',
      'READ_SAVED_LIST_ITEMS',
    ],
    menu: [
      {
        href: '/shipments/shipments-list',
        label: 'Shipments',
        icon: icon.mdiTruckDelivery,
        permissions: 'READ_SHIPMENTS',
      },
      {
        href: '/order_items/order_items-list',
        label: 'Order lines',
        icon: icon.mdiClipboardList,
        permissions: 'READ_ORDER_ITEMS',
      },
      {
        href: '/carts/carts-list',
        label: 'Carts',
        icon: icon.mdiCart,
        permissions: 'READ_CARTS',
      },
      {
        href: '/cart_items/cart_items-list',
        label: 'Cart lines',
        icon: icon.mdiFormatListBulleted,
        permissions: 'READ_CART_ITEMS',
      },
      {
        href: '/quote_items/quote_items-list',
        label: 'Quote lines',
        icon: icon.mdiFileDocumentEditOutline,
        permissions: 'READ_QUOTE_ITEMS',
      },
      {
        href: '/price_list_items/price_list_items-list',
        label: 'Price lines',
        icon: icon.mdiCash,
        permissions: 'READ_PRICE_LIST_ITEMS',
      },
      {
        href: '/saved_list_items/saved_list_items-list',
        label: 'Saved list lines',
        icon: icon.mdiPlaylistPlus,
        permissions: 'READ_SAVED_LIST_ITEMS',
      },
    ],
  },
  {
    label: 'System',
    icon: icon.mdiShieldAccountOutline,
    permissions: [
      'READ_USERS',
      'READ_ROLES',
      'READ_PERMISSIONS',
      'READ_API_DOCS',
    ],
    menu: [
      {
        href: '/users/users-list',
        label: 'Users',
        icon: icon.mdiAccountGroup,
        permissions: 'READ_USERS',
      },
      {
        href: '/roles/roles-list',
        label: 'Roles',
        icon: icon.mdiShieldAccountVariantOutline,
        permissions: 'READ_ROLES',
      },
      {
        href: '/permissions/permissions-list',
        label: 'Permissions',
        icon: icon.mdiShieldAccountOutline,
        permissions: 'READ_PERMISSIONS',
      },
      {
        href: '/api-docs',
        target: '_blank',
        label: 'API docs',
        icon: icon.mdiFileCode,
        permissions: 'READ_API_DOCS',
      },
    ],
  },
  {
    href: '/profile',
    label: 'Profile',
    icon: icon.mdiAccountCircle,
  },
];

export default menuAside;
