sef-global / scholarx-backend

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

Implement Get a specific mentees’ details endpoint (Admin) #32

Closed janithlahirukariyawasam closed 5 months ago

janithlahirukariyawasam commented 1 year ago

Description: This issue involves implementing an API to get specific mentees’ details. The endpoint should allow Admin to make a GET request to {{baseUrl}}/api/admin/mentees/{{menteeId}}.

{
    "mentee_id": 1,
    "created_at": "2023-06-30T08:00:00Z",
    "updated_at": "2023-06-30T12:30:00Z",
    "state": "active",
    "answers": [
        {
            "question": "What programming languages do you know?",
            "answer": "Python, Java"
        },
        {
            "question": "What is your favorite programming book?",
            "answer": "Clean Code by Robert C. Martin"
        }
    ],
    "profile": {
        "created_at": "2023-06-29T09:45:00Z",
        "updated_at": "2023-06-30T14:15:00Z",
        "primary_email": "mentee@example.com",
        "contact_email": "mentee_contact@example.com",
        "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"
    }
}

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:

Additional Information: No

Related Dependencies or References: No