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

Chronological Ordering of appointments #161

Merged

Conversation

khoongwk
Copy link

Implementation details: When appointments are added or edited, the add method or setItem method in UniqueList is called. I extended UniqueList to override these methods such that they are sorted by the comparator every time a change is made. This is a workaround as there is no convenient PriorityQueue available from FXCollections.

Also, I changed getAppointmentList() in AppointmentManager.java such that the internalList is returned rather than the internalUnmodifiableList. This is inevitable as we cannot sort unmodifiable lists. Not sure what are the implications of this, seems fine at the moment (maybe can ask Jeffry).

@khoongwk khoongwk added type.Story A user story priority.High Must do labels Oct 17, 2020
@khoongwk khoongwk added this to the v1.3 milestone Oct 17, 2020
@khoongwk khoongwk self-assigned this Oct 17, 2020
@khoongwk
Copy link
Author

@yanlynnnnn @galvinleow Can refer to my implementation so that yall can apply to revenue and expenses too.

@khoongwk khoongwk changed the title Sorting of appointments by date and time Chronological Ordering of appointments Oct 17, 2020
Copy link

@RuiFengg RuiFengg left a comment

Choose a reason for hiding this comment

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

LGTM

@RuiFengg RuiFengg merged commit 693e390 into AY2021S1-CS2103T-W13-3:master Oct 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority.High Must do type.Story A user story
Projects
None yet
Development

Successfully merging this pull request may close these issues.

As a home-based beauty salon owner, I want my appointment ordered by date
2 participants