-
Notifications
You must be signed in to change notification settings - Fork 4
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
Implement archive commands #124
Implement archive commands #124
Conversation
Codecov Report
@@ Coverage Diff @@
## master #124 +/- ##
============================================
+ Coverage 75.15% 75.62% +0.46%
- Complexity 1060 1093 +33
============================================
Files 150 156 +6
Lines 3309 3405 +96
Branches 441 450 +9
============================================
+ Hits 2487 2575 +88
- Misses 673 677 +4
- Partials 149 153 +4
Continue to review full report at Codecov.
|
src/main/java/seedu/address/logic/commands/archive/RemoveCommand.java
Outdated
Show resolved
Hide resolved
src/main/java/seedu/address/logic/commands/contact/EditCommand.java
Outdated
Show resolved
Hide resolved
src/main/java/seedu/address/logic/commands/contact/ListCommand.java
Outdated
Show resolved
Hide resolved
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 change needed, besides that LGTM. Also, just to let you know that you can add sales to archived contacts as well
@@ -8,6 +8,12 @@ contact find Find contacts given search keyword(s) | |||
contact delete Deletes a contact contact delete INDEX | |||
contact sort Sorts contact list contact sort KEYWORD [ORDER] | |||
|
|||
Archive commands | |||
---------------------- | |||
archive add Sends a contact to the archive contact archive INDEX |
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 example usage is not updated?
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.
Whoops my bad. Will update on another feature branch.
Closes #119.
New features/changes
archive add INDEX
,INDEX
must be a positive integer. Can only be used when the contact list is displayed in the GUI.archive list
.archive remove INDEX
,INDEX
must be a positive integer. Can only be used when the archive list is displayed in the GUI.contact edit
andcontact delete
work on the archived list, and behave the same way since they modify entries on the currently displayed list.Implementations
Archive features
archived
under thePerson
model. Introduce two new filters,PREDICATE_SHOW_ARCHIVED_PERSONS
andPREDICATE_SHOW_UNARCHIVED_PERSONS
to display the appropriate list whencontact list
orarchive list
command is entered. Filter contacts by the latter predicate on startup.archive add
command is entered, check whether the correct list is displayed during the execution of the command. If incorrect, throw aCommandException
with the appropriate message. Otherwise replace the targetPerson
with a copy of thePerson
with the editedarchived
flag. Thearchive remove
implementation is similar to the archive command.Contact add command change
Person
is created, its id is based on the size of the currently displayed list, and this may cause id collisions if there have been past deletions or the contact is added when the smaller list is displayed. Add a new method toModel
to get allPersons
in the StonksBook and assign the newPerson
's id based on the largest id value in the all Persons list during the execution of theAddCommand
.Testing
TypicalPerson
s which are archived by default to allow for archive command tests.archived
attribute.Possible improvements
archive delete
command to reduce the responsibility of thecontact delete
command.Demo (note:
contact archive
renamed toarchive add
)