intercept_event.events_controller_views_list:
  path: '/events'
  defaults:
    _controller: '\Drupal\intercept_event\Controller\EventsController::viewsList'
    _title: 'Events'
  requirements:
    _permission: 'access content'

intercept_event.events_controller_views_calendar:
  path: '/events-calendar'
  defaults:
    _controller: '\Drupal\intercept_event\Controller\EventsController::viewsCalendar'
    _title: 'Events'
  requirements:
    _permission: 'access content'
  options:
    _ajax_callback: '\Drupal\intercept_event\Controller\EventsController::viewsCalendarAjax'

intercept_event.account.events:
  path: '/account/events'
  defaults:
    _controller: '\Drupal\intercept_event\Controller\EventsController::myEvents'
    _title: 'Saved Events'
  requirements:
    _user_is_logged_in: 'TRUE'

entity.user.events:
  path: '/user/events'
  defaults:
    _controller: '\Drupal\intercept_event\Controller\EventRegistrationController::manage'
    _title: 'Saved Events'
  requirements:
    _entity_access: 'user.update'
    user: \d+

entity.node.register:
  path: '/event/{node}/register'
  defaults:
    _controller: '\Drupal\intercept_event\Controller\EventRegistrationController::register'
  requirements:
    _custom_access: '\Drupal\intercept_event\Controller\EventsController::registerAccess'

entity.node.guest_register:
  path: '/event/{node}/register/guest'
  defaults:
    _controller: '\Drupal\intercept_event\Controller\EventRegistrationController::guestRegister'
  requirements:
    _custom_access: '\Drupal\intercept_event\Controller\EventsController::registerAccess'

entity.node.registrations:
  path: '/event/{node}/registrations'
  defaults:
    _controller: '\Drupal\intercept_event\Controller\EventsController::registrations'
  requirements:
    _custom_access: '\Drupal\intercept_event\Controller\EventsController::registrationsAccess'

entity.node.ics:
  path: '/event/{node}/download.ics'
  defaults:
    _controller: '\Drupal\intercept_event\Controller\EventRegistrationController::downloadIcs'
  requirements:
    _permission: 'access content'

entity.node.attendance:
  path: '/event/{node}/attendance'
  defaults:
    _controller: '\Drupal\intercept_event\Controller\EventsController::attendance'
  requirements:
    _custom_access: '\Drupal\intercept_event\Controller\EventsController::attendanceAccess'

entity.node.attendance_sheet:
  path: '/event/{node}/attendance-sheet'
  defaults:
    _controller: '\Drupal\intercept_event\Controller\EventsController::getEventAttendanceSheet'
    _title: 'Print Sign-In Sheet'
  requirements:
    _permission: 'access event registrations tab'
  options:
    no_cache: 'TRUE'

entity.node.calendar:
  path: '/event/{node}/calendar'
  defaults:
    _controller: '\Drupal\intercept_event\Controller\EventsController::calendar'
    _title_callback: '\Drupal\intercept_event\Controller\EventsController::getTitle'
  requirements:
    _entity_access: 'node.view'
    _entity_bundle: 'event'

entity.node.checkin:
  path: '/event/{node}/checkin/self'
  defaults:
    _controller: '\Drupal\intercept_event\Controller\EventAttendanceController::selfCheckinForm'
    _title: 'Check in'
  requirements:
    _entity_access: 'node.view'
    _entity_bundle: 'event'

entity.node.scan:
  path: '/event/{node}/checkin'
  defaults:
    _controller: '\Drupal\intercept_event\Controller\EventAttendanceController::scanForm'
    _title: 'Check in'
  requirements:
    _entity_access: 'node.scan'
    _entity_bundle: 'event'

entity.node.scan_guest:
  path: '/event/{node}/checkin/guest'
  defaults:
    _controller: '\Drupal\intercept_event\Controller\EventAttendanceController::scanGuestForm'
    _title: 'Check in'
  requirements:
    _entity_access: 'node.scan'

# entity.node.scan_lookup:
#   path: '/event/{node}/checkin/lookup'
#   defaults:
#     _controller: '\Drupal\intercept_event\Controller\EventAttendanceController::scanLookupForm'
#     _title: 'Lookup'
#   requirements:
#     _entity_access: 'node.scan'

entity.node.template_preview:
  path: '/node/preview/event/{node}'
  defaults:
    _controller: 'intercept_event.manager:previewFromTemplate'
  requirements:
    _entity_access: 'node.template'

entity.node.template:
  path: '/node/add/event/{node}'
  defaults:
    _controller: 'intercept_event.manager:addFromTemplate'
  requirements:
    _entity_access: 'node.template'
  options:
    _admin_route: TRUE

entity.node.recurrence_form:
  path: '/node/{node}/recurrences'
  defaults:
    _entity_form: 'node.recurrence'
  options:
    no_cache: 'TRUE'
    parameters:
      node:
        type: entity:node
  requirements:
    _entity_access: 'node.update'
    _entity_bundle: 'event'
    _custom_access: 'intercept_event.recurring_manager:isRecurrenceBaseEvent'
    _permission: 'update any event_recurrence'

entity.node.template_form:
  path: '/event/{node}/template'
  defaults:
    _entity_form: 'node.template'
  requirements:
    _entity_access: 'node.scan'

entity.node.analysis:
  path: '/event/{node}/analysis'
  defaults:
    _controller: '\Drupal\intercept_event\Controller\EventsController::analysis'
  requirements:
    _entity_access: 'node.analysis'
    _entity_bundle: 'event'

entity.node.staff_evaluations:
  path: '/event/{node}/staff-evaluations'
  defaults:
    _controller: '\Drupal\intercept_event\Controller\EventsController::staffEvaluations'
    _title: 'Staff Comments'
  requirements:
    _entity_access: 'node.analysis'
    _entity_bundle: 'event'

intercept_event.staff_evaluations:
  path: '/event/staff-evaluations'
  defaults:
    _controller: '\Drupal\intercept_event\Controller\EventsController::staffEvaluationsAll'
    _title: 'Staff Comments'
  requirements:
    _permission: 'analyze events'

entity.node.customer_evaluations:
  path: '/event/{node}/customer-evaluations'
  defaults:
    _controller: '\Drupal\intercept_event\Controller\EventsController::customerEvaluations'
    _title: 'Customer Feedback'
  requirements:
    _entity_access: 'node.analysis'
    _entity_bundle: 'event'

intercept_event.customer_evaluations:
  path: '/event/customer-evaluations'
  defaults:
    _controller: '\Drupal\intercept_event\Controller\EventsController::customerEvaluationsAll'
    _title: 'Customer Feedback'
  requirements:
    _permission: 'analyze events'

intercept_event.api.attendance_update:
  path: '/api/attendance/update'
  methods: [POST]
  defaults:
    _controller: 'intercept_event.manager:updateAttendance'
  requirements:
    _role: 'intercept_staff + intercept_system_admin + administrator'

intercept_event.api.attendee_create:
  path: '/api/attendee/create'
  methods: [POST]
  defaults:
      _controller: 'intercept_event.manager:createAttendee'
  requirements:
      _role: 'intercept_staff + intercept_system_admin + administrator'

intercept_event.api.event.evaluate:
  path: '/api/event/evaluate'
  #/{entity_type_id}/{entity_id}/{vote_type_id}/{value}
  methods: [POST, DELETE]
  defaults:
    _controller: '\Drupal\intercept_event\Controller\EventEvaluationController::evaluate'
  requirements:
    _permission: 'update own event evaluation+update any event evaluation'

intercept_event.api.event.analysis:
  path: '/api/event/analysis'
  methods: [POST, GET]
  defaults:
    _controller: '\Drupal\intercept_event\Controller\EventEvaluationController::analysis'
  requirements:
    _permission: 'analyze events'

intercept_event.api.event.user_registrations_by_event:
  path: '/api/event/user-event-registrations'
  methods: [POST, GET]
  defaults:
    _controller: '\Drupal\intercept_event\Controller\EventRegistrationController::userRegistrationsByEventId'
  requirements:
    _access: 'TRUE'

intercept_event.api.event.guest_registrations_by_event:
  path: '/api/event/guest-event-registrations'
  methods: [POST, GET]
  defaults:
    _controller: '\Drupal\intercept_event\Controller\EventRegistrationController::guestRegistrationsByEventId'
  requirements:
    _access: 'TRUE'

intercept_event.saved_event.settings:
  path: '/admin/structure/intercept/saved_event/settings'
  defaults:
    _title: 'Saved Events Settings'
    _form: \Drupal\intercept_event\Form\EventSavedSettingsForm
  requirements:
    _role: 'intercept_system_admin + administrator'

intercept_event.location.autocomplete:
  path: '/admin/api/event/location-autocomplete/{field_name}/{count}/{entity_type_id}'
  defaults:
    _controller: '\Drupal\intercept_event\Controller\LocationAutocompleteController::handleAutocomplete'
    _title: 'Handle Autocomplete of text fields with existing values'
    _format: json
    field_name: NULL
    count: 10
    entity_type_id: NULL
  requirements:
    _access: 'TRUE'

intercept_event.checkin.settings:
  path: '/manage/event-configuration/checkin'
  defaults:
    _form: '\Drupal\intercept_event\Form\EventCheckinSettingsForm'
    _title: 'Event Check-in Settings'
  requirements:
    _role: 'intercept_system_admin + administrator'

intercept_event.api.checkin.invalidate_period_cache:
  path: '/api/event/invalidate-checkin-period'
  methods: [GET]
  options:
    no_cache: 'TRUE'
  defaults:
    _controller: '\Drupal\intercept_event\Controller\EventCheckinPeriodController::invalidateCheckinPeriods'
  requirements:
    _access: 'TRUE'

intercept_event.reset.login:
  path: '/event/evaluate/{uid}/{timestamp}/{hash}/login'
  defaults:
    _title: 'Login using magic link'
    _controller: '\Drupal\intercept_event\Controller\InterceptEventUserController::resetPassLogin'
  requirements:
    _access: 'TRUE'
  options:
    _maintenance_access: TRUE
    no_cache: TRUE

intercept_event.list.settings:
  path: '/manage/event-configuration/list'
  defaults:
    _form: '\Drupal\intercept_event\Form\EventSettingsForm'
    _title: 'Event Settings'
  requirements:
    _role: 'intercept_system_admin + administrator'

intercept_event.disclaimers:
  path: '/manage/disclaimers'
  defaults:
      _controller: '\Drupal\intercept_event\Controller\EventsController::disclaimers'
      _title: 'Event Disclaimers'
  requirements:
    _role: 'intercept_staff + intercept_system_admin + administrator'
