import { RouterView } from 'vue-router';

export default {
    path: '/worker',
    name: 'Worker',
    meta: {
        title: 'workers',
        icon: 'vn:worker',
        moduleName: 'Worker',
        keyBinding: 'w',
    },
    component: RouterView,
    redirect: { name: 'WorkerMain' },
    menus: {
        main: ['WorkerList', 'WorkerDepartment'],
        card: [
            'WorkerBasicData',
            'WorkerNotes',
            'WorkerPda',
            'WorkerNotificationsManager',
            'WorkerPBX',
            'WorkerLog',
            'WorkerCalendar',
            'WorkerDms',
            'WorkerTimeControl',
            'WorkerLocker',
            'WorkerBalance',
            'WorkerFormation',
            'WorkerMedical',
            'WorkerOperator',
        ],
    },
    children: [
        {
            path: '',
            name: 'WorkerMain',
            component: () => import('src/components/common/VnSectionMain.vue'),
            redirect: { name: 'WorkerList' },
            children: [
                {
                    path: 'list',
                    name: 'WorkerList',
                    meta: {
                        title: 'list',
                        icon: 'view_list',
                    },
                    component: () => import('src/pages/Worker/WorkerList.vue'),
                },
                {
                    path: 'department',
                    name: 'WorkerDepartment',
                    meta: {
                        title: 'department',
                        icon: 'vn:greuge',
                    },
                    component: () => import('src/pages/Worker/WorkerDepartment.vue'),
                },
                {
                    path: 'create',
                    name: 'WorkerCreate',
                    meta: {
                        title: 'workerCreate',
                        icon: 'add',
                    },
                    component: () => import('src/pages/Worker/WorkerCreate.vue'),
                },
            ],
        },
        {
            name: 'WorkerCard',
            path: ':id',
            component: () => import('src/pages/Worker/Card/WorkerCard.vue'),
            redirect: { name: 'WorkerSummary' },
            children: [
                {
                    name: 'WorkerSummary',
                    path: 'summary',
                    meta: {
                        title: 'summary',
                        icon: 'launch',
                    },
                    component: () => import('src/pages/Worker/Card/WorkerSummary.vue'),
                },
                {
                    path: 'basic-data',
                    name: 'WorkerBasicData',
                    meta: {
                        title: 'basicData',
                        icon: 'vn:settings',
                    },
                    component: () => import('src/pages/Worker/Card/WorkerBasicData.vue'),
                },
                {
                    path: 'notes',
                    name: 'NotesCard',
                    redirect: { name: 'WorkerNotes' },
                    children: [
                        {
                            path: '',
                            name: 'WorkerNotes',
                            meta: {
                                title: 'notes',
                                icon: 'vn:notes',
                            },
                            component: () =>
                                import('src/pages/Worker/Card/WorkerNotes.vue'),
                        },
                    ],
                },
                {
                    name: 'WorkerTimeControl',
                    path: 'time-control',
                    meta: {
                        title: 'timeControl',
                        icon: 'access_time',
                    },
                    component: () =>
                        import('src/pages/Worker/Card/WorkerTimeControl.vue'),
                },
                {
                    name: 'WorkerCalendar',
                    path: 'calendar',
                    meta: {
                        title: 'calendar',
                        icon: 'calendar_today',
                    },
                    component: () => import('src/pages/Worker/Card/WorkerCalendar.vue'),
                },
                {
                    name: 'WorkerPda',
                    path: 'pda',
                    meta: {
                        title: 'pda',
                        icon: 'phone_android',
                    },
                    component: () => import('src/pages/Worker/Card/WorkerPda.vue'),
                },
                {
                    name: 'WorkerNotificationsManager',
                    path: 'notifications',
                    meta: {
                        title: 'notifications',
                        icon: 'notifications',
                    },
                    component: () =>
                        import('src/pages/Worker/Card/WorkerNotificationsManager.vue'),
                },
                {
                    path: 'pbx',
                    name: 'WorkerPBX',
                    meta: {
                        title: 'pbx',
                        icon: 'vn:pbx',
                    },
                    component: () => import('src/pages/Worker/Card/WorkerPBX.vue'),
                },
                {
                    name: 'WorkerDms',
                    path: 'dms',
                    meta: {
                        title: 'dms',
                        icon: 'cloud_upload',
                    },
                    component: () => import('src/pages/Worker/Card/WorkerDms.vue'),
                },
                {
                    name: 'WorkerLog',
                    path: 'log',
                    meta: {
                        title: 'log',
                        icon: 'vn:History',
                        acls: [{ model: 'WorkerLog', props: 'find', accessType: 'READ' }],
                    },
                    component: () => import('src/pages/Worker/Card/WorkerLog.vue'),
                },
                {
                    name: 'WorkerLocker',
                    path: 'locker',
                    meta: {
                        title: 'locker',
                        icon: 'lock',
                    },
                    component: () => import('src/pages/Worker/Card/WorkerLocker.vue'),
                },
                {
                    name: 'WorkerBalance',
                    path: 'balance',
                    meta: {
                        title: 'balance',
                        icon: 'balance',
                    },
                    component: () => import('src/pages/Worker/Card/WorkerBalance.vue'),
                },
                {
                    name: 'WorkerFormation',
                    path: 'formation',
                    meta: {
                        title: 'formation',
                        icon: 'clinical_notes',
                    },
                    component: () => import('src/pages/Worker/Card/WorkerFormation.vue'),
                },
                {
                    name: 'WorkerMedical',
                    path: 'medical',
                    meta: {
                        title: 'medical',
                        icon: 'medical_information',
                    },
                    component: () => import('src/pages/Worker/Card/WorkerMedical.vue'),
                },
                {
                    name: 'WorkerOperator',
                    path: 'operator',
                    meta: {
                        title: 'operator',
                        icon: 'person',
                    },
                    component: () => import('src/pages/Worker/Card/WorkerOperator.vue'),
                },
            ],
        },
    ],
};
