hngprojects / hng_boilerplate_java_web

Apache License 2.0
157 stars 43 forks source link

[FEAT] Database Setup - Models, and Seeding #3

Open lurldgbodex opened 1 month ago

lurldgbodex commented 1 month ago

Description

Set up a database management system for our Spring Boot project using Hibernate ORM. The task includes configuring the database connection, creating entity classes, and seeding the database with initial data. This setup will help streamline data operations and ensure application can interact with the database efficiently.

Tasks

Database Configuration

Validation Steps

- Ensure the following tables and constraints are created:
    * Users
    * Profiles
    * Organisations
    * Products
- Validate the relationships:
    * A user has one profile.
    * A user has many products.
    * A user belongs to many organisations.
    * An organisation has many users.

Api Endoint

{
  "name": "John Doe",
  "id": "some-user-id",
  "email": "johndoe@example.com",
  "profile": {
    "first_name": "John",
    "last_name": "Doe",
    "phone": "1234567890",
    "avatar_url": "http://example.com/avatar.jpg"
  },
  "organisations": [
    {
      "org_id": "some-org-id-1",
      "name": "Some Org",
      "description": "Some Org Description"
    },
    {
      "org_id": "some-other-org-id-2",
      "name": "Some Other Org",
      "description": "Some Other Org Description"
    }
  ],
  "products": [
    {
      "product_id": "some-product-id",
      "name": "Some Product",
      "description": "Some Product Description"
    },
    {
      "product_id": "some-other-product-id",
      "name": "Some Other Product",
      "description": "Some Other Product Description"
    }
  ]
}

Testing

Acceptance Criteria:

Assignees

@lurldgbodex

nedssoft commented 1 month ago

@lurldgbodex you omitted the endpoint specs for the validation?

lurldgbodex commented 1 month ago

@nedssoft i have added the endpoint specs and i have pushed the code and made pull request