import { Routes } from '@angular/router';

import { UserRouteAccessService } from 'app/core/auth/user-route-access.service';
import { ASC } from 'app/config/navigation.constants';
import { InputDataUploadComponent } from './list/input-data-upload.component';
import { InputDataUploadDetailComponent } from './detail/input-data-upload-detail.component';
import { InputDataUploadUpdateComponent } from './update/input-data-upload-update.component';
import InputDataUploadResolve from './route/input-data-upload-routing-resolve.service';
import { SecurityAction } from 'app/security/security-action.model';
import { Resources } from 'app/security/resources.model';
import { InputDataUploadService } from './service/input-data-upload.service';

const inputDataUploadRoute: Routes = [
  {
    path: '',
    component: InputDataUploadComponent,
    canActivate: [UserRouteAccessService],
    data: {
      defaultSort: 'id,' + ASC,
      action: SecurityAction.READ,
      service: InputDataUploadService,
      resource: Resources.INPUT_DATA_UPLOAD,
      authorities: ['ROLE_ADMIN', 'ROLE_MANAGER', 'ROLE_COORDINATOR'],
    }
  },
  {
    path: ':id/view',
    component: InputDataUploadDetailComponent,
    resolve: {
      inputDataUpload: InputDataUploadResolve,
    },
    canActivate: [UserRouteAccessService],
    data: {
      action: SecurityAction.READ,
      service: InputDataUploadService,
      resource: Resources.INPUT_DATA_UPLOAD,
      authorities: ['ROLE_ADMIN', 'ROLE_MANAGER', 'ROLE_COORDINATOR'],
    }
  },
  {
    path: 'new',
    component: InputDataUploadUpdateComponent,
    resolve: {
      inputDataUpload: InputDataUploadResolve,
    },
    canActivate: [UserRouteAccessService],
    data: {
      action: SecurityAction.CREATE,
      service: InputDataUploadService,
      resource: Resources.INPUT_DATA_UPLOAD,
      authorities: ['ROLE_ADMIN', 'ROLE_MANAGER', 'ROLE_COORDINATOR'],
    }
  },
  {
    path: ':id/edit',
    component: InputDataUploadUpdateComponent,
    resolve: {
      inputDataUpload: InputDataUploadResolve,
    },
    canActivate: [UserRouteAccessService],
    data: {
      action: SecurityAction.UPDATE,
      service: InputDataUploadService,
      resource: Resources.INPUT_DATA_UPLOAD,
      authorities: ['ROLE_ADMIN', 'ROLE_MANAGER', 'ROLE_COORDINATOR'],
    }
  },
];

export default inputDataUploadRoute;
