{
"status": "Unauthorized",
"message": "User not authenticated",
"status_code": 401
}
Database Design
Table organisations {
id uuid [primary key]
slug varchar(255) [unique]
owner_id uuid [foreign key to users(id)]
name varchar(255)
email varchar(255)
industry varchar(255)
type varchar(255)
country varchar(255)
address varchar(255)
state varchar(255)
description text
created_at timestamp
updated_at timestamp
}
Table organisations_user {
user_id uuid [foreign key to users(id)]
organisation_id uuid [foreign key to organisations(id)]
role varchar(255)
created_at timestamp
updated_at timestamp
}
Ref: users.id < organisations_user.user_id
Ref: organisations.id < organisations_user.organisation_id
Documentation
API Documentation
Ensure that API documentation is updated to include details about the new endpoint, request/response formats, error handling, and authentication requirements.
Technical Notes
Include any additional technical notes or considerations.
Testing Requirements
Unit Tests
Write unit tests to validate input data and SMS sending logic.
Integration Tests
Ensure end-to-end functionality is tested with integration tests.
Description
Develop a backend API for creating organisations, including authentication and authorization checks, input validation, and error handling.
Acceptance Criteria
[ ] Create Organisation Endpoint
[ ] Accepts HTTP POST requests at /api/v1/organisations.
[ ] Create a new organisation with a 201 Created status code if the user request is valid.
[ ] Validate all supplied fields.
[ ] If validation fails, return a 422 Unprocessable Entity status code with detailed error messages
Request Body
Successful Response
Unsuccessful Response
Validation Error Response
Unauthenticated Error Response
Database Design
Documentation
API Documentation
Ensure that API documentation is updated to include details about the new endpoint, request/response formats, error handling, and authentication requirements. Technical Notes
Include any additional technical notes or considerations.
Testing Requirements
Unit Tests
Write unit tests to validate input data and SMS sending logic.
Integration Tests
Ensure end-to-end functionality is tested with integration tests.