-
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
Add Calendar Model #26
Add Calendar Model #26
Conversation
Created model for event for calendar
Add JavaDoc for Event class
Work in Progress
Added basic CML Calendar Included features: - Add event
Added JavaDocs to the following -AddEventCommandParser -AddressBookParser -CalendarParser -ComponentParser -Calendar -Event -EventDecsription -EventPeriod
Fixed Checkstyle and added more javadocs
Added necessary methods to fix JUnit test bugs
Codecov ReportAttention:
📢 Thoughts on this report? Let us know!. |
Added JUnit test for AddEventCommand
Included updated dependencies for AddEventCommand JUnit Testing
Fixed checkstyle for AddEventCommandTest
Fixed AddEventCommandTest checkstyle
Fixed AddEventCommandTest checkstyle
Added JUnit testing for: -parseEventDescription -parseEventPeriod
Fixed checkstyle erros for ParserUtilTest
Updated user guide for AddEvent command to reflect new syntax
Added JUnit testing for AddEventCommandParser
Fixed checkstyle for AddEventCommandParserTest
Fixed checkstyle for AddEventCommandParserTest
Added JUnit testing for Calendar class
Deleted CalendarParser and ApplicationParser Integerated all parsers into UniMateParser
Added more test cases for testing Calendar class
Fixed Checkstyle for more Calendar JUnit testing
Abstracted out: -Daily events into a single SingleDayEventList class -Collection of SingleDayEventList class into AllDaysEventListManager Additionally, changed underlying data structure storing events in Calendar class into a single AllDaysEventListManager
Fixed checkstyle for previous commit
Fixed even more checkstyle for previous commit
Fix logic error causing addEvent command to not work
Fixed JUnit testing for AddEventCommandParser
Fixed Checkstyle for AddEventCommandParserTest
Added 100% code coverage for EventPeriod class
Fixed Checkstyle for EventPeriodTest
Fixed more checktyle for EventPeriodTest
Fixed more checktyle for EventPeriodTest
Fixed even more checkstyle for EventPeriodTest
Add full code coverage for EventDescription class
Added JUnit testing for Event class
Fix JUnit testing for Event class
Added full code coverage for SingleDayEventList class
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.
Generally looks good aside from a few small formatting issues.
|
||
/** | ||
* Constructs a {@code LogicManager} with the given {@code Model} and {@code Storage}. | ||
*/ | ||
public LogicManager(Model model, Storage storage) { | ||
this.model = model; | ||
this.storage = storage; | ||
addressBookParser = new AddressBookParser(); | ||
this.uniMateParser = new UniMateParser(); |
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 keyword "this' can be removed.
|
||
public static final String MESSAGE_SUCCESS = "New event added: %1$s"; | ||
|
||
public static final String MESSAGE_EVENT_CONFLICT = "This event is conflicting with another event"; |
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.
Add a full-stop or ! after the sentence to keep it consistent with other messages.
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.
For AddCommand
given in AB3, theres no full-stop and ! after the sentence too
requireNonNull(description); | ||
String trimmedDescription = description.trim(); | ||
if (trimmedDescription.isEmpty()) { | ||
throw new ParseException(EventDescription.MESSAGE_CONSTRAINTS); |
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.
Consider putting this check into the EventDescription constructor instead as a validity check.
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.
Abstracted out the checking of whether the trimmedDescription
is a valid description by adding a static method in EventDescription
isValid(String)
to check.
Will still keep the check to be consistent with parseIndex
, parseName
, parsePhone
, parseAddress
and parseEmail
methods in the same ParserUtil.java
file
String trimmedStartDate = startDate.trim(); | ||
String trimmedEndDate = endDate.trim(); | ||
if (!EventPeriod.isValidPeriod(trimmedStartDate, trimmedEndDate)) { | ||
throw new ParseException(EventPeriod.MESSAGE_CONSTRAINTS); |
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.
Same as above. Consider putting this check into EventPeriod constructor instead.
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.
Will still keep the check to be consistent with parseIndex
, parseName
, parsePhone
, parseAddress
and parseEmail
methods in the same ParserUtil.java
file
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.
Since there is only 1 class that extends Component Parser it might be better to put the methods of this class into UniMateParser instead.
//=========== Calendar =================================================================================== | ||
@Override | ||
public boolean canAddEvent(Event event) { | ||
return this.calendar.canAddEvent(event); |
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.
Can remove "this" keyword here.
public void addEvent(Event event) { | ||
requireAllNonNull(event); | ||
|
||
this.calendar.addEvent(event); |
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.
Can remove "this" here as well.
* @param other The EventPeriod to compare with. | ||
* @return 1 if this EventPeriod is after the other, -1 if it's before, 0 if they are the same. | ||
*/ | ||
public int compareTo(EventPeriod other) { |
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.
Since there is a compareTo method, this class might want to implement Comparable
Resolved all comments except for: -ParserUtil lines 136-139 -ParserUtil lines 154-157
Let's migrate the docs site from Jekyll to MarkBind. Primary author: @tlylt in se-edu/addressbook-level3/pull/156 Further tweaks: @damithc in se-edu/addressbook-level3/pull/206
Added User Stories
Deleted johndoe.md and resolved merge conflicts with origin master
Resolved merge conflict
Fixed checkstyle
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.
LGTM
Added model for calendar, along with addEvent feature.
Storage feature for events not implemented yet.