sef-global / scholarx-backend

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

Implement Get my mentees endpoint #18

Closed janithlahirukariyawasam closed 3 months ago

janithlahirukariyawasam commented 1 year ago

Description: This issue involves implementing an API to get all my mentees. The endpoint should allow clients to make a GET request to {{baseUrl}}/api/me/mentees.

[
    {
        "uuid": "e24f72d1-17b6-4f2f-8b21-07c815625b59",
        "created_at": "2023-06-01 14:27:10",
        "updated_at": "2023-06-03 11:45:20",
        "primary_email": "marysmith@gmail.com",
        "contact_email": "marysmith@gmail.com",
        "first_name": "Mary",
        "last_name": "Smith",
        "image_url": "https://www.linkedin.com/profile-image/mary-smith",
        "linkedin_url": "https://www.linkedin.com/mary-smith",
        "menteeId": 2,
        "blogs": [
            {
                "url": "https://example.com/blog"
            },
            {
                "url": "https://example.com/tech-blog"
            }
        ],
        "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"
            }
        ],
        "status": "ONGOING"
    },
    {
        "uuid": "a09b5c8a-72ae-44da-a5a0-1d7c73d822b1",
        "created_at": "2023-06-08 09:53:55",
        "updated_at": "2023-06-10 16:30:05",
        "primary_email": "alexjohnson@gmail.com",
        "contact_email": "alexjohnson@gmail.com",
        "first_name": "Alex",
        "last_name": "Johnson",
        "image_url": "https://www.linkedin.com/profile-image/alex-johnson",
        "linkedin_url": "https://www.linkedin.com/alex-johnson",
        "menteeId": 3,
        "blogs": [
            {
                "url": "https://blog.example.com/"
            },
            {
                "url": "https://techblog.example.com/"
            },
            {
                "url": "https://coding.example.com/"
            }
        ],
        "answers": [
            {
                "question": "What is your preferred programming language?",
                "answer": "JavaScript"
            },
            {
                "question": "What projects have you worked on?",
                "answer": "I have worked on a web application for a local startup."
            }
        ],
        "status": "ONGOIN"
    }
]

Tasks:

  1. Create a controller for the /controllers/profile endpoint in the backend (create the route profile 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

anjula-sack commented 3 months ago

Implemented with https://github.com/sef-global/scholarx-backend/issues/107