Our code is just extended ideas of AB3 AddressBook. No third party library is used except plantUML for DG diagrams.
Refer to the guide Setting up and getting started.
The Architecture Diagram given above explains the high-level design of the App.
Given below is a quick overview of main components and how they interact with each other.
Main components of the architecture
Main
(consisting of classes Main
and MainApp
) is in charge of the app launch and shut down.
The bulk of the app's work is done by the following four components:
UI
: The UI of the App.Logic
: The command executor.Model
: Holds the data of the App in memory.Storage
: Reads data from, and writes data to, the hard disk.Commons
represents a collection of classes used by multiple other components.
How the architecture components interact with each other
The Sequence Diagram below shows how the components interact with each other for the scenario where the user issues the command delete_supplier su/Hayley
.
Each of the four main components (also shown in the diagram above),
interface
with the same name as the Component.{Component Name}Manager
class (which follows the corresponding API interface
mentioned in the previous point.For example, the Logic
component defines its API in the Logic.java
interface and implements its functionality using the LogicManager.java
class which follows the Logic
interface. Other components interact with a given component through its interface rather than the concrete class (reason: to prevent outside component's being coupled to the implementation of a component), as illustrated in the (partial) class diagram below.
The sections below give more details of each component.
The API of this component is specified in Ui.java
The UI consists of a MainWindow
that is made up of parts e.g.CommandBox
, ResultDisplay
, SupplierListPanel
, StatusBarFooter
etc. All these, including the MainWindow
, inherit from the abstract UiPart
class which captures the commonalities between classes that represent parts of the visible GUI.
The UI
component uses the JavaFx UI framework. The layout of these UI parts are defined in matching .fxml
files that are in the src/main/resources/view
folder. For example, the layout of the MainWindow is specified in MainWindow.fxml
The UI
component,
Logic
component.Model
data so that the UI can be updated with the modified data.Logic
component, because the UI
relies on the Logic
to execute commands.Model
component, as it displays Supplier
object residing in the Model
.API : Logic.java
Here's a (partial) class diagram of the Logic
component:
The sequence diagram below illustrates the interactions within the Logic
component, taking execute("delete_supplier su/Hayley")
API call as an example.
NOTE: The lifeline for
DeleteCommandParser
should end at the destroy marker (X) but due to a limitation of PlantUML, the lifeline continues till the end of diagram.
How the Logic
component works:
Logic
is called upon to execute a command, it is passed to an AddressBookParser
object which in turn creates a parser that matches the command (e.g., DeleteCommandParser
) and uses it to parse the command.Command
object (more precisely, an object of one of its subclasses e.g., DeleteCommand
) which is executed by the LogicManager
.Model
when it is executed (e.g. to delete a supplier).Model
) to achieve.CommandResult
object which is returned back from Logic
.Here are the other classes in Logic
(omitted from the class diagram above) that are used for parsing a user command:
How the parsing works:
AddressBookParser
class creates an XYZCommandParser
(XYZ
is a placeholder for the specific command name e.g., AddCommandParser
) which uses the other classes shown above to parse the user command and create a XYZCommand
object (e.g., AddCommand
) which the AddressBookParser
returns back as a Command
object.XYZCommandParser
classes (e.g., AddCommandParser
, DeleteCommandParser
, ...) inherit from the Parser
interface so that they can be treated similarly where possible e.g, during testing.API : Model.java
The Model
component,
Supplier
and Product
objects (which are contained in a UniqueSupplierList
and UniqueProductList
object respectively).Supplier
objects (e.g., results of a search query) as a separate filtered list which is exposed to outsiders as an unmodifiable ObservableList<Supplier>
that can be 'observed' e.g. the UI can be bound to this list so that the UI automatically updates when the data in the list change.Product
objects as a separate filtered list which is exposed to outsiders as an unmodifiable ObservableList<Product>
.UserPref
object that represents the user’s preferences. This is exposed to the outside as a ReadOnlyUserPref
objects.Model
represents data entities of the domain, they should make sense on their own without depending on other components)Note: An alternative (arguably, a more OOP) model is given below. It has a
Tag
list in theAddressBook
, whichSupplier
references. This allowsAddressBook
to only require oneTag
object per unique tag, instead of eachSupplier
needing their ownTag
objects.
API : Storage.java
The Storage
component,
AddressBookStorage
and UserPrefStorage
, which means it can be treated as either one (if only the functionality of only one is needed).Model
component (because the Storage
component's job is to save/retrieve objects that belong to the Model
)Classes used by multiple components are in the seedu.address.commons
package.
This section describes some noteworthy details on how certain features are implemented.
The AssignProductCommand is responsible for assigning a specified product to a specified supplier in the inventory management application. This command involves several steps, primarily focused on validating input, checking assignment status, and updating the Model to reflect the new association between the product and supplier.
The AssignProductCommand follows these main steps when executed:
TThe AssignProductCommand is responsible for assigning a specified Product to a specified Supplier in an address book model. Here’s a step-by-step breakdown of how it functions:
AssignProductCommand is instantiated with a ProductName (product to be assigned) and Name (supplier to whom the product will be assigned).
This command object holds these details for execution. Execution (execute method): When the command executes, it:
After successful assignment:
The model updates the supplier and product lists to reflect the new state. It returns a success message, indicating the product and supplier names.
Aspect: Assign executes:
Target user profile:
This application is aimed towards neighbourhood convenience store/inventory managers who often need to manage their inventories. This application will help convenience store managers who:
Value proposition:
InvenTrack enables inventory managers to efficiently manage large number of supplier contact information and streamline communication, ensuring smooth operations and minimizing errors in stock replenishment, all through a typing-optimized interface The three main aspects of this product are:
Priorities: High (must have) - * * *
, Medium (nice to have) - * *
, Low (unlikely to have) - *
Priority | As a … | I want to … | So that I can… |
---|---|---|---|
* * * | new user | see usage instructions | refer to instructions when I forget how to use the App |
* * * | user | add a new supplier | |
* * * | user | delete a supplier | remove entries that I no longer need |
* * * | user | find a supplier by name | locate details of suppliers without having to go through the entire list |
* * * | user | find a supplier by tags | see only the details of suppliers with similar tags |
* * | user | hide private contact details | minimize chance of someone else seeing them by accident |
* | user with many suppliers in the address book | sort suppliers by name | locate a supplier easily |
* * * | inventory manager | add a new product | |
* * * | inventory manager | assign products to suppliers | collectively manage products which corresponding suppliers supply |
* * | inventory manager | remove suppliers/products | prune obsolete data |
* * | inventory manager | find products by name | locate details of products without having to go through the entire list |
* * | inventory manager | find products by tags | see only the details of products with similar tags |
* * | inventory manager | find products for a given supplier | see all the products a certain supplier supplies |
* * | inventory manager | set pre-defined max stock level for products | determine quantity to request for an order |
* * | experienced inventory manager | set pre-defined minimum stock level for a product | ensure availability of the product at all times |
* * | experienced inventory manager | request an order from a supplier | replenish stocks of the corresponding products |
* | inventory manager | set up automatic reordering based on stock levels and pre-defined thresholds | prevent stockouts and overstocking efficiently |
* * | novice inventory manager | easily search suppliers/products | browse large datasets quickly |
* | inventory manager | receive automated re-order alerts | reduce the risk of stockouts or overstocking |
* * | inventory manager | view payment/order history for a supplier | so that I have a clear understanding of past cash flow and plan future expenses |
* * | inventory manager | get alerts in case of any supplier issues | find a convenient replacement in time |
* * | inventory manager | use autocomplete | easily type in longer names or commands |
* * | inventory manager | quickly send standardized communication to suppliers via email or messaging without leaving the interface | streamline communication and reduce errors |
* * | inventory manager | I can store contracts and terms of agreements with suppliers in the system | quickly refer to them when negotiating orders |
* * | inventory manager | be able to get printable txt of relevant information | get hard-copy of the information |
* | experienced inventory manager | sort suppliers by some criterion | organize data based on my needs |
* | experienced inventory manager | customize my dashboard to show only the relevant information | work more efficiently based on my specific needs |
* | inventory manager | weekly summaries of inventory levels, orders and supplier communications | stay on top of opertions without manually checking the system |
* | experienced inventory manager | assign a product to multiple suppliers | have alternative options if one supplier is unable to fulfil the order |
* | experienced inventory manager | create macros/shortcuts for frequently used commands | save time |
* | experienced inventory manager | be able to see most used commands | make common processes faster |
* | inventory manager | update supplier information | organize data based on my needs |
* | inventory manager | be able to generate insights on supplier performance based on past interactions (e.g., delivery timeliness, order accuracy) | make informed decisions about ongoing supplier relationships |
(For all use cases below, the System is the Inventory Records
and the Actor is the Inventory Manager
, unless specified otherwise)
Use case: Add Products/Suppliers
Preconditions:
MSS
Inventory Manager tries to add a product/supplier.
System validates that the product name/supplier name exists in the list.
The system adds the specified product/supplier.
System updates the product/supplier information in the system.
System confirms the assignment with a success message.
Use case ends.
Extensions
1a. Product/Supplier name is in invalid format:
2a. Product/Supplier name exists:
Use case: Assign Products to Suppliers
Preconditions:
MSS
Inventory Manager tries to assign a product to a supplier.
System validates that the product name & supplier name exists in the list.
System validates the product is not assigned to any supplier.
The system assigns the specified product to the specified supplier.
System updates the product-supplier relationship in the list.
System confirms the assignment with a success message.
Use case ends.
Extensions
1a. Product/Supplier name is in invalid format:
2a. Product/Supplier name does not exist:
3a. Product is assigned to other supplier:
Use case: Unassign Products
Preconditions:
MSS
Inventory Manager tries to unassign a product to a supplier.
System validates that the product name exists in the list.
System validates the product is assigned to any one of the supplier and retrieves the supplier.
The system unassigns the specified product.
System updates the product-supplier information in the system.
System confirms the unassignment with a success message.
Use case ends.
Extensions
1a. Product/Supplier name is in invalid format:
2a. Product or Supplier name does not exist:
3a. Product is not assigned to other supplier:
Use case: Delete Suppliers/Products
Preconditions:
MSS
Inventory Manager tries to delete a particular product or supplier.
System checks if product or supplier exists which is to be deleted.
System removes the specified supplier or product from the list.
System removes any supplier-product relationship.
System confirms the deletion with a success message.
Use case ends.
Additional notes:
Extensions
1a. Product/Supplier name is in invalid format:
2a. Product/Supplier name does not exist:
Use case: Setting Thresholds for Products Stock
Preconditions:
MSS
Inventory Manager tries to set a threshold for a product.
System validates that the product name exists in the list.
System sets the specified threshold for the product as per the input prefixes.
System updates the product information in the list.
System confirms the threshold setting with a success message.
Use case ends.
Extensions
1a. Threshold amount is in invalid format(not numeric):
2a. Product name does not exist:
Use case: Updating stock levels for Products
Preconditions:
MSS
Inventory Manager tries to update stock level for a product.
System validates that the product name exists in the list.
System updates the specified stock level for the product.
System updates the product information in the list.
System confirms the threshold setting with a success message.
Use case ends.
Extensions
1a. stock level is in invalid format(not numeric):
2a. Product name does not exist:
Use case: Viewing Products/Suppliers
Preconditions:
MSS
Inventory Manager tries to view a product/supplier.
System checks whether a keyword or other optional prefixes are found.
System matches the keywords to product/supplier name and other data accordingly.
System displays the product/supplier names respectively.
System confirms the view with a result message.
Use case ends.
Extensions
1b. Product name does not exist:
2a. No keyword or other prefixes found:
Use case: Access help guide
Preconditions:
MSS
User requests for help guide.
System opens a new window or panel displaying the user guide.
User reviews the guide.
User closes the guide when finished.
Use case ends.
Extensions
1a. System unable to open user guide:
Use case ends.
17
or above installed.Given below are instructions to test the app manually.
Note: These instructions only provide a starting point for testers to work on; testers are expected to do more exploratory testing.
Initial launch
Download the jar file and copy into an empty folder
Double-click the jar file Expected: Shows the GUI with a set of sample contacts. The window size may not be optimum.
Saving window preferences
Resize the window to an optimum size. Move the window to a different location. Close the window.
Re-launch the app by double-clicking the jar file.
Expected: The most recent window size and location is retained.
Accessing the help guide
Test case 1: help
Test case 2: help me
Using autocomplete for commands
Test case 1: Start typing add_
and press the Tab key
Test case 2: Start typing xyz
and press the Tab key
Test case 3: Type assign pr/
and press the Tab key
Adding a supplier while all suppliers are being shown
Test case 1: add_supplier n/John Doe p/98765432 e/johndoe@example.com a/123 Baker Street t/Reliable
Test case 2: add_supplier n/John Doe p/98765432 e/johndoe@example.com
Test case 3: add_supplier n/John Doe p/abcd1234 e/johndoe@example.com a/123 Baker Street
Other incorrect add_supplier commands to try: add_supplier
, add_supplier n/
, add_supplier p/12345678
, add_supplier e/johndoe@example.com a/123 Baker Street
, ...
Expected: Similar to previous; no supplier is added, and appropriate error messages are displayed indicating missing compulsory fields or invalid command format.
Adding a product while all products are being shown
Test case 1: add_product n/Chocolate Bar stk/100 su/John Doe t/Snack
Test case 2: add_product n/Chocolate Bar su/Nonexistent Supplier
Test case 3: add_product n/Chocolate Bar stk/-10 su/John Doe
Other incorrect add_product commands to try: add_product
, add_product n/
, add_product stk/100
, add_product su/John Doe
, ...
Expected: Similar to previous; no product is added, and appropriate error messages are displayed indicating missing compulsory fields or invalid command format.
Assigning a product to supplier
Prerequisites:
Test case 1: Enter assign pr/Chocolate Bar su/John Doe
and press Enter.
Test case 2: Enter assign pr/Chocolate Bar su/John Doe
again and press Enter.
Test case 3: Enter assign pr/Chocolate Bar su/Nonexistent Supplier
and press Enter.
Unassigning a product from its supplier while all products are being shown
Prerequisites:
Test case 1: unassign pr/Chocolate Bar
Test case 2: unassign pr/Unassigned Product
Test case 3: unassign pr/Nonexistent Product
Other incorrect unassign commands to try: unassign
, unassign pr/
, unassign su/Supplier Name
, ...
Expected: Similar to previous; no changes are made, and appropriate error messages are displayed indicating missing compulsory fields or invalid command format.
Prerequisites:
view_product
command.Test case 1: set_threshold pr/Bubble tea min/10 max/100
Test case 2: set_threshold pr/Milk packets min/20
Test case 3: set_threshold pr/Yarn max/80
Test case 4: set_threshold pr/Sunscreen lotion min/-5
Prerequisites:
view_product
command.Test case 1: update_stock pr/Eggs stk/100
Test case 2: update_stock pr/Pasteurised/Skimmed Milk packets stk/20
Viewing suppliers using various filters
Prerequisites:
Test case 1: view_supplier
Test case 2: view_supplier n/John
Test case 3: view_supplier t/Reliable
Test case 4: view_supplier n/John t/Reliable
Other incorrect view_supplier commands to try: view_supplier x/
, view_supplier n/
, view_supplier t/
, ...
Expected: Appropriate error messages are displayed indicating missing or invalid prefixes.
Viewing products using various filters
Prerequisites:
Test case 1: view_product
Test case 2: view_product n/Chocolate
Test case 3: view_product t/Snack
Test case 4: view_product su/John Doe
Test case 5: view_product t/Snack su/John Doe
Test case 6: view_product n/Chocolate t/Snack su/John Doe sort/d
Deleting a supplier while all suppliers are being shown
Prerequisites:
view_supplier
command.Test case 1: delete_supplier su/Supplier Name
view_product
command to verify that products that were assigned the deleted supplier now have no assigned supplierTest case 2: delete_supplier su/R@chel
Test case 3: delete_supplier su/NonexistentSupplier
Other incorrect delete commands to try: delete
, delete_supplier x/
, ...
(where x is larger than the list size)
Expected: Similar to previous.
Deleting a product while all products are being shown
Prerequisites:
Test case 1: delete_product pr/Chocolate Bar
Test case 2: delete_product pr/Nonexistent Product
Test case 3: delete_product pr/Invalid/ProductName
Other incorrect delete_product commands to try: delete_product, delete_product pr/, delete_product x/Chocolate Bar, ...
Expected: Similar to previous; no product is deleted, and appropriate error messages are displayed indicating missing compulsory fields or invalid command format.
Clearing all data from the application
Prerequisites:
Test case 1: clear
Test case 2: clear extra
Exiting the application
Test case 1: exit
Test case 2: quit
or close
Verifying automatic data saving
Tasks:
Expected:
Dealing with missing/corrupted data files
Test case 1: Simulate a missing data file
Tasks:
Expected:
Test case 2: Simulate a corrupted data file