This project features a basic Stock Management System, enabling users to perform CRUD operations on stock items stored in a JSON file. The primary goal of this project is to demonstrate the use of Java for handling JSON data.
Project.java
- This script gathers all the app's functions. Functions present in this file are:
- checkInput - Checks if the user's input is valid.
- add - Adds new products to the stock.
- update - Updates the products present in the stock.
- delete - Deletes products present in the stock.
- read - Reads all the products present in the stock.
stockProducts.json
- The file gathers all the stock information like name, price and quantity of each product.
- Java language
- Dependencies on pom.xml: jackson, apache.
To use this repository, follow these steps:
-
Clone the repository to your local machine.
git clone https://github.com/RobisonTorres/Stock_System.git
-
Install required Maven dependencies.
-
Navigate to the directory.
cd Stock_System\src\main\java\Project.
-
Execute the Main.java.
After running the file you will be able to access the app's menu:
*****Menu Options****
=====================
*********************
1. Add new product
2. Update a product
3. Show all products
4. Delete a product
5. Exit the program
*********************
Enter your option: 3
Product Price Quantity
Headphones 15.99 10
Laptop 200.0 10
Smartphone 70.0 40
Tablet 99.99 2
Mouse 15.28 50
Tv 699.99 2