sef-global / scholarx-backend

This is the backend of the ScholarX
MIT License
11 stars 38 forks source link

Implement apply for a mentor endpoint (Mentee) #99

Closed Madhawa97 closed 4 months ago

Madhawa97 commented 7 months ago

Description: This issue involves implementing the Mentee API endpoint. The endpoint should allow clients to make a POST request to {{baseUrl}}/api/mentees and provide related information in the request body.

{
    "mentor_id": "280a5eb6-323d-47b1-92da-b7a1e7fbc32c",
    "application": [
        {
            "question": "What is your university?",
            "answers": "University of Colombo"
        },
        {
            "question": "What are your interests?",
            "answers": "Software Engineering"
        },
        ...
    ]
}

Tasks:

  1. Create a route and controller for the /controllers/mentees endpoint in the Node.js backend.
  2. Parse and validate the request body to ensure it matches the expected format.
  3. Store the mentee information in the database.
  4. Implement appropriate error handling and response status codes for different scenarios (e.g., validation errors, database errors).
  5. Write unit tests to validate the functionality and correctness of the endpoint.

API documentation: Postman Collection

ER diagram: Google Drive

Acceptance Criteria:

  1. The Mentor API endpoint /controllers/mentees is implemented and accessible via a POST request.
  2. The request body is properly parsed and validated for the required format.
  3. The mentor information, including the questions and answers, is stored correctly in the database.
  4. Appropriate error handling is implemented, providing meaningful error messages and correct response status codes.
  5. Unit tests are written to validate the functionality and correctness of the endpoint.
ifhammohamed commented 4 months ago

Hi @Madhawa97 , @mayura-andrew !

shall i work on this issue.

Madhawa97 commented 4 months ago

Yes. Go ahead @ifhammohamed1111

cc: @anjula-sack

anjula-sack commented 4 months ago

Sorry @ifhammohamed1111 This is implemented by this https://github.com/sef-global/scholarx-backend/pull/107. Will you be able to work on something else?

ifhammohamed commented 4 months ago

yeah no issues @anjula-sack !