/ProductOrderDetail_Application

This is a sample Spring Boot application with Maven that includes entities for products and sales orders. The application exposes APIs to create, update, and list products, as well as to add and list sales orders.

Primary LanguageJava

ProductOrderDetail_Application

This is a sample Spring Boot application with Maven that includes entities for products and sales orders. The application exposes APIs to create, update, and list products, as well as to add and list sales orders.

Technologies Useed

Java , Spring Boot, Maven

MYSQL ,JPA/Hibernate

Lombok

Swager_Ui

EndPoints

Products

  • POST /api/products/add: Create a new product
  • PATCH /api/products/{id}/{qty}: Update the stock quantity of a product
  • GET /api/products/all: List all products
  • Sales Orders

  • POST /api/salesOrders/add : Add a new sales order
  • GET /api/sales-orders/all : List all sales orders
  • Request Examples

    Create a new prudcuts

    Post /api/products/add
    {
    "name": "Product 1",
    "description": "This is a test product",
    "brandName": "Brand A",
    "salePrice": 100.0,
    "stockQuantity": 10
    }

    Update the stock quantity of a product

    PATCH /api/products/1/5

    list all products

    GET /api/products/all

    Add new Sales order

    POST /api/salesOrder/add
    {
    "sales_Id": 0,
    "customer": "string",
    "timeStamp": "2023-04-16T07:51:06.344Z",
    "orderDetails": [
    {
    "orderDet_Id": 0,
    "product": {
    "productId": 0,
    "description": "string",
    "brandName": "string",
    "salePrice": 0,
    "stockQuantity": 0,
    "name": "string"
    },
    "saleQuantity": 0,
    "discount": 0
    }
    ]
    }

    ER-Diagram

    Er-Diagram-Sample-Springboot-app

    ## Swagger_ui