Skip to content

Conversation

@myeeli
Copy link
Contributor

@myeeli myeeli commented Dec 6, 2025

Description

image image

Related PRS (if any):

Main changes explained:

  • Implemented a secure educator–PM resource request system with proper role validation.
  • Removed requestor_id and cleaned database schema for accuracy and simplicity.
  • Fixed authorization logic so only educators create requests and only PMs update statuses.
  • Added strict ObjectId validation and prevented educators from overriding request status.
  • Improved controller structure, error handling, and added pagination for PM dashboards.
  • Updated unit tests to cover authorization, status protection, and request validation.

How to test:

  • Check into the current branch.
  • Log in as Educator
  • all the endpoint using Postman:
    POST /educator/resource-requests
    Body:
    {
    "request_title": "Classroom Supplies",
    "request_details": "Need whiteboards and markers"
    }
    Verify: Resource request is created successfully and Status is set to pending
  • Call the endpoint using Postman:
    GET /educator/resource-requests
    Verify: Educator can view their own resource requests
  • Log in as a PM
  • Call the endpoint using Postman: GET /pm/resource-requests
    Verify: PM can view all educator resource requests
  • Call the endpoint using Postman: PUT /pm/resource-requests/:id
    Body :
    {
    "status": "approved"
    }
    Verify: Request status is updated successfully

Screenshots or videos of changes:

Note:

Include the information the reviewers need to know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants