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 add command to MVP specifications #73

Merged
merged 19 commits into from
Oct 17, 2024

Conversation

Andrew22Teoh
Copy link
Collaborator

@Andrew22Teoh Andrew22Teoh commented Oct 10, 2024

This PR changes the parameters address and email to be optional. That requires changing to many different classes and their interactions.

The outcome of this is that you can now create contacts with the most barebones information: name, phone number, and date of last visit. Email and address can still be supplied, but attempts to use the prefixes without supplying actual arguments results in error messages.

Closes #50
Closes #74

Unverified

This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
Update multiple classes to ensure cohesion with Optional<Email>
and Optional<Address>.

Edit print statements so success output looks correct.
Parameters not supplied will not be printed as output.
@Andrew22Teoh Andrew22Teoh modified the milestones: v1.2, v1.3 Oct 10, 2024
Deconflict merge issues by integrating optional email and
address fields with new DateOfLastVisit field.

Update SampleDataUtil and PersonUtil for sample people
to have both optional emails and addresses, as well as
DateOfLastVisit
@Andrew22Teoh Andrew22Teoh marked this pull request as ready for review October 16, 2024 16:19
Copy link

codecov bot commented Oct 16, 2024

Codecov Report

Attention: Patch coverage is 94.28571% with 4 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
.../java/seedu/address/storage/JsonAdaptedPerson.java 80.00% 0 Missing and 2 partials ⚠️
src/main/java/seedu/address/ui/PersonCard.java 0.00% 2 Missing ⚠️
Files with missing lines Coverage Δ Complexity Δ
src/main/java/seedu/address/logic/Messages.java 93.33% <100.00%> (+4.44%) 11.00 <8.00> (+8.00)
.../java/seedu/address/logic/commands/AddCommand.java 100.00% <ø> (ø) 8.00 <0.00> (ø)
...java/seedu/address/logic/commands/EditCommand.java 97.67% <100.00%> (ø) 13.00 <0.00> (ø)
...a/seedu/address/logic/parser/AddCommandParser.java 100.00% <100.00%> (ø) 5.00 <0.00> (ø)
.../seedu/address/logic/parser/EditCommandParser.java 93.33% <100.00%> (ø) 12.00 <0.00> (ø)
...in/java/seedu/address/logic/parser/ParserUtil.java 97.77% <100.00%> (+0.21%) 18.00 <0.00> (+2.00)
...model/person/AddressContainsKeywordsPredicate.java 100.00% <100.00%> (ø) 10.00 <3.00> (+1.00)
...c/main/java/seedu/address/model/person/Person.java 97.67% <100.00%> (+0.11%) 24.00 <2.00> (+2.00)
.../java/seedu/address/model/util/SampleDataUtil.java 96.15% <100.00%> (+2.82%) 4.00 <0.00> (ø)
.../java/seedu/address/storage/JsonAdaptedPerson.java 96.42% <80.00%> (-3.58%) 15.00 <0.00> (+2.00) ⬇️
... and 1 more

@Andrew22Teoh Andrew22Teoh requested a review from rayray39 October 16, 2024 17:13
Copy link

@rayray39 rayray39 left a comment

Choose a reason for hiding this comment

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

Overall really good job on the use of optionals for email and address. No major issues from what I can see, just some minor change(s) to be made. Good job!

@@ -41,16 +41,37 @@ public static String format(Person person) {
final StringBuilder builder = new StringBuilder();
builder.append(person.getName())

Choose a reason for hiding this comment

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

I like that you have abstracted out the builder.append(person) and builder.append('some text') for email, address, tags and date of last visit into a single method respectively. Perhaps you might want to do the same for name and phone too, just to make it consistent.

@Andrew22Teoh Andrew22Teoh requested a review from rayray39 October 17, 2024 10:25
Copy link

@rayray39 rayray39 left a comment

Choose a reason for hiding this comment

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

LGTM

@rayray39 rayray39 merged commit 7a8b1a8 into AY2425S1-CS2103-F10-2:master Oct 17, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants