intercept_core.settings:
  path: '/admin/config/intercept'
  defaults:
    _controller: '\Drupal\system\Controller\SystemController::systemAdminMenuBlockPage'
    _title: 'Intercept Settings'
  requirements:
    _permission: 'access administration pages'

intercept_core.general:
  path: '/admin/config/intercept/general'
  defaults:
    _form: '\Drupal\intercept_core\Form\SettingsForm'
    _title: 'Intercept General'
  requirements:
    _permission: 'administer intercept_core'

intercept_core.admin_structure:
  path: '/admin/structure/intercept'
  defaults:
    _controller: '\Drupal\system\Controller\SystemController::systemAdminMenuBlockPage'
    _title: 'Intercept'
  requirements:
    _permission: 'access administration pages'

intercept_core.account.settings:
  path: '/account/settings'
  defaults:
    _controller: '\Drupal\intercept_core\Controller\UserAccount::userRedirect'
    _title: 'Settings'
    route_name: 'entity.user.customer_form'
  requirements:
    _role: 'intercept_registered_customer'

entity.user.customer_form:
  path: '/user/settings/{user}'
  defaults:
    _entity_form: 'user.customer'
    _title_callback: 'Drupal\user\Controller\UserController::userTitle'
  requirements:
    user: '\d+'
    _entity_access: 'user.update'

# entity.room_reservation.change_status_form:
#   path: '/room-reservation/{room_reservation}/change-status'
#   defaults:
#     _entity_form: 'room_reservation.change_status'
#     _title: 'Reservation Status'
#   options:
#     parameters:
#       room_reservation:
#         type: entity:room_reservation
#   requirements:
#     room_reservation: \d+
#     _entity_access: 'room_reservation.update'
#     _entity_bundle: 'room_reservation'

# "Profile" link for staff
intercept_core.user_edit:
  path: '/account/edit'
  defaults:
    _controller: '\Drupal\intercept_core\Controller\UserAccount::userRedirect'
    _title: 'Profile'
    route_name: 'entity.user.edit_form'
  requirements:
    _role: 'intercept_equipment_reservation_manager + intercept_event_manager + intercept_staff + intercept_system_admin + administrator'

intercept_core.admin_permissions:
  path: '/admin/config/intercept/permissions'
  defaults:
    _form: '\Drupal\intercept_core\Form\UserPermissionsForm'
    _title: 'Permissions'
  requirements:
    _permission: 'administer permissions'

intercept_core.api.user_email_exists:
  path: '/api/user/email-exists'
  defaults:
    _controller: '\Drupal\intercept_core\Controller\UserAccount::userEmailExistsApi'
    _title: 'Search User by Email'
  requirements:
    _access: 'TRUE'

intercept_core.api.customer_search:
  path: '/api/customer/search'
  defaults:
    _controller: '\Drupal\intercept_core\Controller\UserAccount::customerSearchApi'
    _title: 'Customer Search'
  requirements:
    _permission: 'search customer'

intercept_core.api.customer_register:
  path: '/api/customer/register'
  defaults:
    _controller: '\Drupal\intercept_core\Controller\UserAccount::customerRegisterApi'
    _title: 'Register customer'
  requirements:
    _permission: 'search customer'
