StockPal

StockPal’s User Guide

Introduction

StockPal is a command line interface (CLI) application designed to help small E-commerce business owners who are just starting up to manage their stock-taking effectively. Users would mostly interact with StockPal via text commands.

StockPal is compatible for usage on Windows, Mac and Linux systems.

Not sure where to begin? Start by learning how to utilize this user guide.

Table of Contents

Using This Guide

Below are the symbols used in this guide and the meaning of these symbols.

Symbol Meaning
:exclamation: The exclamation mark symbol indicates actions that you should be cautious about.
:information_source: The i symbol indicates notes that are important for you when using the application.
:bulb: The lightbulb symbol indicates tips that hold useful information or advice that might be helpful for you.

Quick Start

Downloading StockPal

  1. Ensure you have Java 11 or above installed in your computer.

  2. Download the latest StockPal.jar from here.

  3. Copy the file to the folder you want to use as the home folder for the application. For example,C:\Users\setupuser\Documents\StockPal\StockPal.jar.

Running StockPal

  1. For Windows users:

    Open a command prompt terminal. You can do so by searching for command prompt in the Windows search bar.

    images/Windows-find-cmd.png

    For MAC users:

    Open a terminal. You can do so by searching for the terminal using the Spotlight icon in the menu bar. Click on the terminal.

    images/Mac-find-cmd.png

  2. Determine the file path to the home folder of StockPal.jar. You can do so by navigating to StockPal.jar in File Explorer (Windows) or Finder (MAC). For example, the image below shows that the file path to the home folder of StockPal.jar is C:\Users\setupuser\Documents\StockPal.

    images/Windows-home-folder.png

  3. In the command prompt terminal, navigate to the home folder using the command cd <file path to the home folder>. For example, cd C:\Users\setupuser\Documents\StockPal.

    images/cmd-navigate-to-home-folder.png

  4. In the command prompt terminal, run StockPal using the command java -jar StockPal.jar.

    images/cmd-navigate-to-home-folder.png

Glossary

The following is a collection of frequently used terms in the User Guide and their meanings.

PID (Product ID) - a unique number assigned to each product for identification purposes.

CLI (Command Line Interface) - a text-based interface used to interact with our program by entering commands into a terminal.

CSV (Comma-Separated Values) - a file format used to store tabular data. Each line represents a row of data, and each field within a row is usually separated by a comma.

JSON (JavaScript Object Notation) - a file format for storing and transporting data.

Features

:information_source: Notes about the command format:

Viewing Help: help

Provides command details for all or specific commands.

When to Use?

This is a useful command to start with if you are new to StockPal!

Format: help [COMMAND]

Parameter Representation Constraints
COMMAND The command for which you wish to display the help page - Must be a valid command keyword.
- If COMMAND is left empty, command details for all commands will be displayed.
- List of valid command keywords: help, new, list, edit, delete, inflow, outflow, history, find, exit
:information_source: Note: COMMAND is case-insensitive.
e.g. help will be considered the same as HELP and hELP.

Example 1

Input:

help inflow 

Output:

====================================================================================
Command: inflow

Description: Increases the quantity of a product from the existing amount.

Usage: inflow PID a/INCREMENT_AMOUNT

Options:
PID                   Product ID of product
INCREMENT_AMOUNT      Quantity of product to add
====================================================================================

Adding a New Product: new

Creates a new product to the inventory and assigns a unique Product ID (PID) to it.

When to Use?

Format:

new n/PRODUCT_NAME q/INITIAL_QUANTITY [p/PRICE] [d/DESCRIPTION]
Parameter Representation Constraints
PRODUCT_NAME Name of new product to be added. - Limited to 50 characters.
- Allowed characters:
a-z, A-Z, 0-9,  , (), [], ,, ., -, _
- Name must be unique, i.e. no existing product with the same product name.
INITIAL_QUANTITY Quantity of the new product to be added. Must be an integer more than or equal to 0 and smaller or equal to INT_MAX (2147483647).
PRICE Price of the new product to be added. - Must be a numeric value more than equal to 0.
- Can have at most 2 decimal places.
DESCRIPTION Description of the new product to be added. - Limited to 100 characters.
- Allowed characters:
a-z, A-Z, 0-9,  , (), [], ,, ., -, _
:information_source: Note:
  1. PRODUCT_NAME is case-insensitive, which means a name in lowercase will be considered as having the same name as the name in uppercase.
    e.g. Pen will be considered the same as pen and PEN.
  2. When entering 0, 0.0 or 0.00 for PRICE, StockPal will deem it as not having PRICE entered, and display [X] for PRICE when using list command.

Example 1

Input:

new n/Pen q/40 

Output:

Product has been added.

Explanation:

This command adds your product to the inventory. The product’s details are as follows:

Example 2

Input:

new n/Ruler q/30 p/2.00 d/Curve Ruler

Output:

Product has been added.

Explanation:

This command adds your product to the inventory. The product’s details are as follows:

Listing All Products: list

Lists all products in inventory.

Format: list [-sn|-sq]

Sorting:

:bulb: Tip: Some of the commands may require PID as a compulsory field. Use list to obtain the required PID of the particular product you want to access.

Example 1

Context:

Input: list

Output:

====================================================================================
1. PID: 1  |  Name: Pen  |  Quantity: 40  |  Price: [X]
Description: [X]
====================================================================================
2. PID: 2  |  Name: Ruler  |  Quantity: 30  |  Price: $2.00
Description: Curve Ruler
====================================================================================

Example 2

Context:

Input: list -sq

Output:

====================================================================================
1. PID: 2  |  Name: Ruler  |  Quantity: 30  |  Price: $2.00
Description: Curve Ruler
====================================================================================
2. PID: 1  |  Name: Pen |  Quantity: 40  |  Price: [X]
Description: [X]
====================================================================================

Editing Product Details: edit

Edits details of an existing product in the inventory.

Format:

edit PID [n/PRODUCT_NAME] [q/QUANTITY] [p/PRICE] [d/DESCRIPTION]
:information_source: Note: At least one parameter must be provided.
Parameter Representation Constraints
PID Product ID of the existing product. Must be a valid Product ID of an existing product.
PRODUCT_NAME New product name of the product to be edited. - Limited to 50 characters.
- Allowed characters:
a-z, A-Z, 0-9,  , (), [], ,, ., -, _
- Name must be unique, i.e. no existing product with the same product name.
QUANTITY New quantity of the product to be edited. Must be an integer more than or equal to 0, and smaller or equal to INT_MAX (2147483647).
PRICE New price of the product to be edited. - Must be a numeric value more than equal to 0.
- Can have at most 2 decimal places.
DESCRIPTION New description of the product to be edited. - Limited to 100 characters.
- Allowed characters:
a-z, A-Z, 0-9,  , (), [], ,, ., -, _
:information_source: Note:
  1. PRODUCT_NAME is case-insensitive, which means a name in lowercase will be considered as having the same name as the name in uppercase.
    e.g. Pen will be considered the same as pen and PEN.
  2. When entering 0, 0.0 or 0.00 for PRICE, StockPal will deem it as not having PRICE entered, and display [X] for PRICE when using list command.
:bulb: Tip: If you are looking to increase or decrease the amount of stock of a particular product, use inflow or outflow instead. It is strongly not recommended to use edit for incoming or outgoing stocks. Unlike inflow and outflow, the change in product quantity using the edit feature will not be tracked and hence will not appear under history.

Example 1

Context:

Input:

edit 1 p/1.50 d/Sarasa Blue Pen

Output:

Product details have been updated.

Example 2

Context

Input:

edit 2 n/Curve Ruler q/35 p/2.50 d/Math Curve Ruler

Output:

Product details have been updated.

Increasing a Product Quantity: inflow

Increase the quantity of an existing product in the inventory at the specific PID by a specified amount.

Format:

inflow PID a/QUANTITY
Parameter Representation Constraints
PID Product ID of the existing product. Must be a valid Product ID of an existing product.
QUANTITY Quantity of the product to be added. Must be an integer more than 0 and smaller or equal to INT_MAX (2147483647).
:bulb: Tip: Use this command instead of edit if you already have an existing product and just want to increase the quantity when you have new stocks.

Example 1

Context:

Input:

inflow 1 a/20

Output:

Quantity updated. Quantity: 60

Example 2

Context:

Input:

inflow 2 a/10

Output:

Quantity updated. Quantity: 45

Explanation: The inflow command will update the quantity of the product by performing addition of the current quantity and the inflow quantity.

Decreasing a Product Quantity: outflow

Decrease the quantity of an existing product in the inventory at the specific PID.

Format:

outflow PID a/QUANTITY
Parameter Representation Constraints
PID Product ID of the existing product. Must be a valid Product ID of an existing product.
QUANTITY Quantity of the product to be removed. Must be an integer more than 0 and smaller or equal to INT_MAX (2147483647).
:bulb: Tip: Use this command instead of edit if you already have an existing product and just want to decrease the quantity when you sell your stocks.

Example 1

Context:

Input:

outflow 2 a/30

Output:

Warning! This product is low in quality.
Quantity updated. Quantity: 15
:bulb: Tip: Note that the warning will only appear once when the quantity first falls below quantity of 20. All low quantity products will be displayed when you exit the program.
:bulb: Tip: Do note that if you added a new product with a quantity lower than the threshold quantity, warning will also be raised.

Example 2

Context:

Input:

outflow 1 a/35

Output:

Quantity updated. Quantity: 25
:bulb: Tip: Since the new quantity does not fall below 20, no warning is given.

Explanation: The outflow command will update the quantity of the product by performing subtraction of the outflow quantity from the current quantity.

Viewing Past Inflow / Outflow of Existing Product: history

When to Use?

When you want to check on the previous inflow or outflow of a product, use this command!

Format:

history PID
Parameter Representation Constraints
PID Product ID of the existing product. Must be a valid Product ID of an existing product.

Example 1

Input:

history 1

Output:

