-
Notifications
You must be signed in to change notification settings - Fork 89
[CS2113-T17-3] Stocker #15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
[CS2113-T17-3] Stocker #15
Conversation
Add JUnit Test
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall a very good job. There is no major code quality issues that I can spot, code looks well abstracted and structured. Do take note of making sure your naming conventions are clear and similar throughout the project.
Do let me know if you need clarifications or disagree with my comments.
users = new HashMap<>(); | ||
loginStatus = false; | ||
this.in = new Scanner(System.in); | ||
interactor = new Ui(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider using a more straightforward name for your Ui object.
if (choice.equals("register")) { | ||
return "register"; | ||
} else if (choice.equals("login")) { | ||
return "login"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can consider making your checks not case sensitive if the users types "Register" or "Login", up to your team's discretion.
interactor.showPasswordMessage(); | ||
String password = in.nextLine(); | ||
|
||
while (password.equals("")) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can consider creating a constant value for empty string.
static final String EMPTY_STRING = "";
while ((line = reader.readLine()) != null) { | ||
String[] parts = line.split(":", 2); | ||
if (parts.length >= 2) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Avoid use of magic literals such as ":".
* @throws IOException if file is not found | ||
*/ | ||
public void loadFileContents(String filePath) throws IOException, InvalidDrugFormatException { | ||
File holder = new File("./drugs.txt"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider avoiding magic literals here.
return new CommandResult<>(String.format(MESSAGE_INVALID_COMMAND_FORMAT, MESSAGE_USAGE)); | ||
} | ||
|
||
List<StockEntry> entries = inventory.getStockEntries(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe allEntries would be a better name.
/** | ||
* Usage message for the 'find' command. | ||
*/ | ||
public static final String MESSAGE_USAGE = COMMAND_WORD + " /n" + ": Finds drug in inventory using name." + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unusually long constant. You can consider abstracting out some parts into smaller constants then combining them again,
public class Drug { | ||
|
||
public String name; | ||
String expiryDate; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there supposed to be an access modifier here?
public String toString() { | ||
return "Name: " + name + ", Expiry Date: " + expiryDate; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider avoiding magic literals here.
assert inventory != null : "Inventory should be initialised before executing ListCommand."; | ||
// Retrieve the list of drugs from the inventory | ||
List<StockEntry> stockEntries = inventory.getStockEntries(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"stockEntries" variable name different from FindCommand class. There should be similar naming convention across the project.
Karishma vendor supply
added parser diagram
docs/DeveloperGuide.md
Outdated
| \* \* \* | v1.0 | Receptionist | View a list of products of that category | Easily obtain an overview of the products | | ||
| \* \* \* | v1.0 | First-time user | See a list of all available actions | Better understand how to use the application | | ||
| \* \* \* | v1.0 | Inventory Manager | Find a specific drug currently in the system | Check up its details and quantities specifically | | ||
| \* \* \* | v2.0 | user | Find a to-do item by name | Locate a to-do without having to go through the entire list | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a small consideration to organise based on v1.0 then v2.0 so it looks more organised
|
||
{list here sources of all reused/adapted ideas, code, documentation, and third-party libraries -- include links to the original source as well} | ||
1. Reference to AB-3 Developer Guide | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall well done! Very organised and neat developer guide. The guide explains the application clearly with sufficient details and diagrams. I am sure more diagrams such as class diagrams would be added later on. Would also be good to add an embedded link to the java file for that specific component or command. For example, in the find command, can link the code file for quick access to the findcommand code.
- Parser : Makes sense of user input | ||
- Commands : List of various commands | ||
- CommandResult : Execution of various commands | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a tip: Can try adding links to each component so the reader can quickly jump to that section instead of having to scroll through.
|
||
The Parser class is designed to handle these considerations through a well-structured parsing process. Here's how it | ||
works: | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be clearer to reader if you bold "Splitting User Input", "Command Recognition" etc.
--- | ||
|
||
### Parser Component | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might want to add a class diagram. Just a thought
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed here. Could use a diagram here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall well done DG. Diagrams are well placed and detailed.
docs/DeveloperGuide.md
Outdated
|
||
The following sequence diagram shows how the login system class works when the program is launched. | ||
|
||
<img src="UML Diagrams/StockerToLoginSystem.png" width="280"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very comprehensive and clear sequence diagram
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should the image be sized larger instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The parser diagram look neat and correct
docs/DeveloperGuide.md
Outdated
## 5. Save Command | ||
|
||
The save command was made as a means to backup user entered drug data into the hard drive of the computer to ensure | ||
previously entered data is saved and accessable whenever the app is launched. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would a diagram demonstrating the Saving mechanism be helpful?
|
||
The following sequence diagram shows how the Find Command function works. | ||
|
||
<img src="UML Diagrams/FindCommandDiagram.png" width="350"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are the activation bars meant to terminate at that point? Or is the diagram cut off / incomplete?
management system. | ||
|
||
The following sequence diagram shows how the parser class works when the program is running. | ||
<img src="UML Diagrams/ParserDiagram.png" width="500"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the 2nd Incorrect Command activation meant to be there? If so, is it intended to be in an Opt box?
|
||
The following sequence diagram shows how the parser class works when the program is running. | ||
<img src="UML Diagrams/ParserDiagram.png" width="500"> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the creating of incorrect command is wrong. There should be a constructor and should return from the IncorrectCommand class instead of a self invocation.
--- | ||
|
||
## 3. Delete Command | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can consider adding sequence diagram for this command and the following commands as well except help and save. But i am guessing it is suppose to be done just haven't done it
The architecture diagram given above explains the high level design of the application. The diagram depicts the key | ||
component of the application that enables it to provide its functionalities. | ||
|
||
Majority of the app's work is done by the following components |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think storage should be one of the components as well. Can add a sequence and class diagram for storage component.
Add Command Result in Developer Guide
Update FindCommand Junit Test for serial number
Modify delete DG
docs/DeveloperGuide.md
Outdated
|
||
The following sequence diagram shows how the login system class works when the program is launched. | ||
|
||
<img src="UML Diagrams/StockerToLoginSystem.png" width="280"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should the image be sized larger instead?
The following sequence diagram shows how the Find Command function works. | ||
|
||
<img src="UML Diagrams/ListCommandDiagram.png" width="350"> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does the ListCommand persist after displaying results?
docs/DeveloperGuide.md
Outdated
|
||
The following sequence diagram shows how the Command Result function works. | ||
|
||
<img src="UML Diagrams/CommandResultDiagram.png" width="350"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do the command results and commands persist after calling?
and criterion as input. | ||
|
||
3. **Search Process:** The method processes the search by iterating through the list of `StockEntry` objects in the | ||
inventory. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Simple search algorithm that minimises errors and allows for better scoping. Very apt and functional!
Karishma developer guide
updated PPP
Update PPP
Update PPP
Update PPP, UML diagrams, UG and DG
Update PPP
Update User Guide
Changedstuff
fix ppp link
parser diagram
Update PPP
Stocker is a desktop app that will provide quick access to currently available stock, track incoming stock and expiration dates, and categorize drugs based on different labels. It is optimized for use via a Command Line Interface (CLI). If you can type fast, Stocker can get your inventory management tasks done faster than traditional GUI apps.