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

Update code to use Availability attribute #80

Merged

Conversation

tsulim
Copy link
Collaborator

@tsulim tsulim commented Mar 15, 2024

Closes #5, closes #66

  • Add Availability data field to Person model
  • Update commands (e.g., add and edit) to use Availability
  • Add sample Availability data to SampleDataUtil
  • Update tests to cover Availability
  • Update test data with sample Availability data
  • Update ui to display Availability in the application

tsulim added 30 commits March 15, 2024 03:10
@tsulim tsulim added type.Task Something that needs to be done, but not a story, bug, or an epic. priority.High Must do labels Mar 15, 2024
@tsulim tsulim added this to the v1.2 milestone Mar 15, 2024
@tsulim tsulim self-assigned this Mar 15, 2024
Copy link

codecov bot commented Mar 15, 2024

Codecov Report

Attention: Patch coverage is 88.28829% with 13 lines in your changes are missing coverage. Please review.

Project coverage is 79.01%. Comparing base (b9fd49f) to head (6e71003).
Report is 79 commits behind head on master.

Files Patch % Lines
...n/java/staffconnect/model/util/SampleDataUtil.java 30.00% 7 Missing ⚠️
src/main/java/staffconnect/ui/PersonCard.java 0.00% 3 Missing ⚠️
.../java/staffconnect/logic/commands/EditCommand.java 95.00% 0 Missing and 1 partial ⚠️
...a/staffconnect/logic/parser/EditCommandParser.java 92.30% 0 Missing and 1 partial ⚠️
...rc/main/java/staffconnect/model/person/Person.java 92.30% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master      #80      +/-   ##
============================================
+ Coverage     78.33%   79.01%   +0.68%     
- Complexity      529      548      +19     
============================================
  Files            86       87       +1     
  Lines          1620     1687      +67     
  Branches        159      169      +10     
============================================
+ Hits           1269     1333      +64     
- Misses          320      321       +1     
- Partials         31       33       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Comment on lines +54 to +55
Set<Availability> availabilityList =
ParserUtil.parseAvailabilities(argMultimap.getAllValues(PREFIX_AVAILABILITY));
Copy link

@Pluiexo Pluiexo Mar 15, 2024

Choose a reason for hiding this comment

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

Current default behaviour if the the user types nothing for availability, the availability is listed as none of the days, rather than any or all of the days

Copy link
Collaborator

@whitesnowx whitesnowx Mar 16, 2024

Choose a reason for hiding this comment

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

I think that behaviour is intuitive imo, as opposed to the alternative be that availability be defaulted to all the days

Possible future implementation idea: user can type a/ALL and system parses it as the 7 days

Copy link

@Pluiexo Pluiexo left a comment

Choose a reason for hiding this comment

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

LGTM! Though not to sure if our original intended intention is to have availability be (None of the days) empty if the user types nothing. Others may chip in on what they think

Copy link
Collaborator

@iynixil iynixil left a comment

Choose a reason for hiding this comment

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

looks good!

@iynixil iynixil merged commit 394712f into AY2324S2-CS2103-F08-3:master Mar 16, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority.High Must do type.Task Something that needs to be done, but not a story, bug, or an epic.
Projects
None yet
4 participants