PROJECT: InventoryManager


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:

      • Updated the GUI to display 3 panels: supplier list panel, inventory panel and transaction history panel.(Pull requests #63, #83)

    • Documentation:

      • Did cosmetic tweaks to existing contents of the User Guide: #14

    • Community:

      • PRs reviewed (with non-trivial review comments): #102, #103

      • Reported bugs and suggestions for other teams in the class (examples: 1)

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
Figure 1. Demo for warn command
When 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:

  1. transaction type

  2. supplier’s name

  3. good’s name

Format: find-t [TRANSACTION TYPE] [n/NAME] [g/GOOD NAME];

original
Figure 2. GUI before demo

Example:

  • Search by transaction type:
    find-t buy
    display all buy transactions.

Currently, there are only two types of transaction: buy and sell. Type of transaction is case sensitive.
find t buy
Figure 3. Demo for find-t command that uses only [TRANSACTION TYPE] criteria
  • Search by Name of Supplier:
    find-t n/alex bernice
    display all transactions that related to Alex or Bernice.

  • The search is case insensitive. e.g bernice will match Bernice

  • The order of the keywords does not matter. e.g. Bernice Yu will match Yu Bernice

  • Only the name is searched.

  • Only full words will be matched e.g. bernice will not match bernices

  • Supplier matching at least one keyword will be returned (i.e. OR search). e.g. Alex Bernice will return Alex Yeoh, Bernice Yu

find t name
Figure 4. Demo for find-t command that uses only [NAME] criteria
  • Search by Good Name of Good:
    find-t g/apple noodle
    display all transactions that related to Apple or Noodle.

find t good name
Figure 5. Demo for find-t command that uses only [GOOD NAME] criteria

Combination of criteria
Criteria can be combined to give a more constraint search.

Example:

  • Search by transaction type and GoodName of Good:
    `find-t buy n/apple noodle

    display all buy transactions that is related to Apple or Noodle.

combination
Figure 6. Demo for 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
Figure 7. Demo for list-t command

Contributions 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:

FindTransactionActivityDiagram

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:

FindTransactionSequenceDiagram

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:

SetThresholdSequenceDiagram
SetThresholdSequenceDiagram2