Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Endpoint for study room availability #2

Closed
2 tasks
andrew-wang0 opened this issue Oct 24, 2024 · 2 comments
Closed
2 tasks

Endpoint for study room availability #2

andrew-wang0 opened this issue Oct 24, 2024 · 2 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@andrew-wang0
Copy link
Member

Summary

Create endpoints for study_room data

  • REST endpoint for study_room data
  • GraphQL endpoint for study_room data
@andrew-wang0 andrew-wang0 added the enhancement New feature or request label Oct 24, 2024
@andrew-wang0 andrew-wang0 added this to the Nov 13 milestone Oct 24, 2024
ecxyzzy added a commit that referenced this issue Nov 24, 2024
## Description

Created GraphQL and REST endpoints to provide study room data, namely:

- allStudyRooms: Returns the id, name, capacity, location, and
techEnhanced fields for each study room in the database.
- studyRoomById: Returns the id, name, capacity, location, techEnhanced,
description, and directions for a specific room, if available.
- studyRoomsByFilters: Filters and returns study rooms based on query
parameters (location, capacityMin, capacityMax, isTechEnhanced),
providing the same fields as allStudyRooms.

Added description and directions fields to the studyRoomById endpoint to
provide more details for each specific room.


## Related Issue

resolves issue #2 

## Motivation and Context

These endpoints provide structured access to study room data in both
REST and GraphQL formats, fulfilling the requirements outlined in issue
#2. These changes allow users to access study room details as a whole,
retrieve data for a specific room, or filter rooms based on criteria
like location and capacity. This functionality is essential for making
study room data available through the API in a scalable and flexible
way.

## How Has This Been Tested?

Tested locally on a development server using Postman. Verified:

REST Endpoints:

Access to /v2/rest/study-rooms/all returns all rooms.
Access to /v2/rest/study-rooms/{id} returns data for a specific room by
ID.
Access to /v2/rest/study-rooms with query parameters returns filtered
results.

GraphQL Queries:

Querying allStudyRooms returns a list of all study rooms with the
expected fields.
Querying studyRoom(id: "<room_id>") returns details for a specific room,
including description and directions if they are present.
Querying studyRooms(query: { location: "Science Library", capacityMin: 4
}) returns filtered results based on location and capacity.

## Types of changes

- [ ] Bug fix (non-breaking change which fixes an issue)
- [X] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to change)

## Checklist:

- [ ] My code involves a change to the database schema.
- [X] My code requires a change to the documentation.

---------

Co-authored-by: Sanskar Mishra <[email protected]>
Co-authored-by: Sanskar Mishra <[email protected]>
Co-authored-by: Eddy Chen <[email protected]>
Co-authored-by: Andrew Wang <[email protected]>
@ecxyzzy ecxyzzy closed this as completed Nov 24, 2024
@alexanderl19
Copy link
Member

Wooo nice! Also are we not yet returning availability? Tried a couple ids and didn't get the slots field.

@ecxyzzy
Copy link
Member

ecxyzzy commented Nov 24, 2024

Wooo nice! Also are we not yet returning availability? Tried a couple ids and didn't get the slots field.

Yeah we're not returning availability yet - tracking the follow-up in #46

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants