openapi: 3.0.0

info:
    version: 2.2.0
    title: ShipME API
    description: Provides methods for the retrieval, creation, manipulation, and deletion of ShipME application data

servers:
    - url: http://localhost:3000/api
      description: Local development server (Docker)

components:
    schemas:
        User:
            type: object
            description: An object representing a user of the ShipME application
            properties:
                user_id:
                    type: integer
                    description: The User's unique ID (database primary key)
                    readOnly: true
                first_name:
                    type: string
                    description: The User's first name
                last_name:
                    type: string
                    description: The User's last name
                email_address:
                    type: string
                    format: email
                    pattern: '^[a-zA-Z0-9._%+-]+@clemson\.edu$' # Require @clemson.edu email addresses
                    description: The User's email address (`@clemson.edu`)
                type:
                    type: string
                    enum:
                        - 'instructor'
                        - 'ta'
                        - 'student'
                    description: The User's type
                receive_emails:
                    type: string
                    enum:
                        - 'always'
                        - 'on_deliveries'
                        - 'on_custom'
                    description: The User's preference for receiving email notifications
                    default: 'on_custom'
                team_id:
                    type: integer
                    description: The User's Team `team_id` (where `type` is `student`)
                section_id:
                    type: integer
                    description: The User's `section_id` (where `type` is `student`)
                is_admin:
                    type: string
                    enum:
                        - 'true'
                        - 'incoming'
                        - 'false'
                    description: Whether the User is the administrator user (where `type` is `instructor`)
                    default: 'false'
            required:
                - user_id
                - first_name
                - last_name
                - email_address
                - type
        Instructor:
            type: object
            description: An object representing an instructor User
            properties:
                instructor_id:
                    type: integer
                    description: The Instructor's unique ID (database primary key)
                    readOnly: true
                user_id:
                    type: integer
                    description: The `user_id` of the Instructor's associated User object
                is_admin:
                    type: string
                    enum:
                        - 'true'
                        - 'incoming'
                        - 'false'
                    description: Whether the User is the administrator user (where `type` is `instructor`)
                    default: 'false'
            required:
                - instructor_id
                - user_id
                - is_admin
        TA:
            type: object
            description: An object representing a TA User
            properties:
                ta_id:
                    type: integer
                    description: The TA's unique ID (database primary key)
                    readOnly: true
                user_id:
                    type: integer
                    description: The `user_id` of the TA's associated User object
            required:
                - ta_id
                - user_id
        Student:
            type: object
            description: An object representing a student User
            properties:
                student_id:
                    type: integer
                    description: The Student's unique ID (database primary key)
                    readOnly: true
                user_id:
                    type: integer
                    description: The `user_id` of the Student's associated User object
                team_id:
                    type: integer
                    description: The `team_id` of the Team the Student is a part of
                section_id:
                    type: integer
                    description: The section ID/\# the Student belongs to
            required:
                - student_id
                - user_id
        Team:
            type: object
            description: An object representing a team comprised of Students
            properties:
                team_id:
                    type: integer
                    description: The Team's unique ID (database primary key)
                    readOnly: true
                team_num:
                    type: integer
                    description: The team's team number
                name:
                    type: string
                    description: The Team's name
                section_id:
                    type: integer
                    description: The section ID/\# the Team belongs to
                locker_num:
                    type: integer
                    description: The locker number assigned to the team
            required:
                - team_id
                - team_num
                - section_id
        Supplier:
            type: object
            description: An object representing a supplier of Parts
            properties:
                supplier_id:
                    type: integer
                    description: The Supplier's unique ID
                    readOnly: true
                url:
                    type: string
                    format: uri
                    description: The Supplier's top level domain (i.e., `http://amazon.com`)
                name:
                    type: string
                    description: The Supplier's top level domain, without the protocol or extension (i.e., `amazon`)
            required:
                - supplier_id
                - url
                - name
        Part:
            type: object
            description: An object representing a part being requested by a Student
            properties:
                part_id:
                    type: integer
                    description: The Part's unique ID (database primary key)
                    readOnly: true
                url:
                    type: string
                    format: uri
                    description: The Part's web link (i.e., `http://amazon.com/...`)
                part_num:
                    type: string
                    description: The Part's number (if applicable)
                supplier_id:
                    type: integer
                    description: The `supplier_id` of the Part's Supplier
                description:
                    type: string
                    description: The Part's name/description # Could be the product title
                price:
                    type: number
                    description: The Part's price (in $)
                    minimum: 0
                    exclusiveMinimum: true # Require that price be greater than 0
            required:
                - part_id
                - url
                - supplier_id
                - description
                - price
        Request:
            type: object
            description: An object representing a request for a Part by a Student
            properties:
                request_id:
                    type: integer
                    description: The Request's unique ID (database primary key)
                    readOnly: true
                request_timestamp:
                    type: string
                    format: date-time
                    description: The timestamp of the Request's creation
                    readOnly: true
                student_id:
                    type: integer
                    description: The `student_id` of the Student making the Request
                team_id:
                    type: integer
                    description: The `team_id` of the Team making the Request
                supplier_id:
                    type: integer
                    description: The `supplier_id` of the Supplier associated with the Request
                part_id:
                    type: integer
                    description: The `part_id` of the requested Part
                order_id:
                    type: integer
                    description: The `order_id` of the Order associated with the Request
                status:
                    type: string
                    enum:
                        - 'requested'
                        - 'approved'
                        - 'ordered'
                        - 'delivered'
                        - 'delayed'
                        - 'reordered'
                        - 'on hand'
                        - 'cancelled'
                        - 'other'
                    description: The Request's status
                quantity:
                    type: integer
                    minimum: 0
                    exclusiveMinimum: true # Require that quantity be at least 1
                    description: The quantity of the requested Part
                subtotal:
                    type: number
                    minimum: 0
                    exclusiveMinimum: true # Require that the total be more than $0
                    description: The Request subtotal (in $)
            required:
                - request_id
                - request_timestamp
                - student_id
                - team_id
                - part_id
                - status
                - quantity
        Order:
            type: object
            description: A representation of an order with a Supplier comprised of Parts
            properties:
                order_id:
                    type: integer
                    description: The Order's unique ID (database primary key)
                    readOnly: true
                order_timestamp:
                    type: string
                    format: date-time
                    description: The timestamp of the Order's creation
                    readOnly: true
                instructor_id:
                    type: integer
                    description: The `instructor_id` of the Instructor who created the Order
                supplier_id:
                    type: integer
                    description: The `supplier_id` of the Supplier whom the Order is placed with
                is_fulfilled:
                    type: boolean
                    description: Whether the Order has been fulfilled by the Supplier
                total:
                    type: number
                    minimum: 0
                    exclusiveMinimum: true # Require that the total be more than $0
                    description: The Order total (in $)
            required:
                - order_id
                - order_timestamp
                - instructor_id
                - supplier_id
                - is_fulfilled
                - total
        Notification:
            type: object
            description: A representation of a notification sent by an Instructor to a Student
            properties:
                notification_id:
                    type: integer
                    description: The Notifications's unique ID (database primary key)
                    readOnly: true
                notification_timestamp:
                    type: string
                    format: date-time
                    description: The timestamp of the Notification's creation
                    readOnly: true
                request_id:
                    type: integer
                    description: The `request_id` of the Request the Notification is associated with
                team_id:
                    type: integer
                    description: The `team_id` of the Team the Notification is sent from/to
                generated_message:
                    type: string
                    description: The Notification's system-generated message
                free_text:
                    type: string
                    description: The optional Instructor comment associated with the Notification
                for_instructor:
                    type: boolean
                    description: Whether the notification is directed towards an Instructor
            required:
                - notification_id
                - notification_timestamp
                - team_id
                - generated_message
        Read_Notification:
            type: object
            description: A representation of a read Notification
            properties:
                read_notification_id:
                    type: integer
                    description: The Read Notification's unique ID (database primary key)
                    readOnly: true
                notification_id:
                    type: integer
                    description: The `notification_id` of the associated Notification
                user_id:
                    type: integer
                    description: The `user_id` of the User marking the Notification as "read"
            required:
                - read_notification_id
                - notification_id
                - user_id
        Error:
            type: object
            description: A generic error object
            properties:
                message:
                    description: A human readable error message
                    type: string
                error:
                    description: The error string from the database or other function
                    type: string
            required:
                - message
    responses:
        BadRequest: # code 400
            description: Invalid request due to client error (e.g., missing params)
            content:
                application/json:
                    schema:
                        $ref: '#/components/schemas/Error'
        Unauthorized: # code 401
            description: Authentication is required
            content:
                application/json:
                    schema:
                        $ref: '#/components/schemas/Error'
        Forbidden: # code 403
            description: Access is denied
            content:
                application/json:
                    schema:
                        $ref: '#/components/schemas/Error'
        NotFound: # code 404
            description: Not found
            content:
                application/json:
                    schema:
                        $ref: '#/components/schemas/Error'
        ServerError:
            description: Unexpected error
            content:
                application/json:
                    schema:
                        $ref: '#/components/schemas/Error'

tags:
    - name: Users
      description: Endpoints related to User management
    - name: Instructors
      description: Endpoints related to Instructor management
    - name: TAs
      description: Endpoints related to TA management
    - name: Students
      description: Endpoints related to Student management
    - name: Teams
      description: Endpoints related to Team management
    - name: Suppliers
      description: Endpoints related to Supplier management
    - name: Parts
      description: Endpoints related to Part management
    - name: Requests
      description: Endpoints related to Requests for Parts placed by Students
    - name: Orders
      description: Endpoints related to Orders with Suppliers placed by Instructors
    - name: Notifications
      description: Endpoints related to Notifications on changed Requests
    - name: Read_Notifications
      description: Endpoints related to Read_Notifications for Notifications
    - name: Clear_Data
      description: Endpoints related to clearing data from the application

paths:
    /users:
        get:
            summary: Retrieve all Users
            description: Retrieves a list of all Users, optionally filtered by a User's type or a Student's Team's unique ID
            tags:
                - Users
            parameters:
                - name: type
                  description: A User `type`
                  in: query
                  required: false
                  schema:
                      type: string
                      enum:
                          - 'instructor'
                          - 'student'
                          - 'ta'
                - name: team_id
                  description: A Student's Team's `team_id`
                  in: query
                  required: false
                  schema:
                      type: integer
                - name: section_id
                  description: A Student's `section_id`
                  in: query
                  required: false
                  schema:
                      type: integer
            responses:
                '200':
                    description: A list of Users
                    content:
                        application/json:
                            schema:
                                type: array
                                items:
                                    $ref: '#/components/schemas/User'
                '400': # bad query param
                    $ref: '#/components/responses/BadRequest'
                '401': # user not authenticated
                    $ref: '#/components/responses/Unauthorized'
                '403': # restricted access
                    $ref: '#/components/responses/Forbidden'
                '404': # bad foreign key query param
                    $ref: '#/components/responses/NotFound'
                '500': # server error
                    $ref: '#/components/responses/ServerError'
        post:
            summary: Create a User
            description: Creates a new User
            tags:
                - Users
            requestBody:
                required: true
                content:
                    application/json:
                        schema:
                            $ref: '#/components/schemas/User'
            responses:
                '201':
                    description: User created successfully
                    content:
                        application/json:
                            schema:
                                $ref: '#/components/schemas/User'
                '400': # if required object properties not included or in wrong format
                    $ref: '#/components/responses/BadRequest'
                '401':
                    $ref: '#/components/responses/Unauthorized'
                '403':
                    $ref: '#/components/responses/Forbidden'
                '404': # needed in case properties that match foreign keys have invalid values
                    $ref: '#/components/responses/NotFound'
                '500':
                    $ref: '#/components/responses/ServerError'
    /users/{user_id}:
        parameters:
            - name: user_id
              description: The `user_id` of the User to work with
              in: path
              required: true
              schema:
                  type: integer
                  description: The User's unique ID (database primary key)
        get:
            summary: Retrieve a User
            description: Retrieves a User by its `user_id`
            tags:
                - Users
            responses:
                '200':
                    description: The User corresponding to the provided `user_id`
                    content:
                        application/json:
                            schema:
                                $ref: '#/components/schemas/User'
                '400': # if path param not provided or in valid format
                    $ref: '#/components/responses/BadRequest'
                '401':
                    $ref: '#/components/responses/Unauthorized'
                '403':
                    $ref: '#/components/responses/Forbidden'
                '404': # if path param doesn't match valid value
                    $ref: '#/components/responses/NotFound'
                '500':
                    $ref: '#/components/responses/ServerError'
        patch:
            summary: Update a User's information
            description: Allows updating of a User's properties
            tags:
                - Users
            requestBody:
                required: true
                content:
                    application/json:
                        schema:
                            type: object
                            properties: # these are the updatable values for the User schema
                                first_name:
                                    type: string
                                    description: The User's first name
                                last_name:
                                    type: string
                                    description: The User's last name
                                email_address:
                                    type: string
                                    format: email
                                    pattern: '^[a-zA-Z0-9._%+-]+@clemson\.edu$' # Require @clemson.edu email addresses
                                    description: The User's email address (`@clemson.edu`)
                                receive_emails:
                                    type: string
                                    enum:
                                        - 'always'
                                        - 'on_deliveries'
                                        - 'on_custom'
                                    description: The user has enabled email notifications
                                    default: 'on_custom'
                            additionalProperties: false # disallow updating other properties not defined above
            responses:
                '200': # use 200 for PATCH because it's an "update" instead of a "replacement"
                    description: User updated successfully
                    content:
                        application/json:
                            schema:
                                $ref: '#/components/schemas/User'
                '400': # if path param or object property not provided or in valid formats
                    $ref: '#/components/responses/BadRequest'
                '401':
                    $ref: '#/components/responses/Unauthorized'
                '403':
                    $ref: '#/components/responses/Forbidden'
                '404': # if path param or property with foreign key constraint don't match valid values
                    $ref: '#/components/responses/NotFound'
                '500':
                    $ref: '#/components/responses/ServerError'
        delete:
            summary: Delete a User
            description: Deletes a User
            tags:
                - Users
            responses:
                '204': # use 204 "No Content" because order is now deleted
                    description: User deleted successfully
                '400': # if path param not provided or in valid format
                    $ref: '#/components/responses/BadRequest'
                '401':
                    $ref: '#/components/responses/Unauthorized'
                '403':
                    $ref: '#/components/responses/Forbidden'
                '404': # if path param doesn't match valid value
                    $ref: '#/components/responses/NotFound'
                '500':
                    $ref: '#/components/responses/ServerError'
    /instructors:
        get:
            summary: Retrieve all Instructors
            description: Retrieves a list of all Instructors
            tags:
                - Instructors
            responses:
                '200':
                    description: A list of Instructors
                    content:
                        application/json:
                            schema:
                                type: array
                                items:
                                    $ref: '#/components/schemas/Instructor'
                # 400 not needed because there are no query or path params
                '401': # user not authenticated
                    $ref: '#/components/responses/Unauthorized'
                '403': # restricted access
                    $ref: '#/components/responses/Forbidden'
                # 404 not needed because there are no query or path params
                '500': # server error
                    $ref: '#/components/responses/ServerError'
    /instructors/{instructor_id}:
        parameters:
            - name: instructor_id
              description: The `instructor_id` of the Instructor to work with
              in: path
              required: true
              schema:
                  type: integer
                  description: The Instructor's unique ID (database primary key)
        get:
            summary: Retrieve an Instructor's corresponding User object
            description: Retrieves an Instructor's corresponding User object by its `instructor_id`
            tags:
                - Users
            responses:
                '200':
                    description: The User corresponding to the provided `instructor_id`
                    content:
                        application/json:
                            schema:
                                $ref: '#/components/schemas/User'
                '400': # if path param not provided or in valid format
                    $ref: '#/components/responses/BadRequest'
                '401':
                    $ref: '#/components/responses/Unauthorized'
                '403':
                    $ref: '#/components/responses/Forbidden'
                '404': # if path param doesn't match valid value
                    $ref: '#/components/responses/NotFound'
                '500':
                    $ref: '#/components/responses/ServerError'
        patch:
            summary: Update an Instructor's information
            description: Allows updating of a Instructor's properties
            tags:
                - Instructors
            requestBody:
                required: true
                content:
                    application/json:
                        schema:
                            type: object
                            properties:
                                is_admin:
                                    type: string
                                    enum:
                                        - 'true'
                                        - 'incoming'
                                        - 'false'
                                    description: Whether the User is the administrator user (where `type` is `instructor`)
                                    default: 'false'
                            additionalProperties: false # disallow updating other properties not defined above
            responses:
                '200': # use 200 for PATCH because it's an "update" instead of a "replacement"
                    description: User updated successfully
                    content:
                        application/json:
                            schema:
                                $ref: '#/components/schemas/Instructor'
                '400': # if path param or object property not provided or in valid formats
                    $ref: '#/components/responses/BadRequest'
                '401':
                    $ref: '#/components/responses/Unauthorized'
                '403':
                    $ref: '#/components/responses/Forbidden'
                '404': # if path param or property with foreign key constraint don't match valid values
                    $ref: '#/components/responses/NotFound'
                '500':
                    $ref: '#/components/responses/ServerError'
        delete:
            summary: Delete an Instructor
            description: Deletes an Instructor
            tags:
                - Instructors
            responses:
                '204': # use 204 "No Content" because order is now deleted
                    description: Instructor deleted successfully
                '400': # if path param not provided or in valid format
                    $ref: '#/components/responses/BadRequest'
                '401':
                    $ref: '#/components/responses/Unauthorized'
                '403':
                    $ref: '#/components/responses/Forbidden'
                '404': # if path param doesn't match valid value
                    $ref: '#/components/responses/NotFound'
                '500':
                    $ref: '#/components/responses/ServerError'
    /students:
        get:
            summary: Retrieve all Students
            description: Retrieves a list of all Students
            tags:
                - Students
            parameters:
                - name: team_id
                  description: A Student's Team's `team_id`
                  in: query
                  required: false
                  schema:
                      type: integer
                - name: section_id
                  description: A Student's `section_id`
                  in: query
                  required: false
                  schema:
                      type: integer
            responses:
                '200':
                    description: A list of Students
                    content:
                        application/json:
                            schema:
                                type: array
                                items:
                                    $ref: '#/components/schemas/Student'
                # 400 not needed because all query params are foreign keys
                '401': # user not authenticated
                    $ref: '#/components/responses/Unauthorized'
                '403': # restricted access
                    $ref: '#/components/responses/Forbidden'
                '404': # invalid foreign key
                    $ref: '#/components/responses/NotFound'
                '500': # server error
                    $ref: '#/components/responses/ServerError'
    /students/{student_id}:
        parameters:
            - name: student_id
              description: The `student_id` of the Student to work with
              in: path
              required: true
              schema:
                  type: integer
                  description: The Student's unique ID (database primary key)
        get:
            summary: Retrieve a Student's corresponding User object
            description: Retrieves a Student's corresponding User object by its `student_id`
            tags:
                - Users
            responses:
                '200':
                    description: The User corresponding to the provided `student_id`
                    content:
                        application/json:
                            schema:
                                $ref: '#/components/schemas/User'
                '400': # if path param not provided or in valid format
                    $ref: '#/components/responses/BadRequest'
                '401':
                    $ref: '#/components/responses/Unauthorized'
                '403':
                    $ref: '#/components/responses/Forbidden'
                '404': # if path param doesn't match valid value
                    $ref: '#/components/responses/NotFound'
                '500':
                    $ref: '#/components/responses/ServerError'
        patch:
            summary: Update a Student's information
            description: Allows updating of a Student's properties
            tags:
                - Students
            requestBody:
                required: true
                content:
                    application/json:
                        schema:
                            type: object
                            properties:
                                team_id:
                                    type: integer
                                    description: The `team_id` of the Team the Student is a part of
                                section_id:
                                    type: integer
                                    description: The section ID/\# the Student belongs to
                            additionalProperties: false # disallow updating other properties not defined above
            responses:
                '200': # use 200 for PATCH because it's an "update" instead of a "replacement"
                    description: User updated successfully
                    content:
                        application/json:
                            schema:
                                $ref: '#/components/schemas/Student'
                '400': # if path param or object property not provided or in valid formats
                    $ref: '#/components/responses/BadRequest'
                '401':
                    $ref: '#/components/responses/Unauthorized'
                '403':
                    $ref: '#/components/responses/Forbidden'
                '404': # if path param or property with foreign key constraint don't match valid values
                    $ref: '#/components/responses/NotFound'
                '500':
                    $ref: '#/components/responses/ServerError'
        delete:
            summary: Delete a Student
            description: Deletes a Student
            tags:
                - Students
            responses:
                '204': # use 204 "No Content" because order is now deleted
                    description: Student deleted successfully
                '400': # if path param not provided or in valid format
                    $ref: '#/components/responses/BadRequest'
                '401':
                    $ref: '#/components/responses/Unauthorized'
                '403':
                    $ref: '#/components/responses/Forbidden'
                '404': # if path param doesn't match valid value
                    $ref: '#/components/responses/NotFound'
                '500':
                    $ref: '#/components/responses/ServerError'
    /tas:
        get:
            summary: Retrieve all TAs
            description: Retrieves a list of all TAs
            tags:
                - TAs
            responses:
                '200':
                    description: A list of TAs
                    content:
                        application/json:
                            schema:
                                type: array
                                items:
                                    $ref: '#/components/schemas/TA'
                # 400 not needed because there are no query or path params
                '401': # user not authenticated
                    $ref: '#/components/responses/Unauthorized'
                '403': # restricted access
                    $ref: '#/components/responses/Forbidden'
                # 404 not needed because there are no query or path params
                '500': # server error
                    $ref: '#/components/responses/ServerError'
    /tas/{ta_id}:
        parameters:
            - name: ta_id
              description: The `ta_id` of the TA to work with
              in: path
              required: true
              schema:
                  type: integer
                  description: The TA's unique ID (database primary key)
        get:
            summary: Retrieve a TA's corresponding User object
            description: Retrieves a TA's corresponding User object by its `ta_id`
            tags:
                - Users
            responses:
                '200':
                    description: The User corresponding to the provided `ta_id`
                    content:
                        application/json:
                            schema:
                                $ref: '#/components/schemas/User'
                '400': # if path param not provided or in valid format
                    $ref: '#/components/responses/BadRequest'
                '401':
                    $ref: '#/components/responses/Unauthorized'
                '403':
                    $ref: '#/components/responses/Forbidden'
                '404': # if path param doesn't match valid value
                    $ref: '#/components/responses/NotFound'
                '500':
                    $ref: '#/components/responses/ServerError'
        delete:
            summary: Delete a TA
            description: Deletes a TA
            tags:
                - TAs
            responses:
                '204': # use 204 "No Content" because order is now deleted
                    description: TA deleted successfully
                '400': # if path param not provided or in valid format
                    $ref: '#/components/responses/BadRequest'
                '401':
                    $ref: '#/components/responses/Unauthorized'
                '403':
                    $ref: '#/components/responses/Forbidden'
                '404': # if path param doesn't match valid value
                    $ref: '#/components/responses/NotFound'
                '500':
                    $ref: '#/components/responses/ServerError'
    /teams:
        get:
            summary: Retrieve all Teams
            description: Retrieves a list of all Teams, optionally filtered by a Team's `section_id`
            tags:
                - Teams
            parameters:
                - name: section_id
                  description: The section ID/\# the Team belongs to
                  in: query
                  required: false
                  schema:
                      type: integer
            responses:
                '200':
                    description: A list of Teams
                    content:
                        application/json:
                            schema:
                                type: array
                                items:
                                    $ref: '#/components/schemas/Team'
                '400': # bad query param
                    $ref: '#/components/responses/BadRequest'
                '401': # user not authenticated
                    $ref: '#/components/responses/Unauthorized'
                '403': # restricted access
                    $ref: '#/components/responses/Forbidden'
                # 404 not needed because query params do not correspond to any foreign keys and there are no path params
                '500': # server error
                    $ref: '#/components/responses/ServerError'
        post:
            summary: Create a Team
            description: Creates a new Team
            tags:
                - Teams
            requestBody:
                required: true
                content:
                    application/json:
                        schema:
                            $ref: '#/components/schemas/Team'
            responses:
                '201':
                    description: Team created successfully
                    content:
                        application/json:
                            schema:
                                $ref: '#/components/schemas/Team'
                '400': # if required object properties not included or in wrong format
                    $ref: '#/components/responses/BadRequest'
                '401':
                    $ref: '#/components/responses/Unauthorized'
                '403':
                    $ref: '#/components/responses/Forbidden'
                '404': # needed in case properties that match foreign keys have invalid values
                    $ref: '#/components/responses/NotFound'
                '500':
                    $ref: '#/components/responses/ServerError'
    /teams/{team_id}:
        parameters:
            - name: team_id
              description: The `team_id` of the Team to work with
              in: path
              required: true
              schema:
                  type: integer
                  description: The Team's unique ID (database primary key)
        get:
            summary: Retrieve a Team
            description: Retrieves a Team by its `team_id`
            tags:
                - Teams
            responses:
                '200':
                    description: The Team corresponding to the provided `team_id`
                    content:
                        application/json:
                            schema:
                                $ref: '#/components/schemas/Team'
                '400': # if path param not provided or in valid format
                    $ref: '#/components/responses/BadRequest'
                '401':
                    $ref: '#/components/responses/Unauthorized'
                '403':
                    $ref: '#/components/responses/Forbidden'
                '404': # if path param doesn't match valid value
                    $ref: '#/components/responses/NotFound'
                '500':
                    $ref: '#/components/responses/ServerError'
        patch:
            summary: Update a Team's information
            description: Allows updating of a Team's properties
            tags:
                - Teams
            requestBody:
                required: true
                content:
                    application/json:
                        schema:
                            type: object
                            properties: # these are the updatable values for the Team schema
                                name:
                                    type: string
                                    description: The Team's name
                                section_id:
                                    type: integer
                                    description: The section ID/\# the Team belongs to
                                locker_num:
                                    type: integer
                                    description: The locker number assigned to the team
                            additionalProperties: false # disallow updating other properties not defined above
            responses:
                '200': # use 200 for PATCH because it's an "update" instead of a "replacement"
                    description: Team updated successfully
                    content:
                        application/json:
                            schema:
                                $ref: '#/components/schemas/Team'
                '400': # if path param or object property not provided or in valid formats
                    $ref: '#/components/responses/BadRequest'
                '401':
                    $ref: '#/components/responses/Unauthorized'
                '403':
                    $ref: '#/components/responses/Forbidden'
                '404': # if path param or property with foreign key constraint don't match valid values
                    $ref: '#/components/responses/NotFound'
                '500':
                    $ref: '#/components/responses/ServerError'
        delete:
            summary: Delete a Team
            description: Deletes a Team
            tags:
                - Teams
            responses:
                '204': # use 204 "No Content" because order is now deleted
                    description: Team deleted successfully
                '400': # if path param not provided or in valid format
                    $ref: '#/components/responses/BadRequest'
                '401':
                    $ref: '#/components/responses/Unauthorized'
                '403':
                    $ref: '#/components/responses/Forbidden'
                '404': # if path param doesn't match valid value
                    $ref: '#/components/responses/NotFound'
                '500':
                    $ref: '#/components/responses/ServerError'
    /suppliers:
        get:
            summary: Retrieve all Suppliers
            description: Retrieves a list of all Suppliers, optionally filtered by a Supplier's `url`
            tags:
                - Suppliers
            parameters:
                - name: url
                  description: The Supplier's top level domain (i.e., `http://amazon.com`)
                  in: query
                  required: false
                  schema:
                      type: string
            responses:
                '200':
                    description: A list of Suppliers
                    content:
                        application/json:
                            schema:
                                type: array
                                items:
                                    $ref: '#/components/schemas/Supplier'
                '400': # bad query param
                    $ref: '#/components/responses/BadRequest'
                '401': # user not authenticated
                    $ref: '#/components/responses/Unauthorized'
                '403': # restricted access
                    $ref: '#/components/responses/Forbidden'
                # 404 not needed because there are no foreign key query params
                '500': # server error
                    $ref: '#/components/responses/ServerError'
        post:
            summary: Create a Supplier
            description: Creates a new Supplier
            tags:
                - Suppliers
            requestBody:
                required: true
                content:
                    application/json:
                        schema:
                            $ref: '#/components/schemas/Supplier'
            responses:
                '201':
                    description: Supplier created successfully
                    content:
                        application/json:
                            schema:
                                $ref: '#/components/schemas/Supplier'
                '400': # if required object properties not included or in wrong format
                    $ref: '#/components/responses/BadRequest'
                '401':
                    $ref: '#/components/responses/Unauthorized'
                '403':
                    $ref: '#/components/responses/Forbidden'
                '404': # needed in case properties that match foreign keys have invalid values
                    $ref: '#/components/responses/NotFound'
                '500':
                    $ref: '#/components/responses/ServerError'
    /suppliers/{suppliers_id}:
        parameters:
            - name: suppliers_id
              description: The `supplier_id` of the Supplier to work with
              in: path
              required: true
              schema:
                  type: integer
                  description: The Supplier's unique ID (database primary key)
        get:
            summary: Retrieve a Supplier
            description: Retrieves a Supplier by its `supplier_id`
            tags:
                - Suppliers
            responses:
                '200':
                    description: The Supplier corresponding to the provided `supplier_id`
                    content:
                        application/json:
                            schema:
                                $ref: '#/components/schemas/Supplier'
                '400': # if path param not provided or in valid format
                    $ref: '#/components/responses/BadRequest'
                '401':
                    $ref: '#/components/responses/Unauthorized'
                '403':
                    $ref: '#/components/responses/Forbidden'
                '404': # if path param doesn't match valid value
                    $ref: '#/components/responses/NotFound'
                '500':
                    $ref: '#/components/responses/ServerError'
        patch:
            summary: Update a Supplier's information
            description: Allows updating of a Supplier's properties
            tags:
                - Suppliers
            requestBody:
                required: true
                content:
                    application/json:
                        schema:
                            type: object
                            properties: # these are the updatable values for the Order schema
                                url:
                                    type: string
                                    format: uri
                                    description: The Supplier's top level domain (i.e., `http://amazon.com`)
                                name:
                                    type: string
                                    description: The Supplier's top level domain, without the protocol or extension (i.e., `amazon`)
                            additionalProperties: false # disallow updating other properties not defined above
            responses:
                '200': # use 200 for PATCH because it's an "update" instead of a "replacement"
                    description: Supplier updated successfully
                    content:
                        application/json:
                            schema:
                                $ref: '#/components/schemas/Supplier'
                '400': # if path param or object property not provided or in valid formats
                    $ref: '#/components/responses/BadRequest'
                '401':
                    $ref: '#/components/responses/Unauthorized'
                '403':
                    $ref: '#/components/responses/Forbidden'
                '404': # if path param or property with foreign key constraint don't match valid values
                    $ref: '#/components/responses/NotFound'
                '500':
                    $ref: '#/components/responses/ServerError'
        delete:
            summary: Delete a Supplier
            description: Deletes a Supplier
            tags:
                - Suppliers
            responses:
                '204': # use 204 "No Content" because order is now deleted
                    description: Supplier deleted successfully
                '400': # if path param not provided or in valid format
                    $ref: '#/components/responses/BadRequest'
                '401':
                    $ref: '#/components/responses/Unauthorized'
                '403':
                    $ref: '#/components/responses/Forbidden'
                '404': # if path param doesn't match valid value
                    $ref: '#/components/responses/NotFound'
                '500':
                    $ref: '#/components/responses/ServerError'
    /parts:
        get:
            summary: Retrieve all Parts
            description: Retrieves a list of all Parts, optionally filtered by a Supplier's unique ID or a Part's `url`
            tags:
                - Parts
            parameters:
                - name: supplier_id
                  description: The `supplier_id` of the Part's Supplier
                  in: query
                  required: false
                  schema:
                      type: integer
                - name: url
                  description: The Part's web link (i.e., `http://amazon.com/...`)
                  in: query
                  required: false
                  schema:
                      type: string
            responses:
                '200':
                    description: A list of Parts
                    content:
                        application/json:
                            schema:
                                type: array
                                items:
                                    $ref: '#/components/schemas/Part'
                '400': # bad query param
                    $ref: '#/components/responses/BadRequest'
                '401': # user not authenticated
                    $ref: '#/components/responses/Unauthorized'
                '403': # restricted access
                    $ref: '#/components/responses/Forbidden'
                '404': # query params do not match valid values
                    $ref: '#/components/responses/NotFound'
                '500': # server error
                    $ref: '#/components/responses/ServerError'
        post:
            summary: Create a Part
            description: Creates a new Part
            tags:
                - Parts
            requestBody:
                required: true
                content:
                    application/json:
                        schema:
                            $ref: '#/components/schemas/Part'
            responses:
                '201':
                    description: Part created successfully
                    content:
                        application/json:
                            schema:
                                $ref: '#/components/schemas/Part'
                '400': # if required object properties not included or in wrong format
                    $ref: '#/components/responses/BadRequest'
                '401':
                    $ref: '#/components/responses/Unauthorized'
                '403':
                    $ref: '#/components/responses/Forbidden'
                '404': # needed in case properties that match foreign keys have invalid values
                    $ref: '#/components/responses/NotFound'
                '500':
                    $ref: '#/components/responses/ServerError'
    /parts/{part_id}:
        parameters:
            - name: part_id
              description: The `part_id` of the Part to work with
              in: path
              required: true
              schema:
                  type: integer
                  description: The Part's unique ID (database primary key)
        get:
            summary: Retrieve a Part
            description: Retrieves a Part by its `part_id`
            tags:
                - Parts
            responses:
                '200':
                    description: The Part corresponding to the provided `part_id`
                    content:
                        application/json:
                            schema:
                                $ref: '#/components/schemas/Part'
                '400': # if path param not provided or in valid format
                    $ref: '#/components/responses/BadRequest'
                '401':
                    $ref: '#/components/responses/Unauthorized'
                '403':
                    $ref: '#/components/responses/Forbidden'
                '404': # if path param doesn't match valid value
                    $ref: '#/components/responses/NotFound'
                '500':
                    $ref: '#/components/responses/ServerError'
        patch:
            summary: Update a Part's information
            description: Allows updating of a Part's properties
            tags:
                - Parts
            requestBody:
                required: true
                content:
                    application/json:
                        schema:
                            type: object
                            properties: # these are the updatable values for the Order schema
                                url:
                                    type: string
                                    format: uri
                                    description: The Part's web link (i.e., `http://amazon.com/...`)
                                description:
                                    type: string
                                    description: The Part's name/description # Could be the product title
                                price:
                                    type: number
                                    minimum: 0
                                    exclusiveMinimum: true # Require that price be greater than 0
                            additionalProperties: false # disallow updating other properties not defined above
            responses:
                '200': # use 200 for PATCH because it's an "update" instead of a "replacement"
                    description: Part updated successfully
                    content:
                        application/json:
                            schema:
                                $ref: '#/components/schemas/Part'
                '400': # if path param or object property not provided or in valid formats
                    $ref: '#/components/responses/BadRequest'
                '401':
                    $ref: '#/components/responses/Unauthorized'
                '403':
                    $ref: '#/components/responses/Forbidden'
                '404': # if path param or property with foreign key constraint don't match valid values
                    $ref: '#/components/responses/NotFound'
                '500':
                    $ref: '#/components/responses/ServerError'
        delete:
            summary: Delete a Part
            description: Deletes a Part
            tags:
                - Parts
            responses:
                '204': # use 204 "No Content" because order is now deleted
                    description: Part deleted successfully
                '400': # if path param not provided or in valid format
                    $ref: '#/components/responses/BadRequest'
                '401':
                    $ref: '#/components/responses/Unauthorized'
                '403':
                    $ref: '#/components/responses/Forbidden'
                '404': # if path param doesn't match valid value
                    $ref: '#/components/responses/NotFound'
                '500':
                    $ref: '#/components/responses/ServerError'
    /requests:
        get:
            summary: Retrieve all Requests
            description: Retrieves a list of all Requests, optionally filtered by a Student's, Team's, Supplier's, Part's, and/or Order's unique IDs
            tags:
                - Requests
            parameters:
                - name: student_id
                  description: The `student_id` of the Student making the Request
                  in: query
                  required: false
                  schema:
                      type: integer
                - name: team_id
                  description: The `team_id` of the Team making the Request
                  in: query
                  required: false
                  schema:
                      type: integer
                - name: supplier_id
                  description: The `supplier_id` of the Supplier associated with the Request
                  in: query
                  required: false
                  schema:
                      type: integer
                - name: part_id
                  description: The `part_id` of the requested Part
                  in: query
                  required: false
                  schema:
                      type: integer
                - name: order_id
                  description: The `order_id` of the Order associated with the Request
                  in: query
                  required: false
                  schema:
                      type: integer
                - name: status
                  description: The Request's status
                  in: query
                  required: false
                  schema:
                      type: string
                      enum:
                          - 'requested'
                          - 'approved'
                          - 'ordered'
                          - 'delivered'
                          - 'delayed'
                          - 'reordered'
                          - 'on hand'
                          - 'cancelled'
                          - 'other'
            responses:
                '200':
                    description: A list of Requests
                    content:
                        application/json:
                            schema:
                                type: array
                                items:
                                    $ref: '#/components/schemas/Request'
                '400': # bad query param
                    $ref: '#/components/responses/BadRequest'
                '401': # user not authenticated
                    $ref: '#/components/responses/Unauthorized'
                '403': # restricted access
                    $ref: '#/components/responses/Forbidden'
                '404': # query params do not match valid values
                    $ref: '#/components/responses/NotFound'
                '500': # server error
                    $ref: '#/components/responses/ServerError'
        post:
            summary: Create a Request
            description: Creates a new Request
            tags:
                - Requests
            requestBody:
                required: true
                content:
                    application/json:
                        schema:
                            $ref: '#/components/schemas/Request'
            responses:
                '201':
                    description: Request created successfully
                    content:
                        application/json:
                            schema:
                                $ref: '#/components/schemas/Request'
                '400': # if required object properties not included or in wrong format
                    $ref: '#/components/responses/BadRequest'
                '401':
                    $ref: '#/components/responses/Unauthorized'
                '403':
                    $ref: '#/components/responses/Forbidden'
                '404': # needed in case properties that match foreign keys have invalid values
                    $ref: '#/components/responses/NotFound'
                '500':
                    $ref: '#/components/responses/ServerError'
    /requests/{request_id}:
        parameters:
            - name: request_id
              description: The `request_id` of the Request to work with
              in: path
              required: true
              schema:
                  type: integer
                  description: The Request's unique ID (database primary key)
        get:
            summary: Retrieve a request
            description: Retrieves a Request by its `request_id`
            tags:
                - Requests
            responses:
                '200':
                    description: The Request corresponding to the provided `request_id`
                    content:
                        application/json:
                            schema:
                                $ref: '#/components/schemas/Request'
                '400': # if path param not provided or in valid format
                    $ref: '#/components/responses/BadRequest'
                '401':
                    $ref: '#/components/responses/Unauthorized'
                '403':
                    $ref: '#/components/responses/Forbidden'
                '404': # if path param doesn't match valid value
                    $ref: '#/components/responses/NotFound'
                '500':
                    $ref: '#/components/responses/ServerError'
        patch:
            summary: Update a Request's information
            description: Allows updating of a Request's properties
            tags:
                - Requests
            requestBody:
                required: true
                content:
                    application/json:
                        schema:
                            type: object
                            properties: # these are the updatable values for the Order schema
                                order_id:
                                    type: integer
                                    description: The `order_id` of the Order associated with the Request
                                status:
                                    type: string
                                    enum:
                                        - 'requested'
                                        - 'ordered'
                                        - 'delivered'
                                        - 'delayed'
                                        - 'reordered'
                                        - 'on hand'
                                        - 'cancelled'
                                        - 'other'
                                    description: The Request's status
                                quantity:
                                    type: integer
                                    minimum: 0
                                    exclusiveMinimum: true # Require that quantity be at least 1
                                    description: The quantity of the requested Part
                                subtotal:
                                    type: number
                                    minimum: 0
                                    exclusiveMinimum: true # Require that the subtotal be more than $0
                                    description: The Request subtotal (in $)
                            additionalProperties: false # disallow updating other properties not defined above
            responses:
                '200': # use 200 for PATCH because it's an "update" instead of a "replacement"
                    description: Request updated successfully
                    content:
                        application/json:
                            schema:
                                $ref: '#/components/schemas/Request'
                '400': # if path param or object property not provided or in valid formats
                    $ref: '#/components/responses/BadRequest'
                '401':
                    $ref: '#/components/responses/Unauthorized'
                '403':
                    $ref: '#/components/responses/Forbidden'
                '404': # if path param or property with foreign key constraint don't match valid values
                    $ref: '#/components/responses/NotFound'
                '500':
                    $ref: '#/components/responses/ServerError'
        delete:
            summary: Delete a Request
            description: Deletes a Request
            tags:
                - Requests
            responses:
                '204': # use 204 "No Content" because order is now deleted
                    description: Request deleted successfully
                '400': # if path param not provided or in valid format
                    $ref: '#/components/responses/BadRequest'
                '401':
                    $ref: '#/components/responses/Unauthorized'
                '403':
                    $ref: '#/components/responses/Forbidden'
                '404': # if path param doesn't match valid value
                    $ref: '#/components/responses/NotFound'
                '500':
                    $ref: '#/components/responses/ServerError'
    /orders:
        get:
            summary: Retrieve all Orders
            description: Retrieves a list of all Orders, optionally filtered by a User's and/or Supplier's unique IDs
            tags:
                - Orders
            parameters:
                - name: instructor_id
                  description: The `instructor_id` of the Instructor who placed the Order
                  in: query
                  required: false
                  schema:
                      type: integer
                - name: supplier_id
                  description: The `supplier_id` of the Supplier associated with the Order
                  in: query
                  required: false
                  schema:
                      type: integer
            responses:
                '200':
                    description: A list of Orders
                    content:
                        application/json:
                            schema:
                                type: array
                                items:
                                    $ref: '#/components/schemas/Order'
                # 400 not needed because all query params are foreign keys
                '401': # user not authenticated
                    $ref: '#/components/responses/Unauthorized'
                '403': # restricted access
                    $ref: '#/components/responses/Forbidden'
                '404': # query params do not match valid values
                    $ref: '#/components/responses/NotFound'
                '500': # server error
                    $ref: '#/components/responses/ServerError'
        post:
            summary: Create an Order
            description: Creates a new Order
            tags:
                - Orders
            requestBody:
                required: true
                content:
                    application/json:
                        schema:
                            $ref: '#/components/schemas/Order'
            responses:
                '201':
                    description: Order created successfully
                    content:
                        application/json:
                            schema:
                                $ref: '#/components/schemas/Order'
                '400': # if required object properties not included or in wrong format
                    $ref: '#/components/responses/BadRequest'
                '401':
                    $ref: '#/components/responses/Unauthorized'
                '403':
                    $ref: '#/components/responses/Forbidden'
                '404': # needed in case properties that match foreign keys have invalid values
                    $ref: '#/components/responses/NotFound'
                '500':
                    $ref: '#/components/responses/ServerError'
    /orders/{order_id}:
        parameters:
            - name: order_id
              description: The `order_id` of the Order to work with
              in: path
              required: true
              schema:
                  type: integer
                  description: The order's unique ID (database primary key)
        get:
            summary: Retrieve an order
            description: Retrieves an Order by its `order_id`
            tags:
                - Orders
            responses:
                '200':
                    description: The Order corresponding to the provided `order_id`
                    content:
                        application/json:
                            schema:
                                $ref: '#/components/schemas/Order'
                '400': # if path param not provided or in valid format
                    $ref: '#/components/responses/BadRequest'
                '401':
                    $ref: '#/components/responses/Unauthorized'
                '403':
                    $ref: '#/components/responses/Forbidden'
                '404': # if path param doesn't match valid value
                    $ref: '#/components/responses/NotFound'
                '500':
                    $ref: '#/components/responses/ServerError'
        patch:
            summary: Update an Order's information
            description: Allows updating of an Order's properties
            tags:
                - Orders
            requestBody:
                required: true
                content:
                    application/json:
                        schema:
                            type: object
                            properties: # these are the updatable values for the Order schema
                                instructor_id:
                                    type: number
                                    description: Instructor who placed or is associated with the order
                                is_fulfilled:
                                    type: boolean
                                    description: Whether the Order has been fulfilled by the Supplier
                                total:
                                    type: number
                                    minimum: 0
                                    exclusiveMinimum: true # Require that the total be more than $0
                                    description: The Order total (in $)
                            additionalProperties: false # disallow updating other properties not defined above
            responses:
                '200': # use 200 for PATCH because it's an "update" instead of a "replacement"
                    description: Order updated successfully
                    content:
                        application/json:
                            schema:
                                $ref: '#/components/schemas/Order'
                '400': # if path param or object property not provided or in valid formats
                    $ref: '#/components/responses/BadRequest'
                '401':
                    $ref: '#/components/responses/Unauthorized'
                '403':
                    $ref: '#/components/responses/Forbidden'
                '404': # if path param or property with foreign key constraint don't match valid values
                    $ref: '#/components/responses/NotFound'
                '500':
                    $ref: '#/components/responses/ServerError'
        delete:
            summary: Delete an Order
            description: Deletes an Order
            tags:
                - Orders
            responses:
                '204': # use 204 "No Content" because order is now deleted
                    description: Order deleted successfully
                '400': # if path param not provided or in valid format
                    $ref: '#/components/responses/BadRequest'
                '401':
                    $ref: '#/components/responses/Unauthorized'
                '403':
                    $ref: '#/components/responses/Forbidden'
                '404': # if path param doesn't match valid value
                    $ref: '#/components/responses/NotFound'
                '500':
                    $ref: '#/components/responses/ServerError'
    /notifications:
        get:
            summary: Retrieve all Notifications
            description: Retrieves a list of all Notifications, optionally filtered by a Team's `team_id`
            tags:
                - Notifications
            parameters:
                - name: team_id
                  description: The `team_id` associated with a Notification
                  in: query
                  required: false
                  schema:
                      type: integer
                - name: for_instructor
                  description: Whether the notification is directed towards an Instructor
                  in: query
                  required: false
                  schema:
                      type: boolean
            responses:
                '200':
                    description: A list of Notifications
                    content:
                        application/json:
                            schema:
                                type: array
                                items:
                                    $ref: '#/components/schemas/Notification'
                '400': # bad query param
                    $ref: '#/components/responses/BadRequest'
                '401': # user not authenticated
                    $ref: '#/components/responses/Unauthorized'
                '403': # restricted access
                    $ref: '#/components/responses/Forbidden'
                '404': # query params do not match valid values
                    $ref: '#/components/responses/NotFound'
                '500': # server error
                    $ref: '#/components/responses/ServerError'
        post:
            summary: Create a Notification
            description: Creates a new Notification
            tags:
                - Notifications
            requestBody:
                required: true
                content:
                    application/json:
                        schema:
                            $ref: '#/components/schemas/Notification'
            responses:
                '201':
                    description: Notification created successfully
                    content:
                        application/json:
                            schema:
                                $ref: '#/components/schemas/Notification'
                '400':
                    $ref: '#/components/responses/BadRequest'
                '401':
                    $ref: '#/components/responses/Unauthorized'
                '403':
                    $ref: '#/components/responses/Forbidden'
                '404':
                    $ref: '#/components/responses/NotFound'
                '500':
                    $ref: '#/components/responses/ServerError'
    /notifications/{notification_id}:
        parameters:
            - name: notification_id
              description: The `notification_id` of the Notification to retrieve or manipulate
              in: path
              required: true
              schema:
                  type: integer
                  description: The Notification's unique ID (database primary key)
        get:
            summary: Retrieve a Notification by ID
            description: Retrieves a Notification by its `notification_id`
            tags:
                - Notifications
            responses:
                '200':
                    description: The Notification corresponding to the provided `notification_id`
                    content:
                        application/json:
                            schema:
                                $ref: '#/components/schemas/Notification'
                '400':
                    $ref: '#/components/responses/BadRequest'
                '401':
                    $ref: '#/components/responses/Unauthorized'
                '403':
                    $ref: '#/components/responses/Forbidden'
                '404':
                    $ref: '#/components/responses/NotFound'
                '500':
                    $ref: '#/components/responses/ServerError'
        delete:
            summary: Delete a Notification
            description: Deletes a Notification
            tags:
                - Notifications
            responses:
                '204':
                    description: Notification deleted successfully
                '400':
                    $ref: '#/components/responses/BadRequest'
                '401':
                    $ref: '#/components/responses/Unauthorized'
                '403':
                    $ref: '#/components/responses/Forbidden'
                '404':
                    $ref: '#/components/responses/NotFound'
                '500':
                    $ref: '#/components/responses/ServerError'
    /read_notifications:
        get:
            summary: Retrieve all Read Notifications
            description: Retrieves a list of all Read Notifications, optionally filtered by a User's `user_id`
            tags:
                - Read_Notifications
            parameters:
                - name: user_id
                  description: The `user_id` associated with the Read Notification
                  in: query
                  required: false
                  schema:
                      type: integer
            responses:
                '200':
                    description: A list of Read Notifications
                    content:
                        application/json:
                            schema:
                                type: array
                                items:
                                    $ref: '#/components/schemas/Read_Notification'
                '400': # bad query param
                    $ref: '#/components/responses/BadRequest'
                '401': # user not authenticated
                    $ref: '#/components/responses/Unauthorized'
                '403': # restricted access
                    $ref: '#/components/responses/Forbidden'
                '404': # query params do not match valid values
                    $ref: '#/components/responses/NotFound'
                '500': # server error
                    $ref: '#/components/responses/ServerError'
        post:
            summary: Create a Read Notification
            description: Creates a new Read Notification
            tags:
                - Read_Notifications
            requestBody:
                required: true
                content:
                    application/json:
                        schema:
                            $ref: '#/components/schemas/Read_Notification'
            responses:
                '201':
                    description: Read Notification created successfully
                    content:
                        application/json:
                            schema:
                                $ref: '#/components/schemas/Read_Notification'
                '400':
                    $ref: '#/components/responses/BadRequest'
                '401':
                    $ref: '#/components/responses/Unauthorized'
                '403':
                    $ref: '#/components/responses/Forbidden'
                '404':
                    $ref: '#/components/responses/NotFound'
                '500':
                    $ref: '#/components/responses/ServerError'
    /read_notifications/{read_notification_id}:
        parameters:
            - name: read_notification_id
              description: The `read_notification_id` of the Read Notification to retrieve or delete
              in: path
              required: true
              schema:
                  type: integer
                  description: The Read Notification's unique ID (database primary key)
        get:
            summary: Retrieve a Read Notification by ID
            description: Retrieves a Read Notification by its `read_notification_id`
            tags:
                - Read_Notifications
            responses:
                '200':
                    description: The Read Notification corresponding to the provided `read_notification_id`
                    content:
                        application/json:
                            schema:
                                $ref: '#/components/schemas/Read_Notification'
                '400':
                    $ref: '#/components/responses/BadRequest'
                '401':
                    $ref: '#/components/responses/Unauthorized'
                '403':
                    $ref: '#/components/responses/Forbidden'
                '404':
                    $ref: '#/components/responses/NotFound'
                '500':
                    $ref: '#/components/responses/ServerError'
        delete:
            summary: Delete a Read Notification
            description: Deletes a Read Notification
            tags:
                - Read_Notifications
            responses:
                '204':
                    description: Read Notification deleted successfully
                '400':
                    $ref: '#/components/responses/BadRequest'
                '401':
                    $ref: '#/components/responses/Unauthorized'
                '403':
                    $ref: '#/components/responses/Forbidden'
                '404':
                    $ref: '#/components/responses/NotFound'
                '500':
                    $ref: '#/components/responses/ServerError'
    /clear_data:
        delete:
            summary: Clear all data
            description: Clears all data from the application, except for instructors
            tags:
                - Clear_Data
            responses:
                '204': # use 204 "No Content" because order is now deleted
                    description: Data cleared successfully
                '500':
                    $ref: '#/components/responses/ServerError'
