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

feat : Add get all invitations endpoint #883

Open
8 tasks
marveldo opened this issue Aug 13, 2024 · 0 comments
Open
8 tasks

feat : Add get all invitations endpoint #883

marveldo opened this issue Aug 13, 2024 · 0 comments

Comments

@marveldo
Copy link
Contributor

marveldo commented Aug 13, 2024

Description

Implement an endpoint to list all organisation invitations in the database.

Acceptance Criteria

  • It should be a GET request at /api/v1/organisations/invites.
  • It should return all existing invites in the database
  • It should return basic information about each testimonial
  • Pagination Info & URL Args:
    Default number of payments per page: page_size=10
    Default page: page=1
    Example url /api/v1/organisations/invites

Purpose

To provide users and non users to see all existing invitations in the database .

Requirements

  • Develop backend logic to fetch all organisation invites in a database
  • Follow the Acceptance Criteria detailed above.
  • Test the endpoint for correctness and accuracy.

Expected Outcome

Users should get all existing organisation invites in the database

Tasks

  • Create endpoint (GET: /api/v1/organisation/invites) to handle retrieving all organisation invites.
  • Query the database for all organisation Invites in the database.
  • Include self explanatory success message if request goes well, or failure message, if it doesn't.
curl -X GET {rootdomain}/api/v1/organisations/invites

Response Body [Success]:

{
 "status_code": 200,
 "message": "Invites fetched Successfully",
 "data": [
       {
           "user_id": "066bb97d-1761-7b95-8000-e448ace83a31",
           "is_valid": true,
           "created_at": "2024-08-13T18:29:10.410523+01:00",
           "updated_at": "2024-08-13T18:29:10.410523+01:00",
           "expires_at": "2024-08-14T18:29:10.427162+01:00",
           "organisation_id": "066bb96e-d5a4-7219-8000-846b4f3ad9f1",
           "id": "066bb97e-66f2-7e54-8000-daaaad17154d"
       }
   ]
}

Response Body [Errors]:

  • Failed request: { "status_code": 400, "message": "Unable to retrieve organisations invites." }

Testing:

  • Write end-to-end backend unit tests for fetching the organisation invites .
  • Test all possible outcomes for the endpoint (e.g., successful, failed, etc)
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

No branches or pull requests

1 participant