You Can Check For Article Written by me too
NOTE :-
1) all functions throw all required errors on invalid inputs or illegal operations...!!!
2) If you wish to run then product data file will be generated automatically without any need of upload or you can comment down that product code to insert your product data file and run purchase reports json file will be generated automatically when first user will buy something...!!!
3) Each Function will update JSON file after its execution automatically...!!!
Basically This is just for managing the Inventory for person having extra permissions like inserting,updating and deleting product details which should be at owner or manager level only.
In This Function Admin Will have two options either he wants all list as it is in DataBase or else he want to have a look on all products by their categories.
Category Wise :-
According to insert sequence:-
2) Display Specific Product Details ➡ (this uses product ID to filter all products we can use product name also....)
In this Function Admin will have to enter Product ID of which details he wants to check he will get all details regarding that particular product.
This Function will allow Admin to Add New Product Details in Inventory. Also provides Functionality to add new attribute property for specific product if Admin want to add other than basic 5 properties/details.
This Function will provide Admin two options either he wants to update all details of product or he wants to edit any specific detail/attribute of product. Also it will Throw Error on invalid product ID.
5) Delete Product or Remove Product From Inventory ➡ (we can give one more functionality to delete any attribute of product details to delete)
Here Admin can remove products that are out of stock or want to delete. Also it will Throw Error on invalid product ID.
Admin can have a look on user purchases with two options like either he want to check all purchase reports or want to check purchase report of any specific customer/user. This Also Provid Functionality to show message that no reports present if no purchase happened by any user...!!! Also it will Throw Error on invalid User ID.
Purchase Reports Before any user purchase :-
Purchase reports After User Purchase :-
7) Admin Can Delete Whole Database also if he wants to clear all...!!! (As This Functionality is so sensitive it is not mentioned but Code is present in commented part)
This is Basically something like customer can operate to buy products and get his bill and previous bills record too have no functionally or access to product to either insert or modify or delete it.
All Products :-
Category wise details :-
This Function will help user/customers who want to see specific product details. Also Customer can see products by there category.
This Function will help user to track his purchase and all bills reports till today. Also This Function Provides Information Only to User if He enters User ID. (we can add password features also here to increase more functionality)
If User have no purchase records :-
After User purchases products :-