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

Add get tasks API #7

Closed

Conversation

samarpan1738
Copy link
Contributor

@samarpan1738 samarpan1738 commented Dec 7, 2024

Date: 7 Dec 2024

Developer Name: Samarpan Harit


Issue Ticket Number

Description

  1. Added get tasks API (/v1/tasks)
  2. Added pagination (/v1/tasks?page=2&limit=20)
  3. Add query param validator (serializer)
  4. Added model, repository and DTOs for task and label
  5. Added unit tests
Success Response URL - GET http://127.0.0.1:8000/v1/tasks?page=1&limit=1

Response Code: 200

{
    "links": {
        "next": "/v1/tasks?page=2&limit=1"
    },
    "tasks": [
        {
            "id": "672f7c5b775ee9f4471ff1dd",
            "displayId": "#1",
            "title": "created rest api",
            "priority": "HIGH",
            "status": "TODO",
            "assignee": {
                "id": "qMbT6M2GB65W7UHgJS4g",
                "name": "SYSTEM"
            },
            "labels": [
                {
                    "name": "Beginner Friendly",
                    "color": "#fa1e4e"
                }
            ],
            "startedAt": "2024-11-09T15:14:35.724000",
            "dueAt": "2024-11-09T15:14:35.724000",
            "createdAt": "2024-11-09T15:14:35.724000",
            "updatedAt": "2024-10-18T15:55:14.802000Z",
            "createdBy": {
                "id": "xQ1CkCncM8Novk252oAj",
                "name": "SYSTEM"
            },
            "updatedBy": {
                "id": "Kn5N4Z3mdvpkv0HpqUCt",
                "name": "SYSTEM"
            }
        }
    ]
}
Error Response (Incorrect query params) URL - GET http://127.0.0.1:8000/v1/tasks?page=1&limit=-1

Response Code: 400

{
    "statusCode": 400,
    "message": "Invalid request",
    "errors": [
        {
            "source": {
                "parameter": "limit"
            },
            "detail": "limit must be greater than or equal to 1"
        }
    ]
}
### Documentation Updated?
  • Yes
  • No

Under Feature Flag

  • Yes
  • No

Database Changes

  • Yes
  • No

Breaking Changes

  • Yes
  • No

Development Tested?

  • Yes
  • No

Screenshots

Success Response Screenshot 2024-12-17 at 10 24 21 PM
Error Response (Incorrect query params) Screenshot 2024-12-17 at 10 24 38 PM

Test Coverage

Coverage Report Screenshot 2024-12-12 at 11 55 16 PM

Additional Notes

@samarpan1738 samarpan1738 self-assigned this Dec 7, 2024
@samarpan1738 samarpan1738 force-pushed the feat-get-todo-api branch 7 times, most recently from 0a3c8af to 240501a Compare December 12, 2024 18:48
@samarpan1738 samarpan1738 marked this pull request as ready for review December 13, 2024 17:56
This was causing error while installing python requirements
@vinit717
Copy link
Member

Please break the pr into small parts

@samarpan1738
Copy link
Contributor Author

Broken this PR into smaller PRs mentioned here
Hence closing this PR

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.

Create an API to get all the todos
2 participants