1. PID: 1  |  Change in quantity: 20  |  Date of inflow: 29-03-2024 17:27:24
2. PID: 1  |  Change in quantity: -35  |  Date of outflow: 05-04-2024 17:33:40

Explanation:
This command will find any inflow or outflow quantities of your product which has PID 1, which is your Pen product.
As seen, you tried to:

Example 2

Input:

history 2

Output:

1. PID: 2  |  Change in quantity: 10  |  Date of inflow: 18-03-2024 08:00:31
2. PID: 2  |  Change in quantity: -30  |  Date of outflow: 01-04-2024 10:00:00

Explanation:
This command will find any inflow or outflow quantities of your Curve Ruler which has PID 2.
As seen, you tried to:

Deleting a Product and its Details: delete

Deletes an existing product from the inventory.

Format: delete PID

Parameter Representation Constraints
PID Product ID of the existing product. Must be a valid Product ID of an existing product.

Example 1

Input:

delete 1

Output:

Product has been deleted.

Example 2

Suppose the product with PID 3 is not in the inventory. As such you should not be able to delete anything.

Input: delete 3

Output: Product with the following PID is not found: 3

Find a Keyword in the Product List: find

When to use?

This is a useful command for when you want to know if there is already an existing product that matches your keyword. Or when you just want to get the product’s PID in a long list of products.

Format: find KEYWORD

:information_source: Note:

Example 1

Input:

find Ruler

Output:

====================================================================================
1. PID: 2  |  Name: Curve Ruler  |  Quantity: 15  |  Price: $2.50
Description: Math Curve Ruler
====================================================================================

Explanation:
This command will find any product name that contains Ruler in the product’s name, regardless of case sensitivity.

Example 2

Input:

find THISISASUPERLONGSTRINGANDTHEREISNOMATCH

Output:

No matches found.

Explanation:
This command will find any product name that contains THISISASUPERLONGSTRINGANDTHEREISNOMATCH in the product’s name, regardless of case sensitivity. There is however no match in any of the product’s names in the product list.

Exiting the program: exit

Exits the program.

Format:

exit

Example 1

Input:

exit

Output:

These products have low quantity! Please top up!
====================================================================================
PID: 2  |  Name: Curve Ruler  |  Quantity: 15 
====================================================================================
Exiting program, goodbye!

Explanation: This command will exit the program and print out all the products that are low in quantity. Our program will print a statement to bid you goodbye!

Example 2

Input:

exit wrong usage

Output:

Exit Command does not take in any extra arguments!

Explanation: In example 2, the literal string input:exit wrong usage was entered by the user.

To address possible typo issues caused by typing “exit” when you want to type “edit”, ensure that no arguments should be passed to the Exit command.

Saving the Data

StockPal data is saved in the hard disk automatically after any command that changes the data. There is no need to save manually.

Editing the Data File

StockPal inventory data is saved automatically as a CSV file [JAR file location]/data/inventory.csv, while the past transactions data is saved automatically as a JSON file [JAR file location]/data/transactions.json. Advanced users are welcome to update data directly by editing these data files, even though it is highly not recommended.

:information_source: Note: Allowed characters to use when editing the data file:
a-z, A-Z, 0-9,  , (), [], ,, ., -, _
:exclamation:Caution: If your changes to the data file makes its format invalid, StockPal will not discard the data, but instead display an error that the data has erroneous input, and close the app thereafter.
Furthermore, certain edits can cause StockPal to behave in unexpected ways (e.g., if a value entered is outside the acceptable range). For example,
Therefore, edit the data file only if you are confident that you can update it correctly, as we would not be responsible for any errors caused by the manual editing of the data file, and it is recommended to make a backup of the file before editing it.

Command Summary

This section provides a quick overview of all the commands. For more detailed information on the command format, click on the command to be redirected to the command’s details under the Features section.

Command Description
help [COMMAND] Provides command details for all or specific commands
new n/PRODUCT_NAME q/INITIAL_QUANTITY [p/PRICE] [d/DESCRIPTION] Creates a new product
list [-sn|-sq] Lists all products in the inventory
edit PID [n/PRODUCT_NAME] [q/QUANTITY] [d/DESCRIPTION] [p/PRICE] Edits an existing product’s field
inflow PID a/QUANTITY Increases the quantity of an existing product in the inventory at the specific PID
outflow PID a/QUANTITY Decreases the quantity of an existing product in the inventory at the specific PID
history PID Finds the list of transactions for a particular product based on its PID
delete PID Deletes a product
find KEYWORD Finds the list of products that contains the keyword in their name
exit Exits the program

FAQ

Q: How do I transfer my data to another computer?

A: There are 2 ways to transfer your StockPal data over to another device.
Method 1:

  1. Install StockPal on your new device.
  2. On your old device, locate inventory.csv and transactions.json in StockPal’s home folder. Copy over the 2 files to the home folder of StockPal on your new device.
  3. On your new device, run StockPal.jar (located within the home folder of StockPal).

Method 2:

  1. On your old device, locate StockPal’s home folder.
  2. Copy the entire folder over to your new device.
  3. On your new device, run StockPal.jar (located in the copied folder from Step 2).