{
"name": "New Product",
"description": "Description of the new product"
}
Sample Response:
{
"status": 201,
"message": "Product created successfully",
"product": {
"product_id": "new-product-id",
"name": "New Product",
"description": "Description of the new product"
}
}
Purpose
This setup ensures that the database is properly configured, validated, and populated with initial data, providing a solid foundation for the application. It also allows users to create new products, saving the product ID in the database.
Requirements
Use an ORM to manage database operations.
Configure the database to use PostgreSQL by default.
Follow migration, model, and service patterns.
Implement product creation functionality for logged-in users.
Expected Outcome
[ ] The database should be properly set up and validated.
[ ] Initial data should be seeded into the database.
[ ] Endpoints should be functional and return the expected data.
[ ] Users should be able to create new products, and the product ID should be saved in the database.
Implementation Steps
Clone the boilerplate for your Node.js Express framework.
Create a branch named chore/database-setup from the base branch.
Implement database setup, including migrations, models, and service patterns.
Create and seed the necessary tables.
Implement the endpoints for retrieving user information.
Implement the endpoint for creating a new product.
Ensure proper authentication and authorization for the product creation endpoint.
Validate the setup by ensuring the endpoints work as expected.
sql
This issue now includes the feature where a logged-in user can create a new product, and the product ID is saved in the database.
Description
Database Setup
DB Configuration
Set up a database for the chosen framework’s ORM.
Setup Validation
To validate the setup, you must complete the following steps:
Tables and Constraints
users
,profiles
,organisations
,products
tables.Tables Seeding
Acceptance Criteria
Endpoints
[GET] api/v1/users/user_one_id
Sample Response:
[GET] api/v1/users/user_two_id
Sample Response:
[POST] api/v1/products
Request Body:
Sample Response:
Purpose
This setup ensures that the database is properly configured, validated, and populated with initial data, providing a solid foundation for the application. It also allows users to create new products, saving the product ID in the database.
Requirements
Use an ORM to manage database operations.
Configure the database to use PostgreSQL by default.
Follow migration, model, and service patterns.
Implement product creation functionality for logged-in users.
Expected Outcome
[ ] The database should be properly set up and validated.
[ ] Initial data should be seeded into the database.
[ ] Endpoints should be functional and return the expected data.
[ ] Users should be able to create new products, and the product ID should be saved in the database.
Implementation Steps