Getting Started • API Endpoints • Database • Business Rules • Dockerfile •
This is a simple API that you can use in your retail software.
If you want just use the API for your front-ends projects, download the api-venimarket.jar file.
To take a look, modify and debug the code in your IDE, clone this repository:
git clone https://github.com/Venicode/venimarket-api.git
To running this project, you must have all prerequisites below:
- Java SDK 17+
When download to api-venimarket.jar is done, move this file whatever you want and open a command prompt. Then, check the path's file and type the command below:
C:\path\to\file>java -jar api-venimarket.jar
If you do this correctly, the api server will run:
After that, you can access the swagger page: http://localhost:8080/swagger-ui/index.html#/
Example to request something: http://localhost:8080/supplier
All endpoints that you can use in the application group by entities:
Supplier Endpoints
GET /supplier - Retrieve a list of all suppliers.
GET /supplier/{id} - Retrieve a specific supplier by ID.
POST /supplier - Register a new supplier.
PUT /supplier/{id} - Update the supplier informations.
DELETE /supplier/{id} - Delete(disable changing isActive=false) a specific supplier by ID.
Product Category Endpoints
GET /productCategory - Retrieve a list of all product categories.
GET /productCategory/{id} - Retrieve a specific product category by ID.
POST /productCategory - Register a new product category.
PUT /productCategory/{id} - Update the product category informations.
DELETE /productCategory/{id} - Delete a specific product category by ID.
Product Endpoints
GET /product - Retrieve a list of all products.
GET /product/{barcode} - Retrieve a specific product by barcode.
POST /product - Register a new product.
PUT /product/{id} - Update the product informations.
DELETE /product/{id} - Delete(disable changing isActive=false) a specific product by ID.
Method Payment Endpoints
GET /methodPayment - Retrieve a list of all method payments.
GET /methodPayment/{id} - Retrieve a specific method payment by ID.
GET /methodPayment/descriptionMethodPayment/{descriptionMethodPayment} - Retrieve a specific method payment by description.
POST /methodPayment - Register a new method payment.
PUT /methodPayment/{id} - Update the method payment informations.
DELETE /methodPayment/{id} - Delete a specific method payment by ID.
Customer Endpoints
GET /customer - Retrieve a list of all customers.
GET /customer/{id} - Retrieve a specific customer by ID.
POST /customer - Register a new customer.
PUT /customer/{id} - Update the customer informations.
DELETE /customer/{id} - Delete(disable changing isActive=false) a specific customer by ID.
Cash Register Endpoints
GET /cashRegister - Retrieve a list of all cash registers.
PUT /cashRegister/CloseCashRegister/{id} - Close a specific cash register by Id.
Order Endpoints
GET /order - Retrieve a list of all orders.
POST /order - Register a new order.
Item Order Endpoints
GET /itemOrder - Retrieve a list of all item orders.
POST /itemOrder - Register a new item order.
For this project, I chose the H2 Database, it stores data in memomy, being ideal for testing, where it doesn't not persist the data on disk. So, when closing the terminal, all data will be lost.
When you register a new sell, if it's your first once, a new cash register will be created. But, in your second sell, the balance will be added, unless you close the cash register. If the last cash register is closed, a new one will be created.
If you are familiar with Docker, be comfortable to download the image about this project: Download docker file
Then, just execute the command below in your command prompt or in your virtual machine:
docker pull venitt/api-venimarket