import { RouterView } from 'vue-router';

export default {
    name: 'Claim',
    path: '/claim',
    meta: {
        title: 'claims',
        icon: 'vn:claims',
        moduleName: 'Claim',
        keyBinding: 'r',
    },
    component: RouterView,
    redirect: { name: 'ClaimMain' },
    menus: {
        main: ['ClaimList'],
        card: [
            'ClaimBasicData',
            'ClaimLines',
            'ClaimPhotos',
            'ClaimNotes',
            'ClaimDevelopment',
            'ClaimAction',
            'ClaimLog',
        ],
    },
    children: [
        {
            name: 'ClaimMain',
            path: '',
            component: () => import('src/components/common/VnSectionMain.vue'),
            redirect: { name: 'ClaimList' },
            children: [
                {
                    name: 'ClaimList',
                    path: 'list',
                    meta: {
                        title: 'list',
                        icon: 'view_list',
                    },
                    component: () => import('src/pages/Claim/ClaimList.vue'),
                },
            ],
        },
        {
            name: 'ClaimCard',
            path: ':id',
            component: () => import('src/pages/Claim/Card/ClaimCard.vue'),
            redirect: { name: 'ClaimSummary' },
            children: [
                {
                    name: 'ClaimSummary',
                    path: 'summary',
                    meta: {
                        title: 'summary',
                        icon: 'launch',
                    },
                    component: () => import('src/pages/Claim/Card/ClaimSummary.vue'),
                },
                {
                    name: 'ClaimBasicData',
                    path: 'basic-data',
                    meta: {
                        title: 'basicData',
                        icon: 'vn:settings',
                        acls: [{ model: 'Claim', props: 'findById', accessType: 'READ' }],
                    },
                    component: () => import('src/pages/Claim/Card/ClaimBasicData.vue'),
                },
                {
                    name: 'ClaimLines',
                    path: 'lines',
                    meta: {
                        title: 'lines',
                        icon: 'vn:details',
                    },
                    component: () => import('src/pages/Claim/Card/ClaimLines.vue'),
                },
                {
                    name: 'ClaimPhotos',
                    path: 'photos',
                    meta: {
                        title: 'photos',
                        icon: 'image',
                    },
                    component: () => import('src/pages/Claim/Card/ClaimPhoto.vue'),
                },
                {
                    name: 'ClaimNotes',
                    path: 'notes',
                    meta: {
                        title: 'notes',
                        icon: 'draft',
                    },
                    component: () => import('src/pages/Claim/Card/ClaimNotes.vue'),
                },
                {
                    name: 'ClaimDevelopment',
                    path: 'development',
                    meta: {
                        title: 'development',
                        icon: 'vn:traceability',
                        acls: [
                            {
                                model: 'ClaimDevelopment',
                                props: '*',
                                accessType: 'WRITE',
                            },
                        ],
                    },
                    component: () => import('src/pages/Claim/Card/ClaimDevelopment.vue'),
                },
                {
                    name: 'ClaimAction',
                    path: 'action',
                    meta: {
                        title: 'action',
                        icon: 'vn:actions',
                    },
                    component: () => import('src/pages/Claim/Card/ClaimAction.vue'),
                },
                {
                    name: 'ClaimLog',
                    path: 'log',
                    meta: {
                        title: 'log',
                        icon: 'history',
                    },
                    component: () => import('src/pages/Claim/Card/ClaimLog.vue'),
                },
            ],
        },
    ],
};
