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

Implement Get all mentees by status endpoint (Admin) #31

Open
janithlahirukariyawasam opened this issue Jul 26, 2023 · 4 comments
Open
Labels
admin Admin related task backend A backend task

Comments

@janithlahirukariyawasam
Copy link
Member

Description:
This issue involves implementing an API to get all mentees by status. The endpoint should allow Admin to make a GET request to {{baseUrl}}/api/admin/mentees?status=ONGOING.

Example get all approved mentees

{
  "mentees": [
    {
      "mentee_id": 1,
      "created_at": "2023-06-30T08:00:00Z",
      "updated_at": "2023-06-30T12:30:00Z",
      "state": "APPROVED",
      "answers": {
        "question1": "answer1",
        "question2": "answer2"
      },
      "profile": {
        "created_at": "2023-06-29T09:45:00Z",
        "updated_at": "2023-06-30T14:15:00Z",
        "primary_email": "[email protected]",
        "contact_email": "[email protected]",
        "first_name": "Sarah",
        "last_name": "Johnson",
        "image_url": "https://example.com/mentee_profile_image.jpg",
        "linkedin_url": "https://www.linkedin.com/in/sarahjohnson",
        "type": "DEFAULT",
        "uuid": "98765432-2345-6789-2345-678923456789"
      },
      "mentor": {
        "mentor_id": 1,
        "created_at": "2023-06-30T10:00:00Z",
        "updated_at": "2023-06-30T14:30:00Z",
        "state": "APPROVED",
        "category": "Technology",
        "application": {
          "field1": "value1",
          "field2": "value2"
        },
        "availability": true
      },
      "certificate_id": 123,
      "blogs": {
        "blog1": "https://example.com/blog1",
        "blog2": "https://example.com/blog2"
      }
    }
  ]
}

Example get all rejected mentees

{
  "mentees": [
    {
      "mentee_id": 2,
      "created_at": "2023-06-25T12:00:00Z",
      "updated_at": "2023-06-29T10:30:00Z",
      "state": "REJECTED",
      "answers": {
        "question1": "answer3",
        "question2": "answer4"
      },
      "profile": {
        "created_at": "2023-06-24T09:15:00Z",
        "updated_at": "2023-06-29T13:45:00Z",
        "primary_email": "[email protected]",
        "contact_email": "[email protected]",
        "first_name": "Michael",
        "last_name": "Smith",
        "image_url": "https://example.com/mentee2_profile_image.jpg",
        "linkedin_url": "https://www.linkedin.com/in/michaelsmith",
        "type": "DEFAULT",
        "uuid": "67891234-3456-7890-3456-789034567890"
      },
      "mentor": null,
      "certificate_id": null,
      "blogs": ""
    }
  ]
}

Example get all pending mentees

{
  "mentees": [
    {
      "mentee_id": 2,
      "created_at": "2023-06-25T12:00:00Z",
      "updated_at": "2023-06-29T10:30:00Z",
      "state": "PENDING",
      "answers": {
        "question1": "answer3",
        "question2": "answer4"
      },
      "profile": {
        "created_at": "2023-06-24T09:15:00Z",
        "updated_at": "2023-06-29T13:45:00Z",
        "primary_email": "[email protected]",
        "contact_email": "[email protected]",
        "first_name": "Michael",
        "last_name": "Smith",
        "image_url": "https://example.com/mentee2_profile_image.jpg",
        "linkedin_url": "https://www.linkedin.com/in/michaelsmith",
        "type": "DEFAULT",
        "uuid": "67891234-3456-7890-3456-789034567890"
      },
      "mentor": null,
      "certificate_id": null,
      "blogs": {}
    }
  ]
}

Tasks:

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

API documentation: https://documenter.getpostman.com/view/27421496/2s93m1a4ac#8744a3ee-970f-489a-853d-8b23fdee8de3

ER diagram: https://drive.google.com/file/d/11KMgdNu2mSAm0Ner8UsSPQpZJS8QNqYc/view

Acceptance Criteria:

  • The profile API endpoint /controllers/mentee is implemented via a GET request.
  • The request body is properly parsed and validated for the required format.
  • Appropriate error handling is implemented, providing meaningful error messages and correct response status codes.
  • Unit tests are written to validate the functionality and correctness of the endpoint.

Additional Information:
No

Related Dependencies or References:
No

@janithlahirukariyawasam janithlahirukariyawasam added the backend A backend task label Jul 26, 2023
@anjula-sack anjula-sack added this to the Admin Functionalities milestone Aug 13, 2023
@anjula-sack anjula-sack added the admin Admin related task label Aug 13, 2023
@loshithan
Copy link

Hi @anjula-sack i would like to work on this issue

@anjula-sack
Copy link
Member

Hi @anjula-sack i would like to work on this issue

Go ahead @loshithan

@anjula-sack anjula-sack moved this to Groomed in ScholarX Jan 20, 2024
@dsmabulage
Copy link
Contributor

@anjula-sack Shall I work on this issue please ?

@dsmabulage
Copy link
Contributor

@anjula-sack can you review this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
admin Admin related task backend A backend task
Projects
Status: Groomed
Development

Successfully merging a pull request may close this issue.

4 participants