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]: Create Organization Invitation Link -Backend #53

Open
Goldyn19 opened this issue Jul 18, 2024 · 2 comments
Open

[FEAT]: Create Organization Invitation Link -Backend #53

Goldyn19 opened this issue Jul 18, 2024 · 2 comments
Assignees
Labels
org Issues categorised by organisation

Comments

@Goldyn19
Copy link

Issue: Implement an API for creating Organization invite link

Description

Create an API endpoint to generate invitation links for inviting users to join an organization. This endpoint will validate the input data and generate a unique invitation link for the specified organization.

Acceptance Criteria

API Endpoint Implementation:

  • The endpoint should be accessible at /api/v1/invite/create.
  • The endpoint should accept HTTP POST requests.

Data Validation and Sanitization:

  • The API should validate the request payload to ensure the required fields (organizationId, email) are present and valid.

Invitation Link Generation:

  • Upon successful validation, the API should generate a unique invitation link for the specified organization.
  • The generated invitation link should be stored in the database with an expiration date.

Email Sending:

  • The API should send an email containing the invitation link to the specified email address.
  • The email should contain a clear and concise message with the invitation link.

Response:

  • On success, the API should return a 201 Created status code with the invitation link and a success message.
  • On failure, the API should return a 400 Bad Request status code with appropriate error messages.

Request Example:

POST /api/v1/invite/create

{
  "organizationId": "string",
  "email": "string"
}

Successful Response:

{
  "message": "Invitation link created and sent successfully",
  "data": {
    "invitationLink": "string"
  },
  "status_code": 201
}

Error Response:

{
  "message": "Failed to create invitation link",
  "errors": [
    "Invalid organization ID",
    "Email format is incorrect"
  ],
  "status_code": 400
}

Purpose

Provides a backend service to generate unique invitation links for inviting users to join an organization, ensuring the data is valid, storing the invitation link with an expiration date, and sending the invitation link via email.

Requirements

  • Develop server-side logic to handle invitation link creation.
  • Validate and sanitize incoming data.
  • Generate and store unique invitation links with expiration dates.
  • Send the generated invitation link via email to the specified address.

Expected Outcome

The API endpoint allows administrators to generate invitation links for inviting users to join an organization, ensuring the links are valid and stored with expiration dates.

status_code

  • 201: Invitation link was successfully created.
  • 400:
    • Invalid organization ID
    • Email format is incorrect
  • 500: A server error occurred

Testing

  • Write unit tests to ensure the invitation link creation endpoint validates input correctly and generates unique invitation links.
  • Perform load testing to ensure the endpoint can handle multiple requests.
  • Test various scenarios for generating invitation links (e.g., valid organization ID, invalid organization ID, invalid email format, etc.).
  • Test email delivery to ensure the invitation link is correctly sent to the specified email address.
@Goldyn19 Goldyn19 self-assigned this Jul 18, 2024
@Laban254 Laban254 added the org Issues categorised by organisation label Jul 19, 2024
@Goldyn19
Copy link
Author

slack ID: @Goldyn

@Takinnuoye5
Copy link
Contributor

this is fixed look for aniother issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
org Issues categorised by organisation
Projects
None yet
Development

No branches or pull requests

3 participants