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

[v1.5][F14-B2] Medeina #69

Open
wants to merge 903 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
903 commits
Select commit Hold shift + click to select a range
d846c85
Merge pull request #203 from Aquarinte/v1.5
wynonaK Apr 11, 2018
b31ad7a
Add 2 methods to StringUtil
Aquarinte Apr 11, 2018
a6c95da
Add descriptions for options and prefixes
Aquarinte Apr 11, 2018
381124d
Update Exception
Robert-Peng Apr 11, 2018
e0393bf
Fix checkstyle error
Aquarinte Apr 11, 2018
4214e1f
Merge pull request #11 from CS2103JAN2018-F14-B2/master
Robert-Peng Apr 11, 2018
6fa9bff
Remove newline in StringUtil
Aquarinte Apr 11, 2018
ba29f54
Update Autocomplete.java and CommandBox.java to support descriptions …
Aquarinte Apr 11, 2018
f9045b2
Update and add JUnit tests for autocomplete
Aquarinte Apr 11, 2018
491ba13
Fix time interval to 30
Robert-Peng Apr 11, 2018
727d3bd
Set hour height even bigger
Robert-Peng Apr 11, 2018
de3e8d6
Help Wynona to update her collate for sampleDataUtil
Aquarinte Apr 11, 2018
8d77bbc
Merge pull request #197 from Robert-Peng/DisableButtons
wynonaK Apr 11, 2018
c099cc0
Merge pull request #205 from Aquarinte/v1.5
wynonaK Apr 11, 2018
5c9884b
Merge pull request #206 from Robert-Peng/IntervalBug
Aquarinte Apr 11, 2018
4400592
Merge pull request #25 from CS2103JAN2018-F14-B2/master
Aquarinte Apr 11, 2018
94fe56a
Remove codacy badge and glitter badge
Aquarinte Apr 11, 2018
dcc0e79
Add circleci config file
Aquarinte Apr 11, 2018
8aedcd0
Create project portfolio docs
Aquarinte Apr 11, 2018
df1c702
Add new line at EOF
Aquarinte Apr 11, 2018
2bc57a3
Merge pull request #207 from Aquarinte/updateDocs
Robert-Peng Apr 11, 2018
8dcbb7f
Update error messages for add command
Aquarinte Apr 11, 2018
24fcc0a
Modify string formatting for Person class toString() method
Aquarinte Apr 11, 2018
578c629
Update Nric constraints message
Aquarinte Apr 11, 2018
d60dd17
Modify string formatting for Appointment class toString() method
Aquarinte Apr 11, 2018
b2253ca
Correct error message in add command parser
Aquarinte Apr 11, 2018
d1d53c5
Update and add new JUnit tests
Aquarinte Apr 11, 2018
80b318b
Removed unused imports and add collate
Aquarinte Apr 11, 2018
c68b42e
Fix checkstyle error
Aquarinte Apr 11, 2018
3e92bfd
Updated ParserUtil
chialejing Apr 11, 2018
23695f3
Updated constraint messages for NRIC and Tag
chialejing Apr 11, 2018
228102e
Fixed regression for JUnit tests
chialejing Apr 11, 2018
e9507ad
Added tests for ParserUtil
chialejing Apr 11, 2018
d211b6c
minor change
Robert-Peng Apr 12, 2018
98c630d
Update Tab pane and text colour
Robert-Peng Apr 12, 2018
0703b85
ID
Robert-Peng Apr 12, 2018
3bebc1f
Update UI color bug
Robert-Peng Apr 12, 2018
56a6c1a
Code improve for parserutil
Aquarinte Apr 12, 2018
2e6bc6b
Fix checkstyle error
Aquarinte Apr 12, 2018
54af85c
Update and add new JUnit tests for add command
Aquarinte Apr 12, 2018
0fcae65
Fix 2 parse methods
Aquarinte Apr 12, 2018
af391ad
Merge pull request #213 from Aquarinte/v1.5
wynonaK Apr 12, 2018
6d9688a
changes of tab color
Robert-Peng Apr 12, 2018
579e95e
Update UG format and made some amendments
Aquarinte Apr 12, 2018
62204ec
Merge pull request #212 from Robert-Peng/ListView
Aquarinte Apr 12, 2018
d8b5459
Merge pull request #214 from Aquarinte/updateDocs
Robert-Peng Apr 12, 2018
77f106f
Merge pull request #196 from Robert-Peng/ShowTab
Aquarinte Apr 12, 2018
534c531
Merge pull request #26 from CS2103JAN2018-F14-B2/master
Aquarinte Apr 12, 2018
cb55fe6
Merge pull request #12 from CS2103JAN2018-F14-B2/master
Robert-Peng Apr 12, 2018
5263f61
Add badge for CircleCi
Aquarinte Apr 12, 2018
db7c115
Rename labels for panels to "Contacts" and "Pet Patients"
Aquarinte Apr 12, 2018
d32e1b1
Update light theme css for commandbox area
Aquarinte Apr 12, 2018
963ecbf
Merge branch 'master' into updateParserUtil
chialejing Apr 12, 2018
1ee6f6e
Update Nric.java
chialejing Apr 12, 2018
bff8c78
Merge pull request #21 from CS2103JAN2018-F14-B2/master
wynonaK Apr 12, 2018
f940cbc
Resolved conflicts with AddCommandSystemTest
chialejing Apr 12, 2018
27e6955
Code refactoring for Autocomplete
Aquarinte Apr 12, 2018
e8abd66
Merge pull request #211 from CS2103JAN2018-F14-B2/updateParserUtil
Aquarinte Apr 12, 2018
df2f6de
Add key to toggle autocomplete on/off
Aquarinte Apr 12, 2018
0ca5295
added some minor tests.
wynonaK Apr 12, 2018
6559b38
Added some small tests.
wynonaK Apr 12, 2018
3f15e22
Update Ui.png, autocomplete.png and UG
Aquarinte Apr 12, 2018
37b45e2
Update portfolio
Robert-Peng Apr 12, 2018
b75c2b3
Update autocomplete.png
Aquarinte Apr 12, 2018
00caff9
Merge pull request #215 from Aquarinte/v1.5
chialejing Apr 12, 2018
bfc77b6
Merge pull request #216 from Aquarinte/updateUI
chialejing Apr 12, 2018
e61c5b4
Added JUnit Tests for EditCommandParserTest
chialejing Apr 12, 2018
444b1ca
Removed trailing whitespaces
chialejing Apr 12, 2018
a0dc10b
refactored the find command.
wynonaK Apr 12, 2018
2da1f52
Removed unused imports.
wynonaK Apr 12, 2018
3666c6e
Add tags for UG and updated dark theme image
Aquarinte Apr 12, 2018
c3a9a1c
Update DG
Aquarinte Apr 12, 2018
3b52aa5
Update project portfolio
Aquarinte Apr 12, 2018
820238a
Fix checkstyle error
Aquarinte Apr 12, 2018
e653ba0
Fix PPP
Aquarinte Apr 12, 2018
1483fa3
Update PPP
Aquarinte Apr 12, 2018
e3064c3
Update tags
Aquarinte Apr 12, 2018
1d8f7ca
Added tests for find command
wynonaK Apr 12, 2018
7f4f1ba
Fixed errors, added more tests.
wynonaK Apr 12, 2018
e55f139
Update Project Portfolio
chialejing Apr 12, 2018
3faec3c
Minor Edits to PP
chialejing Apr 12, 2018
929b7e1
Merge pull request #217 from Robert-Peng/Portfolio
chialejing Apr 12, 2018
3d9858c
Merge pull request #219 from wynonaK/findRefactorNewTests
chialejing Apr 12, 2018
cd7c301
Merge pull request #27 from CS2103JAN2018-F14-B2/master
Aquarinte Apr 13, 2018
ca46fd1
Merge pull request #218 from CS2103JAN2018-F14-B2/EditCommandTests
wynonaK Apr 13, 2018
b246b66
Merge pull request #13 from CS2103JAN2018-F14-B2/master
Robert-Peng Apr 13, 2018
4cdde9b
Update autocomplete to not show suggestions for commands that do not …
Aquarinte Apr 13, 2018
268317f
Add JUnit tests
Aquarinte Apr 13, 2018
12fab80
Fix checkstyle error
Aquarinte Apr 13, 2018
78c75d5
Update Portfolio details
Robert-Peng Apr 13, 2018
bbb2f6d
Add tests to cover all relevant lines
Aquarinte Apr 13, 2018
6cbb29c
Merge pull request #223 from Aquarinte/v1.5
chialejing Apr 13, 2018
98ef6f1
Merge pull request #222 from Robert-Peng/UpdatePortfolio
chialejing Apr 13, 2018
61f0539
Merge branch 'master' into updateDocs
Aquarinte Apr 13, 2018
6f4c46d
Merge pull request #221 from CS2103JAN2018-F14-B2/updateDocs
Aquarinte Apr 13, 2018
36576c5
new tests.
wynonaK Apr 13, 2018
bb37b3a
Merge pull request #220 from Aquarinte/updateDocs
chialejing Apr 13, 2018
b954552
Merge pull request #14 from CS2103JAN2018-F14-B2/master
Robert-Peng Apr 13, 2018
9194c7f
Remove collate author in LightTheme css
Aquarinte Apr 13, 2018
9f26d4f
Update collate files
Aquarinte Apr 13, 2018
7c4399b
Merge pull request #224 from Aquarinte/v1.5
chialejing Apr 13, 2018
c6dd25c
Minor Edits
chialejing Apr 13, 2018
c522b1b
ug changes
wynonaK Apr 13, 2018
a265d83
Merge pull request #225 from CS2103JAN2018-F14-B2/release1.5rc
Aquarinte Apr 13, 2018
d32a6b9
added tags for listappt
wynonaK Apr 13, 2018
26884a1
updated links for team
wynonaK Apr 13, 2018
3830c20
Merge pull request #226 from wynonaK/ugwk12
Aquarinte Apr 13, 2018
ed856bf
Merge pull request #28 from CS2103JAN2018-F14-B2/master
Aquarinte Apr 13, 2018
65da42f
Change PastDateAppointment Exception into AddCommandParser.
Robert-Peng Apr 13, 2018
6f1eee7
update Ui diagram, document calendarFx issue, document user warning a…
Robert-Peng Apr 13, 2018
6c2fe7b
Update image
Robert-Peng Apr 13, 2018
5e0dc9f
Implemented Checks for Edit Command
chialejing Apr 13, 2018
f7856cf
Removed Whitespace
chialejing Apr 13, 2018
2492237
added new sample data
wynonaK Apr 13, 2018
766c8ce
Merge pull request #228 from CS2103JAN2018-F14-B2/updateEditCommand
Aquarinte Apr 13, 2018
ca98d93
Set light theme as default theme
Aquarinte Apr 13, 2018
1901874
Merge pull request #227 from Robert-Peng/ExceptionUpdate
wynonaK Apr 13, 2018
e880551
Add formatting for pet patient card
Aquarinte Apr 13, 2018
f9bf400
fixed indentation errors.
wynonaK Apr 13, 2018
8d62bda
Document calendarFX bug in UG, update Manual testing for list command
Robert-Peng Apr 13, 2018
6728e0c
fixed checkstyle errors
wynonaK Apr 13, 2018
578e5db
commit
Robert-Peng Apr 13, 2018
8c238ff
Merge pull request #229 from wynonaK/tests
Aquarinte Apr 13, 2018
a2d38a9
Further updates in Exception
Robert-Peng Apr 13, 2018
42045f3
minor change
Robert-Peng Apr 13, 2018
ded4e4c
Checkstyle error
Robert-Peng Apr 13, 2018
865544f
Formatting for person card
Aquarinte Apr 13, 2018
326ac41
Merge pull request #230 from Robert-Peng/ExceptionUpdate
chialejing Apr 13, 2018
b693341
Fix JUnit
Aquarinte Apr 13, 2018
9fd41f2
Fix JUnit tests
Aquarinte Apr 13, 2018
aa9732d
Merge pull request #231 from Aquarinte/updateUI
Robert-Peng Apr 13, 2018
c50b3c9
Update messages for existing commands (clear, exit, list)
Aquarinte Apr 13, 2018
b111fb6
Update application size
Aquarinte Apr 13, 2018
e18d981
Merge pull request #29 from CS2103JAN2018-F14-B2/master
Aquarinte Apr 13, 2018
8a35c20
Update messages and refactor code
Aquarinte Apr 13, 2018
b0ac902
Update messages
Aquarinte Apr 13, 2018
9daa9a4
Change options to point to CliSyntax options
Aquarinte Apr 13, 2018
cffc81b
Merge pull request #232 from Aquarinte/v1.5
chialejing Apr 14, 2018
6152939
Update autocomplete
Aquarinte Apr 14, 2018
2be38ff
Update gui settings
Aquarinte Apr 14, 2018
db044b2
Merge pull request #233 from Aquarinte/v1.5
chialejing Apr 14, 2018
2cfa5f6
Merge pull request #234 from Aquarinte/updateUI
chialejing Apr 14, 2018
327204f
Update UserGuide about CalendarView clicking, pop out window and othe…
Robert-Peng Apr 14, 2018
4acbd54
Update diagrams and DG for autocomplete
Aquarinte Apr 14, 2018
76840ff
Update DG
Aquarinte Apr 14, 2018
f2d9808
Update autocomplete DG
Aquarinte Apr 14, 2018
f201702
Merge pull request #22 from CS2103JAN2018-F14-B2/master
wynonaK Apr 14, 2018
307a387
Changed as much AddressBook to Medeina, as much Owner/Person to conta…
wynonaK Apr 14, 2018
b40a44d
Merge pull request #236 from wynonaK/updateOwnerToContact
Aquarinte Apr 14, 2018
47a432b
Merge pull request #23 from CS2103JAN2018-F14-B2/master
wynonaK Apr 14, 2018
f65997f
Changes in UG
Robert-Peng Apr 14, 2018
d0bf2be
Update Ui Class Diagram
Robert-Peng Apr 14, 2018
961e118
Update UGDG
Aquarinte Apr 14, 2018
fec6628
Update size for autocomplete.png
Aquarinte Apr 14, 2018
c7f441d
Document no scroll bar in entry view.
Robert-Peng Apr 14, 2018
9e94d86
Update UGDG
Aquarinte Apr 14, 2018
ed5471a
Updated UG
chialejing Apr 14, 2018
6a94076
Fixed bug where history doesn't show in a section of its own
chialejing Apr 14, 2018
6e96db5
Updated Error Messages
chialejing Apr 14, 2018
fe2636b
Minor code update
Aquarinte Apr 15, 2018
c4762d7
Fix checkstyle
Aquarinte Apr 15, 2018
bcf5eec
Merge pull request #238 from CS2103JAN2018-F14-B2/EditCommandMessage
Aquarinte Apr 15, 2018
537677c
Merge pull request #15 from CS2103JAN2018-F14-B2/master
Robert-Peng Apr 15, 2018
ed258ff
Update Error for Edit Command
chialejing Apr 15, 2018
7f8dfbe
Update Undo, Redo, List, Clear command and diagrams
Robert-Peng Apr 15, 2018
f6601b6
Merge pull request #240 from CS2103JAN2018-F14-B2/editCmdEmergencyUpdate
Aquarinte Apr 15, 2018
ca82af3
Merge pull request #239 from Aquarinte/v1.5
Robert-Peng Apr 15, 2018
0adaa57
Merge pull request #237 from CS2103JAN2018-F14-B2/updateUG_v1.5_0414
Robert-Peng Apr 15, 2018
39fa48c
Bug Fixed
chialejing Apr 15, 2018
514bb1e
Update UG CLI section and add command
Aquarinte Apr 15, 2018
224cbf0
Update UG Cli section
Aquarinte Apr 15, 2018
579f966
Update diagrams
Robert-Peng Apr 15, 2018
db23473
Merge branch 'master' into Diagrams
Robert-Peng Apr 15, 2018
093d1dc
Updated the find command error.
wynonaK Apr 15, 2018
ee351c7
Update UG
Aquarinte Apr 15, 2018
9e12a61
Merge pull request #235 from Robert-Peng/UpdateDGPort
Aquarinte Apr 15, 2018
5f97b71
Minor update
Robert-Peng Apr 15, 2018
2520963
Merge branch 'Diagrams' of https://github.com/Robert-Peng/main into D…
Robert-Peng Apr 15, 2018
6c4196a
Fix checkstyle, update introduction, update autocomplete to show max …
Aquarinte Apr 15, 2018
88e7470
Upload colours.png for introduction
Aquarinte Apr 15, 2018
ec6dda5
Remove black line at the end of SS
Robert-Peng Apr 15, 2018
bccc370
Update UG command syntax image and some phrasing
Aquarinte Apr 15, 2018
ac2dc17
Merge branch 'master' into updateDocs
Aquarinte Apr 15, 2018
4ae25df
Update image size for colours.png in UG
Aquarinte Apr 15, 2018
83c23a5
Resize colours.png to 300 in UG
Aquarinte Apr 15, 2018
d8a6572
Bold a word
Aquarinte Apr 15, 2018
b38df26
Update example for add
Aquarinte Apr 15, 2018
3f2bcfb
pet patient
Robert-Peng Apr 15, 2018
fe76917
Merge pull request #241 from CS2103JAN2018-F14-B2/editCmdEmergencyUpdate
Aquarinte Apr 15, 2018
69aa7c7
Made changes to DG based on comment
Aquarinte Apr 15, 2018
c87eac3
Merge pull request #242 from Robert-Peng/Diagrams
Aquarinte Apr 15, 2018
2f7e207
Update image sizes
Robert-Peng Apr 15, 2018
0084073
Merge pull request #244 from Aquarinte/updateDocs
Robert-Peng Apr 15, 2018
1d735c0
Updates to changes requested.
wynonaK Apr 15, 2018
bae9627
Minor update
Robert-Peng Apr 15, 2018
5f462d6
Merge branch 'master' into dgUpdatesListApptDelete
wynonaK Apr 15, 2018
188b3a7
Update image sizes
Robert-Peng Apr 15, 2018
83258c4
Change size
Robert-Peng Apr 15, 2018
4154789
Change size
Robert-Peng Apr 15, 2018
2b13216
Merge pull request #243 from wynonaK/dgUpdatesListApptDelete
chialejing Apr 15, 2018
a4ea075
Merge pull request #24 from CS2103JAN2018-F14-B2/master
wynonaK Apr 15, 2018
7ac72fe
Merge pull request #245 from Robert-Peng/Diagrams
chialejing Apr 15, 2018
67f0925
Merge pull request #16 from CS2103JAN2018-F14-B2/master
Robert-Peng Apr 15, 2018
1713928
Merge pull request #30 from CS2103JAN2018-F14-B2/master
Aquarinte Apr 15, 2018
da5d442
Update Portfolio
Robert-Peng Apr 15, 2018
a26a1b5
Updated DG and Diagrams
chialejing Apr 15, 2018
6b74d38
Updated project portfolio page
Aquarinte Apr 15, 2018
8575603
Added spacing after figure
chialejing Apr 15, 2018
9ce52ad
Update pic name
Robert-Peng Apr 15, 2018
f0c7d26
Image size
Robert-Peng Apr 15, 2018
0f5fefc
Ui pic size
Robert-Peng Apr 15, 2018
1020e11
Update UG Examples for Edit
chialejing Apr 15, 2018
cdbd8cd
Minor Edit to UG
chialejing Apr 15, 2018
8f0f38c
Trying to shorten PPP
chialejing Apr 15, 2018
38263b8
Still trying to shorten PPP...
chialejing Apr 15, 2018
adcec2f
Update DG for find command.
wynonaK Apr 15, 2018
2b7c4e3
Update PPP
wynonaK Apr 15, 2018
ba0d1e6
Update Portfolio
Robert-Peng Apr 15, 2018
a1d84b1
Fix for wrong message shown
chialejing Apr 15, 2018
6cb44fa
Collate
Robert-Peng Apr 15, 2018
690aacc
Updated user guide
wynonaK Apr 15, 2018
f5a4948
Fixed bug in parser util.
wynonaK Apr 15, 2018
8a4702a
updated positions for PPP.
wynonaK Apr 15, 2018
9eda5e4
Update UG DG and PPP
Aquarinte Apr 15, 2018
4763de5
Fixed failing test cases.
wynonaK Apr 15, 2018
dba0f94
Fix trailing whitespace
Aquarinte Apr 15, 2018
3a9b145
Updated EditCommandSystemTest
chialejing Apr 15, 2018
bb74e30
Move the undo/redo section down. Update DG
Aquarinte Apr 15, 2018
e04278b
Merge pull request #249 from CS2103JAN2018-F14-B2/fixForEditCommand
Aquarinte Apr 15, 2018
ca4fc75
Merge pull request #247 from CS2103JAN2018-F14-B2/updateDG_20180415_1938
Aquarinte Apr 15, 2018
8a05b39
collate code
Robert-Peng Apr 15, 2018
5888f5c
Update UG PPP
Aquarinte Apr 15, 2018
64d585e
EOF
Robert-Peng Apr 15, 2018
4765078
Remove -fa option
Aquarinte Apr 15, 2018
e601415
Remove option -fa
Aquarinte Apr 15, 2018
cdacd8b
Merge pull request #246 from Robert-Peng/UpdateDG
chialejing Apr 15, 2018
5bd3619
Update autocomplete png
Aquarinte Apr 15, 2018
3190199
Updates
wynonaK Apr 15, 2018
a98f259
Merge branch 'master' into v1.5
Aquarinte Apr 15, 2018
f08353f
no message
wynonaK Apr 15, 2018
bd9952f
no message
wynonaK Apr 15, 2018
db45399
Merge pull request #248 from Aquarinte/v1.5
Robert-Peng Apr 15, 2018
67006a1
Collate v1.5
chialejing Apr 15, 2018
edaa292
Collate
wynonaK Apr 15, 2018
3def45c
Merge branch 'master' into updateDGFind
wynonaK Apr 15, 2018
7999505
Merge pull request #251 from CS2103JAN2018-F14-B2/collate1.5
Robert-Peng Apr 15, 2018
3d9d1fe
Update DeveloperGuide.adoc
wynonaK Apr 15, 2018
aba9ca1
Update DeveloperGuide.adoc
wynonaK Apr 15, 2018
5d4f796
Merge pull request #250 from wynonaK/updateDGFind
chialejing Apr 15, 2018
3b7d99a
Update UserGuide.adoc
Aquarinte Jan 28, 2019
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
2 changes: 1 addition & 1 deletion src/main/java/seedu/address/MainApp.java
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ private String getApplicationParameter(String parameterName) {
* The data from the sample address book will be used instead if {@code storage}'s address book is not found,
* or an empty address book will be used instead if errors occur when reading {@code storage}'s address book.
*/
private Model initModelManager(Storage storage, UserPrefs userPrefs) {
private Model initModelManager(Storage storage, UserPrefs userPrefs) throws Exception {
Optional<ReadOnlyAddressBook> addressBookOptional;
ReadOnlyAddressBook initialData;
try {
Expand Down
11 changes: 9 additions & 2 deletions src/main/java/seedu/address/logic/commands/AddCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@

import seedu.address.logic.commands.exceptions.CommandException;
import seedu.address.model.appointment.Appointment;
import seedu.address.model.appointment.exceptions.ConcurrentAppointmentException;
import seedu.address.model.appointment.exceptions.DuplicateAppointmentException;
import seedu.address.model.appointment.exceptions.DuplicateDateTimeException;
import seedu.address.model.appointment.exceptions.PastAppointmentException;
import seedu.address.model.person.Nric;
import seedu.address.model.person.Person;
import seedu.address.model.person.exceptions.DuplicateNricException;
Expand Down Expand Up @@ -208,6 +210,10 @@ public CommandResult executeUndoableCommand() throws CommandException {
throw new CommandException(MESSAGE_DUPLICATE_APPOINTMENT);
} catch (DuplicateDateTimeException e) {
throw new CommandException(MESSAGE_DUPLICATE_DATETIME);
} catch (ConcurrentAppointmentException e) {
throw new AssertionError("Concurrent appointment.");
} catch (PastAppointmentException e) {
throw new AssertionError("Past-date appointment.");
}
}

Expand All @@ -232,7 +238,7 @@ private CommandResult addNewPetPatient() throws DuplicatePetPatientException, Co
* Add a new appointment for an existing pet patient under an existing person.
*/
private CommandResult addNewAppt() throws CommandException, DuplicateAppointmentException,
DuplicateDateTimeException {
DuplicateDateTimeException, ConcurrentAppointmentException, PastAppointmentException {
person = model.getPersonWithNric(ownerNric);
petPatient = model.getPetPatientWithNricAndName(ownerNric, petPatientName);

Expand All @@ -253,7 +259,8 @@ private CommandResult addNewAppt() throws CommandException, DuplicateAppointment
* (New appointment for the new patient under a new person).
*/
private CommandResult addAllNew() throws DuplicatePersonException, DuplicateNricException,
DuplicatePetPatientException, DuplicateAppointmentException, DuplicateDateTimeException {
DuplicatePetPatientException, DuplicateAppointmentException, DuplicateDateTimeException,
ConcurrentAppointmentException, PastAppointmentException {
model.addPerson(person);
model.addPetPatient(petPatient);
model.addAppointment(appt);
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/seedu/address/logic/parser/ParserUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,7 @@ public static Optional<Email> parseEmail(Optional<String> email) throws IllegalV
return email.isPresent() ? Optional.of(parseEmail(email.get())) : Optional.empty();
}

//@@author Robert-Peng
/**
* Parses a {@code String nric} into a {@code NRIC}.
* Leading and trailing whitespaces will be trimmed.
Expand Down Expand Up @@ -379,6 +380,7 @@ public static Optional<Nric> parseNric(Optional<String> nric) throws IllegalValu
return nric.isPresent() ? Optional.of(parseNric(nric.get())) : Optional.empty();
}

//@@author
/**
* Parses a {@code String tag} into a {@code Tag}.
* Leading and trailing whitespaces will be trimmed.
Expand Down
20 changes: 17 additions & 3 deletions src/main/java/seedu/address/model/AddressBook.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,15 @@
import java.util.stream.Collectors;

import javafx.collections.ObservableList;

import seedu.address.model.appointment.Appointment;
import seedu.address.model.appointment.UniqueAppointmentList;
import seedu.address.model.appointment.exceptions.AppointmentDependencyNotEmptyException;
import seedu.address.model.appointment.exceptions.AppointmentNotFoundException;
import seedu.address.model.appointment.exceptions.ConcurrentAppointmentException;
import seedu.address.model.appointment.exceptions.DuplicateAppointmentException;
import seedu.address.model.appointment.exceptions.DuplicateDateTimeException;
import seedu.address.model.appointment.exceptions.PastAppointmentException;
import seedu.address.model.person.Person;
import seedu.address.model.person.UniquePersonList;
import seedu.address.model.person.exceptions.DuplicateNricException;
Expand Down Expand Up @@ -78,11 +81,13 @@ public void setTags(Set<Tag> tags) {
}

public void setAppointments(List<Appointment> appointments)
throws DuplicateAppointmentException, DuplicateDateTimeException {
throws DuplicateAppointmentException, DuplicateDateTimeException,
ConcurrentAppointmentException, PastAppointmentException {
this.appointments.setAppointments(appointments);
}

public void setPetPatients(List<PetPatient> petPatients) throws DuplicatePetPatientException {
public void setPetPatients(List<PetPatient> petPatients) throws DuplicatePetPatientException,
ConcurrentAppointmentException, PastAppointmentException {
this.petPatients.setPetPatients(petPatients);
}

Expand Down Expand Up @@ -114,6 +119,10 @@ public void resetData(ReadOnlyAddressBook newData) {
throw new AssertionError("AddressBook should not have duplicate appointments.");
} catch (DuplicateDateTimeException ddte) {
throw new AssertionError("AddressBook should not have appointments on the same slot");
} catch (ConcurrentAppointmentException cae) {
throw new AssertionError("AddressBook should not add appointments to on-going appointment slots");
} catch (PastAppointmentException pae) {
throw new AssertionError("AddressBook should not add appointments with past DateTime");
}

setTags(new HashSet<>(newData.getTagList()));
Expand All @@ -125,6 +134,10 @@ public void resetData(ReadOnlyAddressBook newData) {
setPetPatients(syncedPetPatientList);
} catch (DuplicatePetPatientException e) {
throw new AssertionError("AddressBooks should not have duplicate pet patients");
} catch (ConcurrentAppointmentException cae) {
throw new AssertionError("AddressBook should not add appointments to on-going appointment slots");
} catch (PastAppointmentException pe) {
throw new AssertionError("AddressBook should not add appointments with past DateTime");
}
}

Expand Down Expand Up @@ -302,7 +315,8 @@ private Appointment syncWithMasterTagList(Appointment appointment) {
*
* @throws DuplicateAppointmentException if an equivalent person already exists.
*/
public void addAppointment(Appointment a) throws DuplicateAppointmentException, DuplicateDateTimeException {
public void addAppointment(Appointment a) throws DuplicateAppointmentException, DuplicateDateTimeException,
ConcurrentAppointmentException, PastAppointmentException {
Appointment appointment = syncWithMasterTagList(a);
// TODO: the tags master list will be updated even though the below line fails.
// This can cause the tags master list to have additional tags that are not tagged to any appointment
Expand Down
5 changes: 4 additions & 1 deletion src/main/java/seedu/address/model/Model.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@
import seedu.address.model.appointment.Appointment;
import seedu.address.model.appointment.exceptions.AppointmentDependencyNotEmptyException;
import seedu.address.model.appointment.exceptions.AppointmentNotFoundException;
import seedu.address.model.appointment.exceptions.ConcurrentAppointmentException;
import seedu.address.model.appointment.exceptions.DuplicateAppointmentException;
import seedu.address.model.appointment.exceptions.DuplicateDateTimeException;
import seedu.address.model.appointment.exceptions.PastAppointmentException;
import seedu.address.model.person.Nric;
import seedu.address.model.person.Person;
import seedu.address.model.person.exceptions.DuplicateNricException;
Expand Down Expand Up @@ -64,7 +66,8 @@ void updateAppointment(Appointment target, Appointment editedAppointment)
void deleteTag(Tag tag);

/** Adds the given appointment */
void addAppointment(Appointment appointment) throws DuplicateAppointmentException, DuplicateDateTimeException;
void addAppointment(Appointment appointment) throws DuplicateAppointmentException, DuplicateDateTimeException,
ConcurrentAppointmentException, PastAppointmentException;

/** Deletes the given appointment. */
void deleteAppointment(Appointment target) throws AppointmentNotFoundException;
Expand Down
5 changes: 4 additions & 1 deletion src/main/java/seedu/address/model/ModelManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,10 @@
import seedu.address.model.appointment.Appointment;
import seedu.address.model.appointment.exceptions.AppointmentDependencyNotEmptyException;
import seedu.address.model.appointment.exceptions.AppointmentNotFoundException;
import seedu.address.model.appointment.exceptions.ConcurrentAppointmentException;
import seedu.address.model.appointment.exceptions.DuplicateAppointmentException;
import seedu.address.model.appointment.exceptions.DuplicateDateTimeException;
import seedu.address.model.appointment.exceptions.PastAppointmentException;
import seedu.address.model.person.Nric;
import seedu.address.model.person.Person;
import seedu.address.model.person.exceptions.DuplicateNricException;
Expand Down Expand Up @@ -231,7 +233,8 @@ public synchronized void deleteAppointment(Appointment target) throws Appointmen

@Override
public synchronized void addAppointment(Appointment appointment)
throws DuplicateAppointmentException, DuplicateDateTimeException {
throws DuplicateAppointmentException, DuplicateDateTimeException,
ConcurrentAppointmentException, PastAppointmentException {
addressBook.addAppointment(appointment);
updateFilteredAppointmentList(PREDICATE_SHOW_ALL_APPOINTMENTS);
indicateAddressBookChanged();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,18 @@
import static java.util.Objects.requireNonNull;
import static seedu.address.commons.util.CollectionUtil.requireAllNonNull;

import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import seedu.address.model.appointment.exceptions.AppointmentNotFoundException;
import seedu.address.model.appointment.exceptions.ConcurrentAppointmentException;
import seedu.address.model.appointment.exceptions.DuplicateAppointmentException;
import seedu.address.model.appointment.exceptions.DuplicateDateTimeException;
import seedu.address.model.appointment.exceptions.PastAppointmentException;

//@@author wynonaK
/**
Expand All @@ -37,17 +41,32 @@ public boolean contains(Appointment toCheck) {
*
* @throws DuplicateAppointmentException if the person to add is a duplicate of an existing person in the list.
*/
public void add(Appointment toAdd) throws DuplicateAppointmentException, DuplicateDateTimeException {
public void add(Appointment toAdd) throws DuplicateAppointmentException, DuplicateDateTimeException,
PastAppointmentException, ConcurrentAppointmentException {
requireNonNull(toAdd);

if (contains(toAdd)) {
throw new DuplicateAppointmentException();
}

if (toAdd.getDateTime().isBefore(LocalDateTime.now())) {
throw new PastAppointmentException();
}

ArrayList<LocalDateTime> timeList = new ArrayList<>();

for (Appointment a : internalList) {
timeList.add(a.getDateTime());
if (a.getDateTime().equals(toAdd.getDateTime())) {
throw new DuplicateDateTimeException();
}
}

for (LocalDateTime dateTime : timeList) {
if (toAdd.getDateTime().isAfter(dateTime) && toAdd.getDateTime().isBefore(dateTime.plusMinutes(30))) {
throw new ConcurrentAppointmentException();
}
}
internalList.add(toAdd);
}

Expand Down Expand Up @@ -93,7 +112,8 @@ public void setAppointments(UniqueAppointmentList replacement) {
}

public void setAppointments(List<Appointment> appointments)
throws DuplicateAppointmentException, DuplicateDateTimeException {
throws DuplicateAppointmentException, DuplicateDateTimeException,
ConcurrentAppointmentException, PastAppointmentException {
requireAllNonNull(appointments);
final UniqueAppointmentList replacement = new UniqueAppointmentList();
for (final Appointment appointment : appointments) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package seedu.address.model.appointment.exceptions;

//@@author Robert-Peng

import seedu.address.commons.exceptions.IllegalValueException;

/**
* Represents an error message when user attempt to add new appointment that
* interfere with other appointment time interval
*/
public class ConcurrentAppointmentException extends IllegalValueException {

public ConcurrentAppointmentException () {
super("AddressBook should not add appointments to on-going appointment slots");
}

}

Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package seedu.address.model.appointment.exceptions;

//@@author Robert-Peng

import seedu.address.commons.exceptions.IllegalValueException;

/**
* Represents an error message when adding appointment with a past date
*/
public class PastAppointmentException extends IllegalValueException {

public PastAppointmentException() {
super("AddressBook should not add appointments with past DateTime");
}
}

6 changes: 6 additions & 0 deletions src/main/java/seedu/address/model/util/SampleDataUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@
import seedu.address.model.ReadOnlyAddressBook;
import seedu.address.model.appointment.Appointment;
import seedu.address.model.appointment.Remark;
import seedu.address.model.appointment.exceptions.ConcurrentAppointmentException;
import seedu.address.model.appointment.exceptions.DuplicateAppointmentException;
import seedu.address.model.appointment.exceptions.DuplicateDateTimeException;
import seedu.address.model.appointment.exceptions.PastAppointmentException;
import seedu.address.model.person.Address;
import seedu.address.model.person.Email;
//import seedu.address.model.person.NRIC;
Expand Down Expand Up @@ -137,6 +139,10 @@ public static ReadOnlyAddressBook getSampleAddressBook() {
throw new AssertionError("sample data cannot contain double booked appointments", e);
} catch (DuplicateAppointmentException e) {
throw new AssertionError("sample data cannot contain duplicate appointments", e);
} catch (ConcurrentAppointmentException cae) {
throw new AssertionError("AddressBook should not add appointments to on-going appointment slots");
} catch (PastAppointmentException pae) {
throw new AssertionError("AddressBook should not add appointments with past DateTime");
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import seedu.address.commons.util.FileUtil;
import seedu.address.model.ReadOnlyAddressBook;


/**
* A class to access AddressBook data stored as an xml file on the hard disk.
*/
Expand Down Expand Up @@ -42,7 +43,7 @@ public Optional<ReadOnlyAddressBook> readAddressBook() throws DataConversionExce
* @throws DataConversionException if the file is not in the correct format.
*/
public Optional<ReadOnlyAddressBook> readAddressBook(String filePath) throws DataConversionException,
FileNotFoundException {
FileNotFoundException {
requireNonNull(filePath);

File addressBookFile = new File(filePath);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
import seedu.address.commons.exceptions.IllegalValueException;
import seedu.address.model.AddressBook;
import seedu.address.model.ReadOnlyAddressBook;
import seedu.address.model.appointment.exceptions.ConcurrentAppointmentException;
import seedu.address.model.appointment.exceptions.PastAppointmentException;

/**
* An Immutable AddressBook that is serializable to XML format
Expand Down Expand Up @@ -58,7 +60,8 @@ public XmlSerializableAddressBook(ReadOnlyAddressBook src) {
* @throws IllegalValueException if there were any data constraints violated or duplicates in the
* {@code XmlAdaptedPerson} or {@code XmlAdaptedTag}.
*/
public AddressBook toModelType() throws IllegalValueException {
public AddressBook toModelType() throws IllegalValueException,
ConcurrentAppointmentException, PastAppointmentException {
AddressBook addressBook = new AddressBook();
for (XmlAdaptedTag t : tags) {
addressBook.addTag(t.toModelType());
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/seedu/address/ui/CalendarWindow.java
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,8 @@ private void disableViews() {
calendarView.setShowSearchResultsTray(false);
calendarView.setShowPrintButton(false);
calendarView.setShowSourceTrayButton(false);
calendarView.setShowPageSwitcher(false);
calendarView.setShowToolBar(false);
calendarView.showDayPage();
calendarView.setShowSourceTray(false);
calendarView.setShowPageToolBarControls(false);
Expand Down
1 change: 1 addition & 0 deletions src/main/java/seedu/address/ui/CommandBox.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import seedu.address.logic.commands.exceptions.CommandException;
import seedu.address.logic.parser.exceptions.ParseException;


/**
* The UI component that is responsible for receiving user command inputs.
*/
Expand Down
Loading