forked from nusCS2113-AY1819S1/addressbook-level3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #108 from muhdharun/Screening_History_Feature
Add screening history feature and add codecov
- Loading branch information
Showing
23 changed files
with
524 additions
and
181 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
s1234567a 15/10/2018-17:55:01 | ||
s1234567a 15/10/2018-17:55:07 | ||
f1234567a 15/10/2018-17:55:45 | ||
f1234567a 15/10/2018-17:55:55 | ||
s1234567a 15/10/2018-20:03:07 | ||
s1234567a 16/10/2018-11:19:30 | ||
s1234567a 16/10/2018-11:54:56 | ||
s1234567b 16/10/2018-11:58:30 | ||
s1234567b 16/10/2018-11:58:51 | ||
s1234567b 16/10/2018-12:02:34 | ||
s1234567b 16/10/2018-12:04:40 | ||
s1234567b 16/10/2018-12:05:43 | ||
s1234567b 16/10/2018-12:06:18 | ||
s1234567b 16/10/2018-12:07:06 | ||
s1234567b 16/10/2018-12:13:10 | ||
s1234567b 16/10/2018-12:14:24 | ||
s1234567b 16/10/2018-12:16:18 | ||
s1234567b 16/10/2018-12:16:43 | ||
s1234567b 16/10/2018-12:18:34 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||
<!DOCTYPE log SYSTEM "logger.dtd"> | ||
<log> | ||
<record> | ||
<date>2018-10-14T13:51:33.815695600Z</date> | ||
<millis>1539525093815</millis> | ||
<nanos>695600</nanos> | ||
<sequence>0</sequence> | ||
<logger>seedu.addressbook.parser.Parser</logger> | ||
<level>INFO</level> | ||
<class>seedu.addressbook.parser.Parser</class> | ||
<method>parseCommand</method> | ||
<thread>17</thread> | ||
<message>Parsed the user input and matching commands.</message> | ||
</record> | ||
</log> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
package seedu.addressbook.commands; | ||
|
||
|
||
import seedu.addressbook.data.exception.IllegalValueException; | ||
import seedu.addressbook.data.person.Person; | ||
import seedu.addressbook.data.person.ReadOnlyPerson; | ||
import seedu.addressbook.storage.jaxb.AdaptedAddressBook; | ||
import seedu.addressbook.storage.jaxb.AdaptedPerson; | ||
|
||
import java.io.IOException; | ||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
public class CheckCommand extends Command { | ||
|
||
|
||
public static final String COMMAND_WORD = "check"; | ||
public static final String MESSAGE_USAGE = COMMAND_WORD + ":\n" + "Gets screening history of person with specified NRIC \n\t" | ||
+ "Parameters: NRIC ...\n\t" | ||
+ "Example: " + COMMAND_WORD + " s1234567a"; | ||
private String nricKeyword; | ||
private ReadOnlyPerson matchedPerson; | ||
|
||
|
||
public CheckCommand(String nricToFind) | ||
{ | ||
this.nricKeyword = nricToFind; | ||
} | ||
|
||
public String getNricKeyword(){ | ||
return nricKeyword; | ||
} | ||
|
||
|
||
|
||
@Override | ||
public CommandResult execute() { | ||
final List<String> screeningHistory = getPersonWithNric(nricKeyword); | ||
return new CommandResult(getMessageForScreeningHistoryShownSummary(screeningHistory)); | ||
} | ||
|
||
private List<String> getPersonWithNric(String nric){ | ||
List<String> screeningHistory = new ArrayList<>(); | ||
try { | ||
screeningHistory = addressBook.readDatabase(nric); | ||
} catch (IOException e) { | ||
e.printStackTrace(); | ||
} | ||
return screeningHistory; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.