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

Update success message after a linkloan command #102

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import seedu.address.logic.Messages;
import seedu.address.logic.commands.exceptions.CommandException;
import seedu.address.model.Model;
import seedu.address.model.person.Loan;
import seedu.address.model.person.Person;

/**
Expand All @@ -37,7 +38,8 @@
+ PREFIX_START_DATE + "2024-02-15 "
+ PREFIX_RETURN_DATE + "2024-04-21";

public static final String MESSAGE_SUCCESS = "New loan linked: %1$s";
public static final String MESSAGE_SUCCESS = "New loan linked to: %1$s\n"
+ "%2$s";

private final LinkLoanDescriptor toLink;

Expand Down Expand Up @@ -66,9 +68,10 @@

Person targetPerson = lastShownList.get(linkTarget.getZeroBased());

model.addLoan(toLink, targetPerson);
Loan linkedLoan = model.addLoan(toLink, targetPerson);

Check warning on line 71 in src/main/java/seedu/address/logic/commands/LinkLoanCommand.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/seedu/address/logic/commands/LinkLoanCommand.java#L71

Added line #L71 was not covered by tests

return new CommandResult(String.format(MESSAGE_SUCCESS, Messages.format(targetPerson)));
return new CommandResult(String.format(MESSAGE_SUCCESS, targetPerson.getName(),

Check warning on line 73 in src/main/java/seedu/address/logic/commands/LinkLoanCommand.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/seedu/address/logic/commands/LinkLoanCommand.java#L73

Added line #L73 was not covered by tests
linkedLoan));

Choose a reason for hiding this comment

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

Nice addition of better success message.

}

@Override
Expand Down
Loading