From 6f5d3a489a7f0ecefa43db1d8f18e3f52b22b3d0 Mon Sep 17 00:00:00 2001 From: CYX22222003 Date: Thu, 7 Nov 2024 20:28:51 +0800 Subject: [PATCH] Remove traces of address book --- docs/UserGuide.md | 4 ++++ src/main/java/seedu/address/logic/Logic.java | 2 +- src/main/java/seedu/address/logic/commands/AddCommand.java | 6 +++--- .../java/seedu/address/logic/commands/ClearCommand.java | 2 +- .../java/seedu/address/logic/commands/DeleteCommand.java | 2 +- src/main/java/seedu/address/logic/commands/EditCommand.java | 4 ++-- src/main/java/seedu/address/logic/commands/ExitCommand.java | 2 +- src/main/java/seedu/address/logic/commands/ListCommand.java | 2 +- src/main/java/seedu/address/model/CampusConnect.java | 6 +++--- src/main/java/seedu/address/model/person/Email.java | 2 +- 10 files changed, 18 insertions(+), 14 deletions(-) diff --git a/docs/UserGuide.md b/docs/UserGuide.md index 478dce8dfd9..6651e6ace98 100644 --- a/docs/UserGuide.md +++ b/docs/UserGuide.md @@ -118,6 +118,8 @@ Format: `add n/NAME p/PHONE_NUMBER e/EMAIL [t/TAG]…​` * The phone number must follow the Singaporean convention: have 8 digits, start with 6, 8, or 9, and consist only of numbers. +* Do not add duplicate contacts to the list. +* Two contacts are considered duplicates if they share the same name, email, or phone number. Examples: * `add n/John Doe p/98765432 e/johnd@example.com` @@ -141,6 +143,8 @@ Format: `edit INDEX [n/NAME] [p/PHONE] [e/EMAIL] [t/TAG]…​` * When editing tags, the existing tags of the person will be removed, i.e. adding of tags is not cumulative. * You can remove all the person’s tags by typing `t/` without specifying any tags after it. +* Do not add duplicate contacts to the list. + Two contacts are considered duplicates if they share the same name, email, or phone number. Examples: * `edit 1 p/91234567 e/johndoe@example.com` Edits the phone number and email address of the 1st person to be `91234567` and `johndoe@example.com` respectively. diff --git a/src/main/java/seedu/address/logic/Logic.java b/src/main/java/seedu/address/logic/Logic.java index a72bdbe7aa2..60e9a496398 100644 --- a/src/main/java/seedu/address/logic/Logic.java +++ b/src/main/java/seedu/address/logic/Logic.java @@ -38,7 +38,7 @@ public interface Logic { ObservableList getListOfCurrentTags(); /** - * Returns the user prefs' address book file path. + * Returns the user prefs' campus connect file path. */ Path getCampusConnectFilePath(); diff --git a/src/main/java/seedu/address/logic/commands/AddCommand.java b/src/main/java/seedu/address/logic/commands/AddCommand.java index ebd99168c3c..6bd99269fb6 100644 --- a/src/main/java/seedu/address/logic/commands/AddCommand.java +++ b/src/main/java/seedu/address/logic/commands/AddCommand.java @@ -13,13 +13,13 @@ import seedu.address.model.person.Person; /** - * Adds a person to the address book. + * Adds a person to the campus connect. */ public class AddCommand extends Command { public static final String COMMAND_WORD = "add"; - public static final String MESSAGE_USAGE = COMMAND_WORD + ": Adds a person to the address book. " + public static final String MESSAGE_USAGE = COMMAND_WORD + ": Adds a person to the campus connect. " + "Parameters: " + PREFIX_NAME + "NAME " + PREFIX_PHONE + "PHONE " @@ -33,7 +33,7 @@ public class AddCommand extends Command { + PREFIX_TAG + "owesMoney"; public static final String MESSAGE_SUCCESS = "New person added: %1$s"; - public static final String MESSAGE_DUPLICATE_PERSON = "This person already exists in the address book"; + public static final String MESSAGE_DUPLICATE_PERSON = "This person already exists in the campus connect"; private final Person toAdd; diff --git a/src/main/java/seedu/address/logic/commands/ClearCommand.java b/src/main/java/seedu/address/logic/commands/ClearCommand.java index 28d36295a1b..62bb47378be 100644 --- a/src/main/java/seedu/address/logic/commands/ClearCommand.java +++ b/src/main/java/seedu/address/logic/commands/ClearCommand.java @@ -6,7 +6,7 @@ import seedu.address.model.Model; /** - * Clears the address book. + * Clears the campus connect. */ public class ClearCommand extends Command { diff --git a/src/main/java/seedu/address/logic/commands/DeleteCommand.java b/src/main/java/seedu/address/logic/commands/DeleteCommand.java index 239b914a021..2ab7bf76f14 100644 --- a/src/main/java/seedu/address/logic/commands/DeleteCommand.java +++ b/src/main/java/seedu/address/logic/commands/DeleteCommand.java @@ -12,7 +12,7 @@ import seedu.address.model.person.Person; /** - * Deletes a person identified using it's displayed index from the address book. + * Deletes a person identified using it's displayed index from the campus connect. */ public class DeleteCommand extends Command { diff --git a/src/main/java/seedu/address/logic/commands/EditCommand.java b/src/main/java/seedu/address/logic/commands/EditCommand.java index b1cfd9841cc..f600716c731 100644 --- a/src/main/java/seedu/address/logic/commands/EditCommand.java +++ b/src/main/java/seedu/address/logic/commands/EditCommand.java @@ -27,7 +27,7 @@ import seedu.address.model.tag.Tag; /** - * Edits the details of an existing person in the address book. + * Edits the details of an existing person in the campus connect. */ public class EditCommand extends Command { @@ -47,7 +47,7 @@ public class EditCommand extends Command { public static final String MESSAGE_EDIT_PERSON_SUCCESS = "Edited Person: %1$s"; public static final String MESSAGE_NOT_EDITED = "At least one field to edit must be provided."; - public static final String MESSAGE_DUPLICATE_PERSON = "This person already exists in the address book."; + public static final String MESSAGE_DUPLICATE_PERSON = "This person already exists in the campus connect."; private final Index index; private final EditPersonDescriptor editPersonDescriptor; diff --git a/src/main/java/seedu/address/logic/commands/ExitCommand.java b/src/main/java/seedu/address/logic/commands/ExitCommand.java index 3dd85a8ba90..40b065cd9ac 100644 --- a/src/main/java/seedu/address/logic/commands/ExitCommand.java +++ b/src/main/java/seedu/address/logic/commands/ExitCommand.java @@ -9,7 +9,7 @@ public class ExitCommand extends Command { public static final String COMMAND_WORD = "exit"; - public static final String MESSAGE_EXIT_ACKNOWLEDGEMENT = "Exiting Address Book as requested ..."; + public static final String MESSAGE_EXIT_ACKNOWLEDGEMENT = "Exiting Campus Connect as requested ..."; @Override public CommandResult execute(Model model) { diff --git a/src/main/java/seedu/address/logic/commands/ListCommand.java b/src/main/java/seedu/address/logic/commands/ListCommand.java index 84be6ad2596..2467b9e58c4 100644 --- a/src/main/java/seedu/address/logic/commands/ListCommand.java +++ b/src/main/java/seedu/address/logic/commands/ListCommand.java @@ -6,7 +6,7 @@ import seedu.address.model.Model; /** - * Lists all persons in the address book to the user. + * Lists all persons in the campus connect to the user. */ public class ListCommand extends Command { diff --git a/src/main/java/seedu/address/model/CampusConnect.java b/src/main/java/seedu/address/model/CampusConnect.java index 1281e705421..332f9d1410e 100644 --- a/src/main/java/seedu/address/model/CampusConnect.java +++ b/src/main/java/seedu/address/model/CampusConnect.java @@ -125,8 +125,8 @@ public void addPerson(Person p, int ind) { /** * Replaces the given person {@code target} in the list with {@code editedPerson}. - * {@code target} must exist in the address book. - * The person identity of {@code editedPerson} must not be the same as another existing person in the address book. + * {@code target} must exist in the campus connect. + * The person identity of {@code editedPerson} must not be the same as another existing person in the campus connect. */ public void setPerson(Person target, Person editedPerson) { requireNonNull(editedPerson); @@ -136,7 +136,7 @@ public void setPerson(Person target, Person editedPerson) { /** * Removes {@code key} from this {@code CampusConnect}. - * {@code key} must exist in the address book. + * {@code key} must exist in the campus connect. */ public void removePerson(Person key) { persons.remove(key); diff --git a/src/main/java/seedu/address/model/person/Email.java b/src/main/java/seedu/address/model/person/Email.java index c62e512bc29..a64ec7b1b58 100644 --- a/src/main/java/seedu/address/model/person/Email.java +++ b/src/main/java/seedu/address/model/person/Email.java @@ -4,7 +4,7 @@ import static seedu.address.commons.util.AppUtil.checkArgument; /** - * Represents a Person's email in the address book. + * Represents a Person's email in the CampusConnect. * Guarantees: immutable; is valid as declared in {@link #isValidEmail(String)} */ public class Email {