OpenLake/Student_Database_COSA

[FOSSOVERFLOW-25] feat: Implement Room Dropdown Using Dedicated Rooms Table

Open

#230 aperta il 18 feb 2026

Vedi su GitHub
 (0 commenti) (0 reazioni) (0 assegnatari)JavaScript (56 fork)auto 404
enhancementhelp wanted

Metriche repository

Star
 (13 star)
Metriche merge PR
 (Metriche PR in attesa)

Descrizione

Description

Currently, room names are entered manually while booking, which can lead to inconsistencies and errors.

We need to introduce a dedicated rooms table/collection and use it to populate a dropdown in the booking UI.


Proposed Database Schema

Create a new table/collection:

Room {
  room_id: String,
  location: String,
  allowed_roles: [String]
}

Example

{
  "room_id": "SCITECH_101",
  "location": "SciTech Building, Floor 1",
  "allowed_roles": [
    "scitech_core",
    "scitech_coordinator",
    "gensec_scitech"
  ]
}
  • By default, allowed_roles = ["all"]
  • Restricted rooms (e.g., SciTech rooms) will have limited access

Backend Requirements

  • Create Room model/schema
  • CRUD APIs for rooms (admin only)
  • API to fetch available rooms based on user role
  • Validate room access during booking

Frontend Requirements

  • Replace text input with dropdown
  • Fetch rooms from backend
  • Show only rooms user is allowed to book
  • Disable/Hide unauthorized rooms

Authorization Rules

  • Backend must verify:

    • User role ∈ room.allowed_roles
  • Prevent bypass via API calls


Acceptance Criteria

  • Rooms stored in dedicated DB collection
  • Dropdown replaces manual input
  • Role-based filtering works
  • Unauthorized bookings are blocked
  • Admins can manage rooms

Guida contributor