OpenLake/Student_Database_COSA

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

Open

#230 创建于 2026年2月18日

在 GitHub 查看
 (0 评论) (0 反应) (0 负责人)JavaScript (56 fork)auto 404
enhancementhelp wanted

仓库指标

Star
 (13 star)
PR 合并指标
 (PR 指标待抓取)

描述

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

贡献者指南