entity.user.room_reservations:
  path: '/user/room-reservations'
  defaults:
    _controller: '\Drupal\intercept_room_reservation\Controller\RoomReservationController::upcoming'
    _title: 'Room Reservations'
  requirements:
    _access: 'TRUE'

entity.node.reservations:
  path: '/node/{node}/reservations'
  defaults:
    _controller: '\Drupal\intercept_room_reservation\Controller\RoomReservationController::reservations'
  requirements:
    node: \d+
    _entity_access: 'node.update'
    _entity_bundle: 'room'
    _permission: 'administer nodes'
  options:
    _admin_route: TRUE

intercept_room_reservation.reservation.terms:
  path: '/room-reservation/terms'
  defaults:
    _controller: '\Drupal\intercept_room_reservation\Controller\RoomReservationTermsController::view'
    _title: 'Terms and Conditions'
  requirements:
    _access: 'TRUE'

intercept_room_reservation.reservation.add:
  path: '/room-reservation/add'
  defaults:
    # _form: '\Drupal\intercept_room_reservation\Form\RoomReservationForm'
    # _controller: '\Drupal\intercept_room_reservation\Controller\RoomReservationController::add'
    _title: 'Create Reservation'
  requirements:
    # _entity_access: 'room_reservation.update'
    # _entity_bundle: 'room_reservation'
    _access: 'TRUE'

intercept_room_reservation.reservation.copy:
  path: '/manage/room-reservations/{room_reservation}/duplicate'
  defaults:
    _title: 'Copy a room reservation'
    _controller: '\Drupal\intercept_room_reservation\Controller\RoomReservationCopyController::build'
  requirements:
    _permission: 'copy room reservations'

intercept_room_reservation.reservation.edit:
  path: '/manage/room-reservations/{room_reservation}/edit'
  defaults:
    _controller: '\Drupal\intercept_room_reservation\Controller\RoomReservationController::edit'
    _title: 'Edit Reservation'
  requirements:
    room_reservation: \d+
    _entity_access: 'room_reservation.update'
    _entity_bundle: 'room_reservation'

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

intercept_room_reservation.reserve_room:
  path: '/reserve-room/by-room'
  defaults:
    _controller: '\Drupal\intercept_room_reservation\Controller\RoomReservationController::reserve'
    _title: 'Reserve a Room'
  requirements:
    _access: 'TRUE'

intercept_room_reservation.select_type:
  path: '/reserve-room'
  defaults:
    _controller: '\Drupal\intercept_room_reservation\Controller\RoomReservationController::selector'
    _title: 'Reserve a room'
  requirements:
    _access: 'TRUE'

intercept_room_reservation.room.view:
  path: '/room/{node}'
  defaults:
    _controller: '\Drupal\intercept_room_reservation\Controller\RoomReservationRoomController::view'
    _title: 'Room Details'
  requirements:
    _access: 'TRUE'

intercept_room_reservation.reserve_room_calendar:
  path: '/reserve-room/by-calendar'
  defaults:
    _controller: '\Drupal\intercept_room_reservation\Controller\RoomReservationController::schedulerCustomer'
    _title: 'Reserve a Room'
  requirements:
    _access: 'TRUE'

intercept_room_reservation.scheduler:
  path: '/manage/room-reservations/calendar'
  defaults:
    _controller: '\Drupal\intercept_room_reservation\Controller\RoomReservationController::schedulerStaff'
    _title: 'Room Reservations'
  requirements:
    _permission: 'update any room_reservation'

intercept_room_reservation.account.room_reservations:
  path: '/account/room-reservations'
  defaults:
    _controller: '\Drupal\intercept_core\Controller\UserAccount::userRedirect'
    _title: 'Room Reservations'
    route_name: 'entity.user.room_reservations'
  requirements:
    _user_is_logged_in: 'TRUE'

intercept_room_reservation.account.room_reservations_past:
  path: '/account/room-reservations-past'
  defaults:
    _controller: '\Drupal\intercept_core\Controller\UserAccount::userRedirect'
    _title: 'Room Reservations'
    route_name: 'view.intercept_room_reservations.page_1'
  requirements:
    _user_is_logged_in: 'TRUE'

intercept_room_reservation.api.reserve:
  path: '/api/rooms/reserve'
  defaults:
    _controller: '\Drupal\intercept_room_reservation\Controller\RoomReservationController::reserveRoom'
  methods: [POST, GET]
  requirements:
    _user_is_logged_in: 'TRUE'

intercept_room_reservation.api.user_status:
  path: '/api/rooms/user/status'
  methods: [POST, GET]
  defaults:
    _controller: 'Drupal\intercept_room_reservation\Controller\RoomReservationController::userStatus'
  requirements:
    _user_is_logged_in: 'TRUE'

intercept_room_reservation.api.availability:
  path: '/api/rooms/availability'
  methods: [POST, GET]
  defaults:
    _controller: 'Drupal\intercept_room_reservation\Controller\RoomReservationController::availability'
  requirements:
    _access: 'TRUE'

intercept_room_reservation.api.availability.refreshed_on:
  path: '/api/rooms/availability/refreshed-on'
  methods: [GET]
  defaults:
    _controller: 'Drupal\intercept_room_reservation\Controller\RoomReservationController::refreshedOn'
  requirements:
    _access: 'TRUE'

intercept_room_reservation.reservation.version_history:
  path: '/manage/room-reservations/{room_reservation}/version-history'
  defaults:
    _controller: '\Drupal\intercept_room_reservation\Controller\RoomReservationVersionController::revisionOverviewController'
    _title: 'View Reservation History'
  options:
    parameters:
      room_reservation:
        type: entity:room_reservation
  requirements:
    room_reservation: \d+
    _entity_access: 'room_reservation.update'
    _entity_bundle: 'room_reservation'
