import { RouterView } from 'vue-router';

export default {
    path: '/customer',
    name: 'Customer',
    meta: {
        title: 'customers',
        icon: 'vn:client',
        moduleName: 'Customer',
    },
    component: RouterView,
    redirect: { name: 'CustomerMain' },
    menus: {
        main: [
            'CustomerList',
            'CustomerPayments',
            'CustomerExtendedList',
            'CustomerNotifications',
            'CustomerDefaulter',
        ],
        card: [
            'CustomerBasicData',
            'CustomerFiscalData',
            'CustomerBillingData',
            'CustomerConsignees',
            'CustomerNotes',
            'CustomerCredits',
            'CustomerGreuges',
            'CustomerBalance',
            'CustomerRecoveries',
            'CustomerWebAccess',
            'CustomerLog',
            'CustomerSms',
            'CustomerCreditManagement',
            'CustomerOthers',
        ],
    },
    children: [
        {
            path: '',
            name: 'CustomerMain',
            component: () => import('src/pages/Customer/CustomerMain.vue'),
            redirect: { name: 'CustomerList' },
            children: [
                {
                    path: 'list',
                    name: 'CustomerList',
                    meta: {
                        title: 'list',
                        icon: 'view_list',
                    },
                    component: () => import('src/pages/Customer/CustomerList.vue'),
                },
                {
                    path: 'create',
                    name: 'CustomerCreate',
                    meta: {
                        title: 'create',
                    },
                    component: () => import('src/pages/Customer/CustomerCreate.vue'),
                },
                {
                    path: 'payments',
                    name: 'CustomerPayments',
                    meta: {
                        title: 'webPayments',
                        icon: 'vn:onlinepayment',
                    },
                    component: () =>
                        import('src/pages/Customer/Payments/CustomerPayments.vue'),
                },
                {
                    path: 'extendedList',
                    name: 'CustomerExtendedList',
                    meta: {
                        title: 'extendedList',
                        icon: 'vn:client',
                    },
                    component: () =>
                        import(
                            'src/pages/Customer/ExtendedList/CustomerExtendedList.vue'
                        ),
                },
                {
                    path: 'notifications',
                    name: 'CustomerNotifications',
                    meta: {
                        title: 'notifications',
                        icon: 'notifications',
                    },
                    component: () =>
                        import(
                            'src/pages/Customer/Notifications/CustomerNotifications.vue'
                        ),
                },
                {
                    path: 'defaulter',
                    name: 'CustomerDefaulter',
                    meta: {
                        title: 'defaulter',
                        icon: 'vn:risk',
                    },
                    component: () =>
                        import('src/pages/Customer/Defaulter/CustomerDefaulter.vue'),
                },
            ],
        },
        {
            name: 'CustomerCard',
            path: ':id',
            component: () => import('src/pages/Customer/Card/CustomerCard.vue'),
            redirect: { name: 'CustomerSummary' },
            children: [
                {
                    name: 'CustomerSummary',
                    path: 'summary',
                    meta: {
                        title: 'summary',
                        icon: 'launch',
                    },
                    component: () =>
                        import('src/pages/Customer/Card/CustomerSummary.vue'),
                },
                {
                    path: 'basic-data',
                    name: 'CustomerBasicData',
                    meta: {
                        title: 'basicData',
                        icon: 'vn:settings',
                    },
                    component: () =>
                        import('src/pages/Customer/Card/CustomerBasicData.vue'),
                },
                {
                    path: 'fiscal-data',
                    name: 'CustomerFiscalData',
                    meta: {
                        title: 'fiscalData',
                        icon: 'vn:dfiscales',
                    },
                    component: () =>
                        import('src/pages/Customer/Card/CustomerFiscalData.vue'),
                },
                {
                    path: 'billing-data',
                    name: 'CustomerBillingData',
                    meta: {
                        title: 'billingData',
                        icon: 'vn:payment',
                    },
                    component: () =>
                        import('src/pages/Customer/Card/CustomerBillingData.vue'),
                },
                {
                    path: 'consignees',
                    name: 'ConsigneesCard',
                    redirect: { name: 'CustomerConsignees' },
                    children: [
                        {
                            path: '',
                            name: 'CustomerConsignees',
                            meta: {
                                icon: 'vn:delivery',
                                title: 'consignees',
                            },
                            component: () =>
                                import('src/pages/Customer/Card/CustomerConsignees.vue'),
                        },
                        {
                            path: 'create',
                            name: 'CustomerConsigneeCreate',
                            meta: {
                                title: 'consignee-create',
                            },
                            component: () =>
                                import(
                                    'src/pages/Customer/components/CustomerConsigneeCreate.vue'
                                ),
                        },
                        {
                            path: ':consigneeId',
                            name: 'CustomerConsigneeEditCard',
                            redirect: { name: 'CustomerConsigneeEdit' },
                            children: [
                                {
                                    path: 'edit',
                                    name: 'CustomerConsigneeEdit',
                                    meta: {
                                        title: 'consignee-edit',
                                    },
                                    component: () =>
                                        import(
                                            'src/pages/Customer/components/CustomerConsigneeEdit.vue'
                                        ),
                                },
                            ],
                        },
                    ],
                },
                {
                    path: 'notes',
                    name: 'NotesCard',
                    redirect: { name: 'CustomerNotes' },
                    children: [
                        {
                            path: '',
                            name: 'CustomerNotes',
                            meta: {
                                title: 'notes',
                                icon: 'vn:notes',
                            },
                            component: () =>
                                import('src/pages/Customer/Card/CustomerNotes.vue'),
                        },
                        {
                            path: 'create',
                            name: 'CustomerNoteCreate',
                            meta: {
                                title: 'note-create',
                            },
                            component: () =>
                                import(
                                    'src/pages/Customer/components/CustomerNoteCreate.vue'
                                ),
                        },
                    ],
                },
                {
                    path: 'credits',
                    name: 'CreditsCard',
                    redirect: { name: 'CustomerCredits' },
                    children: [
                        {
                            path: '',
                            name: 'CustomerCredits',
                            meta: {
                                title: 'credits',
                                icon: 'vn:credit',
                            },
                            component: () =>
                                import('src/pages/Customer/Card/CustomerCredits.vue'),
                        },
                        {
                            path: 'create',
                            name: 'CustomerCreditCreate',
                            meta: {
                                title: 'credit-create',
                            },
                            component: () =>
                                import(
                                    'src/pages/Customer/components/CustomerCreditCreate.vue'
                                ),
                        },
                    ],
                },
                {
                    path: 'greuges',
                    name: 'GreugesCard',
                    redirect: { name: 'CustomerGreuges' },
                    children: [
                        {
                            path: '',
                            name: 'CustomerGreuges',
                            meta: {
                                title: 'greuges',
                                icon: 'vn:greuge',
                            },
                            component: () =>
                                import('src/pages/Customer/Card/CustomerGreuges.vue'),
                        },
                        {
                            path: 'create',
                            name: 'CustomerGreugeCreate',
                            meta: {
                                title: 'greuge-create',
                            },
                            component: () =>
                                import(
                                    'src/pages/Customer/components/CustomerGreugeCreate.vue'
                                ),
                        },
                    ],
                },
                {
                    path: 'balance',
                    name: 'CustomerBalance',
                    meta: {
                        title: 'balance',
                        icon: 'vn:invoice',
                    },
                    component: () =>
                        import('src/pages/Customer/Card/CustomerBalance.vue'),
                },
                {
                    path: 'recoveries',
                    name: 'RecoveriesCard',
                    redirect: { name: 'CustomerRecoveries' },
                    children: [
                        {
                            path: '',
                            name: 'CustomerRecoveries',
                            meta: {
                                title: 'recoveries',
                                icon: 'vn:recovery',
                            },
                            component: () =>
                                import('src/pages/Customer/Card/CustomerRecoveries.vue'),
                        },
                        {
                            path: 'create',
                            name: 'CustomerRecoverieCreate',
                            meta: {
                                title: 'recoverie-create',
                            },
                            component: () =>
                                import(
                                    'src/pages/Customer/components/CustomerRecoverieCreate.vue'
                                ),
                        },
                    ],
                },
                {
                    path: 'web-access',
                    name: 'CustomerWebAccess',
                    meta: {
                        title: 'webAccess',
                        icon: 'vn:web',
                    },
                    component: () =>
                        import('src/pages/Customer/Card/CustomerWebAccess.vue'),
                },
                {
                    path: 'log',
                    name: 'CustomerLog',
                    meta: {
                        title: 'log',
                        icon: 'vn:History',
                    },
                    component: () => import('src/pages/Customer/Card/CustomerLog.vue'),
                },
                {
                    path: 'sms',
                    name: 'CustomerSms',
                    meta: {
                        title: 'sms',
                        icon: 'sms',
                    },
                    component: () => import('src/pages/Customer/Card/CustomerSms.vue'),
                },
                {
                    path: 'credit-management',
                    name: 'CustomerCreditManagement',
                    meta: {
                        title: 'creditManagement',
                        icon: 'paid',
                        menuChildren: [
                            {
                                name: 'CustomerCreditContracts',
                                title: 'creditContracts',
                                icon: 'paid',
                            },
                            {
                                name: 'CustomerCreditOpinion',
                                title: 'creditOpinion',
                                icon: 'paid',
                            },
                        ],
                    },
                    component: () =>
                        import('src/pages/Customer/Card/CustomerCreditManagement.vue'),
                    children: [
                        {
                            path: 'credit-contracts',
                            name: 'CustomerCreditContracts',
                            meta: {
                                title: 'creditContracts',
                                icon: 'paid',
                            },
                            component: () =>
                                import(
                                    'src/pages/Customer/Card/CustomerCreditContracts.vue'
                                ),
                        },
                        {
                            path: 'credit-opinion',
                            name: 'CustomerCreditOpinion',
                            meta: {
                                title: 'creditOpinion',
                                icon: 'paid',
                            },
                            component: () =>
                                import(
                                    'src/pages/Customer/Card/CustomerCreditOpinion.vue'
                                ),
                        },
                    ],
                },

                {
                    path: 'others',
                    name: 'CustomerOthers',
                    meta: {
                        title: 'others',
                        icon: 'pending',
                    },
                    component: () => import('src/pages/Customer/Card/CustomerOthers.vue'),
                },
            ],
        },
    ],
};
