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

Branch suggestion #182

Merged

Conversation

tankangliang
Copy link

Description

Draft of the suggestion command that will be implemented in v1.3

Testing

NIL

Remarks

This current implementation obtains a set of SuggestionType which has to be manually checked for inside SuggestionCommand before applying the necessary modifications to the client list.

I was thinking we could also have SuggestionType as an interface similar to Command and having the 3 types of suggestions as classes that implement the interface with a method that applies a modification to the client list.

@tankangliang tankangliang requested review from qwoprocks and raysonkoh and removed request for qwoprocks October 18, 2020 07:24
@codecov
Copy link

codecov bot commented Oct 18, 2020

Codecov Report

Merging #182 into master will decrease coverage by 0.46%.
The diff coverage is 48.78%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #182      +/-   ##
============================================
- Coverage     72.43%   71.96%   -0.47%     
- Complexity      533      545      +12     
============================================
  Files            90       93       +3     
  Lines          1665     1705      +40     
  Branches        171      176       +5     
============================================
+ Hits           1206     1227      +21     
- Misses          401      419      +18     
- Partials         58       59       +1     
Impacted Files Coverage Δ Complexity Δ
...a/seedu/address/logic/commands/SuggestCommand.java 0.00% <0.00%> (ø) 0.00 <0.00> (?)
.../seedu/address/logic/parser/AddressBookParser.java 50.00% <0.00%> (-1.03%) 14.00 <0.00> (ø)
...edu/address/logic/parser/SuggestCommandParser.java 0.00% <0.00%> (ø) 0.00 <0.00> (?)
...ava/seedu/address/model/client/SuggestionType.java 70.00% <70.00%> (ø) 7.00 <7.00> (?)
...ain/java/seedu/address/logic/parser/CliSyntax.java 90.00% <100.00%> (+1.11%) 1.00 <0.00> (ø)
...in/java/seedu/address/logic/parser/ParserUtil.java 98.38% <100.00%> (+4.26%) 24.00 <4.00> (+5.00)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update fb26260...75d38ee. Read the comment docs.


Format: `suggestion by/SUGGESTION_TYPE [by/SUGGESTION_TYPE]`

* SUGGESTION_TYPE must be one of the following: `contact`, `available` or `priority`
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
* SUGGESTION_TYPE must be one of the following: `contact`, `available` or `priority`
* SUGGESTION_TYPE must be one of the following: `frequency`, `available` or `contract`


Obtains a list of clients based on the suggestion type(s) passed in.

Format: `suggestion by/SUGGESTION_TYPE [by/SUGGESTION_TYPE]`
Copy link
Member

Choose a reason for hiding this comment

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

maybe change to command word suggest instead? Make it seem more like normal english

* Returns true if a given string is a valid tag name.
*/
public static boolean isValidSuggestionType(String test) {
return test.equals("contact") || test.equals("available") || test.equals("priority");
Copy link
Member

Choose a reason for hiding this comment

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

should extract these strings as static final vars

Comment on lines 36 to 39
public CommandResult execute(Model model) {
requireNonNull(model);
return new CommandResult(MESSAGE_SUGGESTION_SUCCESS);
}
Copy link
Member

Choose a reason for hiding this comment

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

Should add a TODO here to do something in the execution

@tankangliang tankangliang marked this pull request as ready for review October 18, 2020 13:27
* `suggest by/available` Obtains a list of clients where the time is 1800-2200 in the client's timezone (off work hours).
* `suggest by/frequency` Obtains a list of clients based on the last time their details were edited in TBM. Clients who have not been contacted for a longer period will be the first in the list.
* `suggest by/contract` Obtains a list of clients based on their current contract details. Clients whose contracts are expiring will be shown first.
* `suggest by/contract by/available` Similar to `suggestion by/priority` but only available clients will be shown.

Choose a reason for hiding this comment

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

Do you mean "Similar to suggestion by/contract" ?

Copy link
Author

Choose a reason for hiding this comment

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

yea forgot to change it when i updated to mingchong's changes :(



/**
* Parses {@code Collection<String> tags} into a {@code Set<Tag>}.

Choose a reason for hiding this comment

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

Possible typo. Should Collection<String> tags be Collection<String> suggestionTypes instead? Similar for the Set<Tag>.

* Represents a SuggestionType in the address book.
* Guarantees: immutable; suggestion type is valid as declared in {@link #isValidSuggestionType(String)}
*/
public class SuggestionType {

Choose a reason for hiding this comment

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

Just a suggestion, should SuggestionType be an Enum instead? Since it is only taking frequency, available and contract as valid inputs.

Copy link
Author

Choose a reason for hiding this comment

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

possible, I initially put it as an enum but it seemed too different from the rest of the code base. What do you think @qwoprocks

Copy link
Member

Choose a reason for hiding this comment

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

I think it's fine to leave it as a class for now, since if we change it to an enum it might be hard to integrate. Maybe can just KIV as a TODO.

Copy link

@raysonkoh raysonkoh left a comment

Choose a reason for hiding this comment

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

LGTM

@tankangliang tankangliang merged commit 4976e2d into AY2021S1-CS2103T-F11-4:master Oct 19, 2020
@tankangliang tankangliang added this to In progress in v1.3 via automation Oct 21, 2020
@tankangliang tankangliang added this to the v1.3 milestone Oct 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
v1.3
In progress
Development

Successfully merging this pull request may close these issues.

None yet

3 participants