Skip to content
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

Implemented ability to add new loans using templates #357

Merged
merged 27 commits into from
Nov 6, 2019

Conversation

Deculsion
Copy link

@Deculsion Deculsion commented Nov 6, 2019

closes #348

@Deculsion Deculsion changed the title Template addtoloan Implemented ability to add new loans using templates Nov 6, 2019
@@ -18,7 +18,7 @@ public CommandDictionary() {
// Add Commands
commandDict.add(new Pair<>("add stock", "<StockType> <StockCode> <Quantity> <Description>"));
commandDict.add(new Pair<>("add stocktype", "<StockType>"));
commandDict.add(new Pair<>("add loan", "<StockCode> <Quantity>"));
commandDict.add(new Pair<>("add loan", "<MatricNo> <StockCode> <Quantity>"));
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice thanks


import javax.imageio.ImageTranscoder;
import java.util.ArrayList;

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cLAIM YOUR CODE

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

iTS NOT EVEN THAT MANY LINES

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

iTS WHAT THEY WANT TO SEE

String[] addInput = input.split(" +");
if (Parser.isReserved(addInput[0])) {
throw new BadInputException("'" + addInput[0] + "' is an invalid name as it is a keyword"
+ " for an existing command.");
}

if (TemplateList.templateExists(addInput[1])) {
return new AddLoanByTemplateCommand(CommandType.ADD, addInput[0], addInput[1]);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thats a nice way to do it

Copy link

@cyanoei cyanoei left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good

@cyanoei cyanoei merged commit c398449 into AY1920S1-CS2113T-F09-3:master Nov 6, 2019
cyanoei added a commit to cyanoei/eggventory-team that referenced this pull request Nov 6, 2019
cyanoei added a commit to cyanoei/eggventory-team that referenced this pull request Nov 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement loan template feature
2 participants