Overview
InventoryManager is a desktop inventory manager application used for tracking quantity of goods, suppliers and transaction history. The user interacts with it using a CLI, and it has a GUI created with JavaFX. It is written in Java, and has about 10 kLoC.
Summary of contributions
-
Major enhancement: find transaction
-
What it does: Filter the transaction list to find specific transactions.
-
Justification: Enable user to quickly obtained information specific transactions without spending time to scroll through large amount of data.
-
Highlights: Multiple filters can be used together to enhance search range and search constraint.
-
-
Major enhancement: set warning threshold quantity for good
-
What it does: Enable user to set the threshold quantity for goods in the inventory. When a good is below its threshold quantity, it will be sorted with higher priority in the good’s panel.
-
Justification: This feature alert the user when a particular good is below its threshold quantity, and remind the user to top up the good in the inventory.
-
Highlights: Automatic alert due to any change in good’s quantity.
-
-
Minor enhancement: establish models for good, inventory, transaction and transaction history.
-
Code contributed: [Functional and Test code]
-
Other contributions:
-
Enhancements to existing features:
-
Documentation:
-
Did cosmetic tweaks to existing contents of the User Guide: #14
-
-
Community:
-
Contributions to the User Guide
Given below are sections I contributed to the User Guide. |
Setting minimum quantity for goods: warn
(By Fang Shao Hua)
Sets the minimum quantity threshold for a certain good.
When the quantity of the good is below the threshold, the quantity of the good will be mark with red color background and rank higher up in the inventory list.
All goods under their threshold quantity will be shown before all goods above their threshold quantity.
Format: warn INDEX q/MIN_QUANTITY
Example:
-
warn 5 q/100
This sets the minimum quantity threshold for good at index 5 with an quantity of 100.
warn
commandWhen a new good is added into the inventory, its minimum quantity threshold is set at 0. |
Locating transactions by search criteria: find-t
(By Fang Shao Hua)
Display list of transactions that fulfills the given search criteria.
3 types of search criteria:
-
transaction type
-
supplier’s name
-
good’s name
Format: find-t [TRANSACTION TYPE] [n/NAME] [g/GOOD NAME]
;
Example:
-
Search by transaction type:
find-t buy
display allbuy
transactions.
Currently, there are only two types of transaction: buy and sell . Type of transaction is case sensitive.
|
find-t
command that uses only [TRANSACTION TYPE] criteria-
Search by
Name
ofSupplier
:
find-t n/alex bernice
display all transactions that related toAlex
orBernice
.
find-t
command that uses only [NAME] criteria-
Search by
Good Name
ofGood
:
find-t g/apple noodle
display all transactions that related toApple
orNoodle
.
find-t
command that uses only [GOOD NAME] criteriaCombination of criteria
Criteria can be combined to give a more constraint search.
Example:
-
Search by transaction type and
GoodName
ofGood:
`find-t buy n/apple noodle
display allbuy
transactions that is related toApple
orNoodle
.
find-t
command that uses [TRANSACTION TYPE] and [GOOD NAME] criteria.
The transaction related to Noodle is no longer shown as compare to search only by
Good Name , as that transaction is a sell transaction and does not fulfill the transaction type.
|
Listing all transactions : list-t
(By Fang Shao Hua)
Shows the list of transaction history in the inventory manager.
Format: list-t
list-t
commandContributions to the Developer Guide
Given below are sections I contributed to the Developer Guide. |
Find transaction (By Fang Shao Hua)
Inventory Manager has a find transaction feature which allows the user to filter transactions, so that it saves time for the user to look for specific transactions among the transaction history.
User can provide 3 different types of filter, or combination of filters to filter the transaction list.
These 3 types of filter are TransactionType
, Name
and GoodName
.
To extract out these filter specifications, ArgumentMultimap
is needed.
TransactionType
will be stored in the preamble
, Name
will stored in the value under prefix n/
and GoodName
will be stored in the value under prefix g/
.
FindTransactionCommandParser
will called ArgumentMultimap
to parse the user input into respective values.
These values will then set up filters in the Predicate
for the model to filter the transaction list.
If the user did not specify a particular type of filter, that particular type of filter will not be activated. The feature requires at least one filter to be able to functional.
For the Name
and GoodName
filters, these filters can take in multiple Name
and GoodName
respectively.
This means that there can be multiple Name
keywords in the Name
filter, and the transaction only need to match
any of the Name
to pass the filter. Same goes for the GoodName
filter.
The transaction has to fulfill all active filters to be added into the filtered list. |
Here is a sample activity diagram that shows the general flow:
This feature mainly involves within Logic
, but also require interaction with Model
to update the filter list.
Here is a sample activity diagram that shows the flow when user inputs: find-t buy n/alice g/apple
:
Design Considerations
Aspect: Multiple filters
-
Alternative 1 (current choice): Enables multiple filters to filter the transaction list
-
Pros: Enable easier and flexible search.
-
Cons: More complex to implement, need to take care of multiple cases.
-
-
Alternative 2: Decompose search function into multiple functions, each consist of single filter
-
Pros: Easier to implement, less complexity
-
Cons: More code need to be written, and the code will have high degree of duplication. Less flexible search.
-
Set threshold for good (By Fang Shao Hua)
Inventory Manager has a set threshold feature which allows the user to set the threshold quantity for goods
in Inventory
,
so that it can alert the user when a particular good fall below its threshold quantity.
The alert mechanism is to resort the goods in the inventory such that those fall below their their threshold will be display first, and their current quantity will be display with red background.
Every command that changes the quantity of good or set new threshold for the good in the inventory will trigger a check and update the filtered list accordingly.
By default, any newly added good in the inventory will be set with threshold quantity of zero. |
Here is a sample activity diagram that shows the flow when user inputs: warn 5 q/100
: