Skip to content

Commit

Permalink
Merge branch 'AY2425S1-CS2103T-T15-3:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
kyouscrap authored Nov 7, 2024
2 parents 5fd0521 + 4c99b11 commit 3672284
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 97 deletions.
56 changes: 0 additions & 56 deletions src/main/java/seedu/address/logic/commands/EditCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -115,13 +115,6 @@ private static Person createEditedPerson(Person personToEdit, EditPersonDescript
Medication updatedMedication = editPersonDescriptor.getMedication().orElse(personToEdit.getMedication());
Notes updatedNotes = personToEdit.getNotes();
Appointment updatedAppointment = personToEdit.getAppointment();
/*
Phone updatedPhone = editPersonDescriptor.getPhone().orElse(personToEdit.getPhone());
Email updatedEmail = editPersonDescriptor.getEmail().orElse(personToEdit.getEmail());
Address updatedAddress = editPersonDescriptor.getAddress().orElse(personToEdit.getAddress());
Set<Tag> updatedTags = editPersonDescriptor.getTags().orElse(personToEdit.getTags());
*/

return new Person(updatedName, updatedId, updatedWard, updatedDiagnosis, updatedMedication,
updatedNotes, updatedAppointment);
Expand Down Expand Up @@ -163,11 +156,6 @@ public static class EditPersonDescriptor {
private Diagnosis diagnosis;
private Medication medication;

/*
private Set<Tag> tags;
*/

public EditPersonDescriptor() {}

/**
Expand All @@ -180,10 +168,6 @@ public EditPersonDescriptor(EditPersonDescriptor toCopy) {
setWard(toCopy.ward);
setDiagnosis(toCopy.diagnosis);
setMedication(toCopy.medication);
/*
setTags(toCopy.tags);
*/
}

/**
Expand Down Expand Up @@ -233,32 +217,6 @@ public Optional<Medication> getMedication() {
return Optional.ofNullable(medication);
}

/*
/**
* Sets {@code tags} to this object's {@code tags}.
* A defensive copy of {@code tags} is used internally.
*/
/*
public void setTags(Set<Tag> tags) {
this.tags = (tags != null) ? new HashSet<>(tags) : null;
}
*/

/*
/**
* Returns an unmodifiable tag set, which throws {@code UnsupportedOperationException}
* if modification is attempted.
* Returns {@code Optional#empty()} if {@code tags} is null.
*/
/*
public Optional<Set<Tag>> getTags() {
return (tags != null) ? Optional.of(Collections.unmodifiableSet(tags)) : Optional.empty();
}
*/


@Override
public boolean equals(Object other) {
if (other == this) {
Expand All @@ -276,13 +234,6 @@ public boolean equals(Object other) {
&& Objects.equals(ward, otherEditPersonDescriptor.ward)
&& Objects.equals(diagnosis, otherEditPersonDescriptor.diagnosis)
&& Objects.equals(medication, otherEditPersonDescriptor.medication);
/*
&& Objects.equals(phone, otherEditPersonDescriptor.phone)
&& Objects.equals(email, otherEditPersonDescriptor.email)
&& Objects.equals(address, otherEditPersonDescriptor.address)
&& Objects.equals(tags, otherEditPersonDescriptor.tags);
*/
}

@Override
Expand All @@ -293,13 +244,6 @@ public String toString() {
.add("ward", ward)
.add("diagnosis", diagnosis)
.add("medication", medication)
/*
.add("phone", phone)
.add("email", email)
.add("address", address)
.add("tags", tags)
*/
.toString();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ public class ListCommand extends Command {

public static final String MESSAGE_SUCCESS = "Listed all persons";


@Override
public CommandResult execute(Model model) {
requireNonNull(model);
Expand Down
21 changes: 0 additions & 21 deletions src/test/java/seedu/address/logic/commands/CommandTestUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,9 @@ public class CommandTestUtil {
public static final String VALID_NAME_AMY = "Amy Bee";
public static final String VALID_NAME_BOB = "Bob Choo";
public static final String VALID_ID_AMY = "P12345";
public static final String VALID_ID_WITH_SPECIAL_CHAR_AMY = "P12345/";
public static final String VALID_ID_BOB = "P54321";
public static final String VALID_ID_WITH_SPECIAL_CHAR_BOB = "P54321/";
public static final String VALID_WARD_AMY = "A1";
public static final String VALID_WARD_WITH_SPECIAL_CHAR_AMY = "A1!";
public static final String VALID_WARD_BOB = "B3";
public static final String VALID_WARD_WITH_SPECIAL_CHAR_BOB = "B3!";
public static final String VALID_DIAGNOSIS_AMY = "Celiac Disease";
Expand All @@ -62,20 +60,6 @@ public class CommandTestUtil {

public static final String APPOINTMENT_DESC_AMY = " " + PREFIX_APPOINTMENT + VALID_APPOINTMENT_AMY;
public static final String APPOINTMENT_DESC_BOB = " " + PREFIX_APPOINTMENT + VALID_APPOINTMENT_BOB;


/*
public static final String VALID_PHONE_AMY = "11111111";
public static final String VALID_PHONE_BOB = "22222222";
public static final String VALID_EMAIL_AMY = "[email protected]";
public static final String VALID_EMAIL_BOB = "[email protected]";
public static final String VALID_ADDRESS_AMY = "Block 312, Amy Street 1";
public static final String VALID_ADDRESS_BOB = "Block 123, Bobby Street 3";
public static final String VALID_TAG_HUSBAND = "husband";
public static final String VALID_TAG_FRIEND = "friend";
*/

public static final String NAME_DESC_AMY = " " + PREFIX_NAME + VALID_NAME_AMY;
public static final String NAME_DESC_BOB = " " + PREFIX_NAME + VALID_NAME_BOB;
public static final String ID_DESC_AMY = " " + PREFIX_ID + VALID_ID_AMY;
Expand All @@ -86,22 +70,17 @@ public class CommandTestUtil {
public static final String DIAGNOSIS_DESC_BOB = " " + PREFIX_DIAGNOSIS + VALID_DIAGNOSIS_BOB;
public static final String MEDICATION_DESC_AMY = " " + PREFIX_MEDICATION + VALID_MEDICATION_AMY;
public static final String MEDICATION_DESC_BOB = " " + PREFIX_MEDICATION + VALID_MEDICATION_BOB;

public static final String INVALID_NAME_DESC = " " + PREFIX_NAME + "James&"; // '&' not allowed in names
public static final String INVALID_ID_DESC = " " + PREFIX_ID + "P12D^5"; // '^' not allowed in id
public static final String INVALID_WARD_DESC = " " + PREFIX_WARD + ""; // No empty string allowed
public static final String INVALID_DIAGNOSIS_DESC = " " + PREFIX_DIAGNOSIS + "$<>"; // Only a-z and .()/- allowed
public static final String INVALID_MEDICATION_DESC = " " + PREFIX_MEDICATION + "$<>"; // Only a-z and .()/- allowed

// Only a-z and .()/- allowed
public static final String INVALID_APPOINTMENT_DESC = " " + PREFIX_APPOINTMENT + "\t";
public static final String INVALID_START_DATETIME = "10/11/2024"; // Only 0-9 and - allowed
public static final String INVALID_END_DATETIME = "10-11-202?"; // Only 0-9 and - allowed
public static final String INVALID_START_DATETIME_DESC = " " + PREFIX_START + INVALID_START_DATETIME;
public static final String INVALID_END_DATETIME_DESC = " " + PREFIX_END + INVALID_END_DATETIME;



public static final String PREAMBLE_WHITESPACE = "\t \r \n";
public static final String PREAMBLE_NON_EMPTY = "NonEmptyPreamble";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,25 +55,6 @@ public void equals() {
// different medication -> returns false
editedAmy = new EditPersonDescriptorBuilder(DESC_AMY).withMedication(VALID_MEDICATION_BOB).build();
assertFalse(DESC_AMY.equals(editedAmy));

/*
// different phone -> returns false
editedAmy = new EditPersonDescriptorBuilder(DESC_AMY).withPhone(VALID_PHONE_BOB).build();
assertFalse(DESC_AMY.equals(editedAmy));
// different email -> returns false
editedAmy = new EditPersonDescriptorBuilder(DESC_AMY).withEmail(VALID_EMAIL_BOB).build();
assertFalse(DESC_AMY.equals(editedAmy));
// different address -> returns false
editedAmy = new EditPersonDescriptorBuilder(DESC_AMY).withAddress(VALID_ADDRESS_BOB).build();
assertFalse(DESC_AMY.equals(editedAmy));
// different tags -> returns false
editedAmy = new EditPersonDescriptorBuilder(DESC_AMY).withTags(VALID_TAG_HUSBAND).build();
assertFalse(DESC_AMY.equals(editedAmy));
*/
}

@Test
Expand Down

0 comments on commit 3672284

Please sign in to comment.