import { RoutesService, eLayoutType } from '@abp/ng.core';
import { APP_INITIALIZER } from '@angular/core';

export const APP_ROUTE_PROVIDER = [
  { provide: APP_INITIALIZER, useFactory: configureRoutes, deps: [RoutesService], multi: true },
];

function configureRoutes(routesService: RoutesService) {
  return () => {
    routesService.add([
      {
        path: '/',
        name: '::Menu:Home',
        iconClass: 'fas fa-home',
        order: 1,
        layout: eLayoutType.application,
      },
      {
        path: '/appointment',
        name: 'Appointments',
        order: 101,
        iconClass: 'fas fa-notes-medical',
        layout: eLayoutType.application,
      },
      {
        path: '/appointment/appointment-calendar',
        name: ' Appointment Calendar',
        parentName: 'Appointments',
        iconClass: 'fas fa-clock',
        order: 102,
      },
      {
        path: '/appointment/view-appointment',
        name: 'View Appointment',
        parentName: 'Appointments',
        iconClass: 'fas fa-clock',
        order: 103,
      },
      {
        path: '/appointment/book-appointment',
        name: 'Book Appointment',
        parentName: 'Appointments',
        iconClass: 'fas fa-clock',
        order: 104,
      },
      {
        path: '/appointment/edit-appointment',
        name: 'Edit Appointment',
        parentName: 'Appointments',
        iconClass: 'fas fa-clock',
        order: 105,
      },
      {
        path: '/patients',
        name: 'Patients',
        iconClass: 'fas fa-notes-medical',
        order: 201,
        layout: eLayoutType.application,
        requiredPolicy:'HospitalManagementSystem.Patient'
      },
      {
        path: '/patients/all-patients',
        name: 'All Patients',
        parentName: 'Patients',
        iconClass: 'fas fa-clock',
        order: 202,
        requiredPolicy:'HospitalManagementSystem.Patient'
      },
      // {
      //   path: '/patients/patient-record',
      //   name: 'Patient Record',
      //   parentName: 'Patients',
      //   iconClass: 'fas fa-clock',
      //   order: 203,
      //   requiredPolicy:'HospitalManagementSystem.Patient'
      // },
    ]);
  };
}
