import { expansionMenuItem } from './utils';
import { getScopes } from '@utils/scopes';
import { USER_SCOPES } from '@constants/entities/Scope';

export default function createRoute({ path, icon, label, order }) {
  return expansionMenuItem({
    path,
    label,
    icon,
    order,
    children: [
      {
        path: '/conversion',
        component: () => import('@/recruits/layouts/basic-list-layout'),
        children: [
          {
            name: 'conversion-log',
            path: 'log',
            components: {
              listButtons: () =>
                import('@/recruits/components/conversion/log/listButton'),
              default: () => import('@/recruits/components/conversion/log'),
            },
            meta: {
              scopes: getScopes([
                USER_SCOPES.MILITARY_RECRUIT_SPECIALIST,
                USER_SCOPES.MILITARY_COMMISSAR,
                USER_SCOPES.SYSTEM_ADMINISTRATOR,
                USER_SCOPES.MILITARY_COMMISSARIAT_OBSERVER,
              ]),
              place: 'drawer',
              label: 'Задания на конвертацию',
              storeCountGetters: 'menuCounters/conversionLog',
            },
          },
          {
            name: 'conversion-error',
            path: 'error',
            components: {
              default: () => import('@/recruits/components/conversion/error'),
            },
            meta: {
              scopes: getScopes([
                USER_SCOPES.MILITARY_RECRUIT_SPECIALIST,
                USER_SCOPES.MILITARY_COMMISSAR,
                USER_SCOPES.SYSTEM_ADMINISTRATOR,
                USER_SCOPES.MILITARY_COMMISSARIAT_OBSERVER,
              ]),
              place: 'drawer',
              label: 'Ошибки конвертации',
              storeCountGetters: 'menuCounters/conversionError',
            },
          },
          {
            name: 'conversion-manual',
            path: 'manual',
            components: {
              default: () => import('@/recruits/components/conversion/manual'),
            },
            meta: {
              scopes: getScopes([
                USER_SCOPES.GOMU_SPECIALIST,
                USER_SCOPES.SYSTEM_ADMINISTRATOR,
              ]),
              place: 'drawer',
              label: 'Ручная конвертация',
              storeCountGetters: 'menuCounters/conversionManual',
            },
          },
          //          {
          //            name: 'conversion-specialties-dec',
          //            path: 'specialties',
          //            components: {
          //              default: () =>
          //                import('@/recruits/components/conversion/specialties-dec'),
          //            },
          //            meta: {
          //              place: 'drawer',
          //              label: 'Женщины без ВУС',
          //            },
          //          },
        ],
      },
    ],
  });
}
