diff --git a/docs/UserGuide.md b/docs/UserGuide.md
index 2dd47c680c5..59abada8afb 100644
--- a/docs/UserGuide.md
+++ b/docs/UserGuide.md
@@ -27,7 +27,7 @@ StaffConnect (SC) is a **desktop app for managing contacts of Professors and Tut
* `list` : Lists all contacts.
- * `add n/John Doe p/98765432 e/johnd@example.com a/John street, block 123, #01-01` : Adds a contact named `John Doe` to the contacts list.
+ * `add n/John Doe p/98765432 e/johnd@example.com v/John street, block 123, #01-01` : Adds a contact named `John Doe` to the contacts list.
* `delete 3` : Deletes the 3rd contact shown in the current list.
@@ -76,15 +76,15 @@ Format: `help`
Adds a person to the contacts.
-Format: `add n/NAME p/PHONE_NUMBER e/EMAIL a/ADDRESS [t/TAG]…`
+Format: `add n/NAME p/PHONE_NUMBER e/EMAIL v/VENUE [t/TAG]…`
:bulb: **Tip:**
A person can have any number of tags (including 0)
Examples:
-* `add n/John Doe p/98765432 e/johnd@example.com a/John street, block 123, #01-01`
-* `add n/Betsy Crowe t/friend e/betsycrowe@example.com a/Newgate Prison p/1234567 t/criminal`
+* `add n/John Doe p/98765432 e/johnd@example.com v/John street, block 123, #01-01`
+* `add n/Betsy Crowe t/friend e/betsycrowe@example.com v/Newgate Prison p/1234567 t/criminal`
### Listing all persons : `list`
@@ -96,7 +96,7 @@ Format: `list`
Edits an existing person in the contacts.
-Format: `edit INDEX [n/NAME] [p/PHONE] [e/EMAIL] [a/ADDRESS] [t/TAG]…`
+Format: `edit INDEX [n/NAME] [p/PHONE] [e/EMAIL] [v/VENUE] [t/TAG]…`
* Edits the person at the specified `INDEX`. The index refers to the index number shown in the displayed person list. The index **must be a positive integer** 1, 2, 3, …
* At least one of the optional fields must be provided.
@@ -189,10 +189,10 @@ _Details coming soon ..._
Action | Format, Examples
--------|------------------
-**Add** | `add n/NAME p/PHONE_NUMBER e/EMAIL a/ADDRESS [t/TAG]…` e.g., `add n/James Ho p/22224444 e/jamesho@example.com a/123, Clementi Rd, 1234665 t/friend t/colleague`
+**Add** | `add n/NAME p/PHONE_NUMBER e/EMAIL v/VENUE [t/TAG]…` e.g., `add n/James Ho p/22224444 e/jamesho@example.com v/123, Clementi Rd, 1234665 t/friend t/colleague`
**Clear** | `clear`
**Delete** | `delete INDEX` e.g., `delete 3`
-**Edit** | `edit INDEX [n/NAME] [p/PHONE_NUMBER] [e/EMAIL] [a/ADDRESS] [t/TAG]…` e.g.,`edit 2 n/James Lee e/jameslee@example.com`
+**Edit** | `edit INDEX [n/NAME] [p/PHONE_NUMBER] [e/EMAIL] [v/VENUE] [t/TAG]…` e.g.,`edit 2 n/James Lee e/jameslee@example.com`
**Find** | `find KEYWORD [MORE_KEYWORDS]` e.g., `find James Jake`
**List** | `list`
**Help** | `help`
diff --git a/src/main/java/staffconnect/logic/Messages.java b/src/main/java/staffconnect/logic/Messages.java
index 07598d04d10..210b43d43e8 100644
--- a/src/main/java/staffconnect/logic/Messages.java
+++ b/src/main/java/staffconnect/logic/Messages.java
@@ -41,8 +41,8 @@ public static String format(Person person) {
.append(person.getPhone())
.append("; Email: ")
.append(person.getEmail())
- .append("; Address: ")
- .append(person.getAddress())
+ .append("; Venue: ")
+ .append(person.getVenue())
.append("; Tags: ");
person.getTags().forEach(builder::append);
return builder.toString();
diff --git a/src/main/java/staffconnect/logic/commands/AddCommand.java b/src/main/java/staffconnect/logic/commands/AddCommand.java
index 173b83d6d7d..577b0f67521 100644
--- a/src/main/java/staffconnect/logic/commands/AddCommand.java
+++ b/src/main/java/staffconnect/logic/commands/AddCommand.java
@@ -1,11 +1,11 @@
package staffconnect.logic.commands;
import static java.util.Objects.requireNonNull;
-import static staffconnect.logic.parser.CliSyntax.PREFIX_ADDRESS;
import static staffconnect.logic.parser.CliSyntax.PREFIX_EMAIL;
import static staffconnect.logic.parser.CliSyntax.PREFIX_NAME;
import static staffconnect.logic.parser.CliSyntax.PREFIX_PHONE;
import static staffconnect.logic.parser.CliSyntax.PREFIX_TAG;
+import static staffconnect.logic.parser.CliSyntax.PREFIX_VENUE;
import staffconnect.commons.util.ToStringBuilder;
import staffconnect.logic.Messages;
@@ -25,13 +25,13 @@ public class AddCommand extends Command {
+ PREFIX_NAME + "NAME "
+ PREFIX_PHONE + "PHONE "
+ PREFIX_EMAIL + "EMAIL "
- + PREFIX_ADDRESS + "ADDRESS "
+ + PREFIX_VENUE + "VENUE "
+ "[" + PREFIX_TAG + "TAG]...\n"
+ "Example: " + COMMAND_WORD + " "
+ PREFIX_NAME + "John Doe "
+ PREFIX_PHONE + "98765432 "
+ PREFIX_EMAIL + "johnd@example.com "
- + PREFIX_ADDRESS + "311, Clementi Ave 2, #02-25 "
+ + PREFIX_VENUE + "311, Clementi Ave 2, #02-25 "
+ PREFIX_TAG + "friends "
+ PREFIX_TAG + "owesMoney";
diff --git a/src/main/java/staffconnect/logic/commands/EditCommand.java b/src/main/java/staffconnect/logic/commands/EditCommand.java
index de8ece3efda..0b51e4aa99c 100644
--- a/src/main/java/staffconnect/logic/commands/EditCommand.java
+++ b/src/main/java/staffconnect/logic/commands/EditCommand.java
@@ -1,11 +1,11 @@
package staffconnect.logic.commands;
import static java.util.Objects.requireNonNull;
-import static staffconnect.logic.parser.CliSyntax.PREFIX_ADDRESS;
import static staffconnect.logic.parser.CliSyntax.PREFIX_EMAIL;
import static staffconnect.logic.parser.CliSyntax.PREFIX_NAME;
import static staffconnect.logic.parser.CliSyntax.PREFIX_PHONE;
import static staffconnect.logic.parser.CliSyntax.PREFIX_TAG;
+import static staffconnect.logic.parser.CliSyntax.PREFIX_VENUE;
import static staffconnect.model.Model.PREDICATE_SHOW_ALL_PERSONS;
import java.util.Collections;
@@ -21,11 +21,11 @@
import staffconnect.logic.Messages;
import staffconnect.logic.commands.exceptions.CommandException;
import staffconnect.model.Model;
-import staffconnect.model.person.Address;
import staffconnect.model.person.Email;
import staffconnect.model.person.Name;
import staffconnect.model.person.Person;
import staffconnect.model.person.Phone;
+import staffconnect.model.person.Venue;
import staffconnect.model.tag.Tag;
/**
@@ -42,7 +42,7 @@ public class EditCommand extends Command {
+ "[" + PREFIX_NAME + "NAME] "
+ "[" + PREFIX_PHONE + "PHONE] "
+ "[" + PREFIX_EMAIL + "EMAIL] "
- + "[" + PREFIX_ADDRESS + "ADDRESS] "
+ + "[" + PREFIX_VENUE + "VENUE] "
+ "[" + PREFIX_TAG + "TAG]...\n"
+ "Example: " + COMMAND_WORD + " 1 "
+ PREFIX_PHONE + "91234567 "
@@ -98,10 +98,10 @@ private static Person createEditedPerson(Person personToEdit, EditPersonDescript
Name updatedName = editPersonDescriptor.getName().orElse(personToEdit.getName());
Phone updatedPhone = editPersonDescriptor.getPhone().orElse(personToEdit.getPhone());
Email updatedEmail = editPersonDescriptor.getEmail().orElse(personToEdit.getEmail());
- Address updatedAddress = editPersonDescriptor.getAddress().orElse(personToEdit.getAddress());
+ Venue updatedVenue = editPersonDescriptor.getVenue().orElse(personToEdit.getVenue());
Set updatedTags = editPersonDescriptor.getTags().orElse(personToEdit.getTags());
- return new Person(updatedName, updatedPhone, updatedEmail, updatedAddress, updatedTags);
+ return new Person(updatedName, updatedPhone, updatedEmail, updatedVenue, updatedTags);
}
@Override
@@ -136,7 +136,7 @@ public static class EditPersonDescriptor {
private Name name;
private Phone phone;
private Email email;
- private Address address;
+ private Venue venue;
private Set tags;
public EditPersonDescriptor() {}
@@ -149,7 +149,7 @@ public EditPersonDescriptor(EditPersonDescriptor toCopy) {
setName(toCopy.name);
setPhone(toCopy.phone);
setEmail(toCopy.email);
- setAddress(toCopy.address);
+ setVenue(toCopy.venue);
setTags(toCopy.tags);
}
@@ -157,7 +157,7 @@ public EditPersonDescriptor(EditPersonDescriptor toCopy) {
* Returns true if at least one field is edited.
*/
public boolean isAnyFieldEdited() {
- return CollectionUtil.isAnyNonNull(name, phone, email, address, tags);
+ return CollectionUtil.isAnyNonNull(name, phone, email, venue, tags);
}
public void setName(Name name) {
@@ -184,12 +184,12 @@ public Optional getEmail() {
return Optional.ofNullable(email);
}
- public void setAddress(Address address) {
- this.address = address;
+ public void setVenue(Venue venue) {
+ this.venue = venue;
}
- public Optional getAddress() {
- return Optional.ofNullable(address);
+ public Optional getVenue() {
+ return Optional.ofNullable(venue);
}
/**
@@ -224,7 +224,7 @@ public boolean equals(Object other) {
return Objects.equals(name, otherEditPersonDescriptor.name)
&& Objects.equals(phone, otherEditPersonDescriptor.phone)
&& Objects.equals(email, otherEditPersonDescriptor.email)
- && Objects.equals(address, otherEditPersonDescriptor.address)
+ && Objects.equals(venue, otherEditPersonDescriptor.venue)
&& Objects.equals(tags, otherEditPersonDescriptor.tags);
}
@@ -234,7 +234,7 @@ public String toString() {
.add("name", name)
.add("phone", phone)
.add("email", email)
- .add("address", address)
+ .add("venue", venue)
.add("tags", tags)
.toString();
}
diff --git a/src/main/java/staffconnect/logic/parser/AddCommandParser.java b/src/main/java/staffconnect/logic/parser/AddCommandParser.java
index 4464682764b..19f8d8e203e 100644
--- a/src/main/java/staffconnect/logic/parser/AddCommandParser.java
+++ b/src/main/java/staffconnect/logic/parser/AddCommandParser.java
@@ -1,22 +1,22 @@
package staffconnect.logic.parser;
import static staffconnect.logic.Messages.MESSAGE_INVALID_COMMAND_FORMAT;
-import static staffconnect.logic.parser.CliSyntax.PREFIX_ADDRESS;
import static staffconnect.logic.parser.CliSyntax.PREFIX_EMAIL;
import static staffconnect.logic.parser.CliSyntax.PREFIX_NAME;
import static staffconnect.logic.parser.CliSyntax.PREFIX_PHONE;
import static staffconnect.logic.parser.CliSyntax.PREFIX_TAG;
+import static staffconnect.logic.parser.CliSyntax.PREFIX_VENUE;
import java.util.Set;
import java.util.stream.Stream;
import staffconnect.logic.commands.AddCommand;
import staffconnect.logic.parser.exceptions.ParseException;
-import staffconnect.model.person.Address;
import staffconnect.model.person.Email;
import staffconnect.model.person.Name;
import staffconnect.model.person.Person;
import staffconnect.model.person.Phone;
+import staffconnect.model.person.Venue;
import staffconnect.model.tag.Tag;
/**
@@ -31,21 +31,21 @@ public class AddCommandParser implements Parser {
*/
public AddCommand parse(String args) throws ParseException {
ArgumentMultimap argMultimap =
- ArgumentTokenizer.tokenize(args, PREFIX_NAME, PREFIX_PHONE, PREFIX_EMAIL, PREFIX_ADDRESS, PREFIX_TAG);
+ ArgumentTokenizer.tokenize(args, PREFIX_NAME, PREFIX_PHONE, PREFIX_EMAIL, PREFIX_VENUE, PREFIX_TAG);
- if (!arePrefixesPresent(argMultimap, PREFIX_NAME, PREFIX_ADDRESS, PREFIX_PHONE, PREFIX_EMAIL)
+ if (!arePrefixesPresent(argMultimap, PREFIX_NAME, PREFIX_VENUE, PREFIX_PHONE, PREFIX_EMAIL)
|| !argMultimap.getPreamble().isEmpty()) {
throw new ParseException(String.format(MESSAGE_INVALID_COMMAND_FORMAT, AddCommand.MESSAGE_USAGE));
}
- argMultimap.verifyNoDuplicatePrefixesFor(PREFIX_NAME, PREFIX_PHONE, PREFIX_EMAIL, PREFIX_ADDRESS);
+ argMultimap.verifyNoDuplicatePrefixesFor(PREFIX_NAME, PREFIX_PHONE, PREFIX_EMAIL, PREFIX_VENUE);
Name name = ParserUtil.parseName(argMultimap.getValue(PREFIX_NAME).get());
Phone phone = ParserUtil.parsePhone(argMultimap.getValue(PREFIX_PHONE).get());
Email email = ParserUtil.parseEmail(argMultimap.getValue(PREFIX_EMAIL).get());
- Address address = ParserUtil.parseAddress(argMultimap.getValue(PREFIX_ADDRESS).get());
+ Venue venue = ParserUtil.parseVenue(argMultimap.getValue(PREFIX_VENUE).get());
Set tagList = ParserUtil.parseTags(argMultimap.getAllValues(PREFIX_TAG));
- Person person = new Person(name, phone, email, address, tagList);
+ Person person = new Person(name, phone, email, venue, tagList);
return new AddCommand(person);
}
diff --git a/src/main/java/staffconnect/logic/parser/CliSyntax.java b/src/main/java/staffconnect/logic/parser/CliSyntax.java
index 4847f4b9ba6..110c2dd1386 100644
--- a/src/main/java/staffconnect/logic/parser/CliSyntax.java
+++ b/src/main/java/staffconnect/logic/parser/CliSyntax.java
@@ -9,7 +9,7 @@ public class CliSyntax {
public static final Prefix PREFIX_NAME = new Prefix("n/");
public static final Prefix PREFIX_PHONE = new Prefix("p/");
public static final Prefix PREFIX_EMAIL = new Prefix("e/");
- public static final Prefix PREFIX_ADDRESS = new Prefix("a/");
+ public static final Prefix PREFIX_VENUE = new Prefix("v/");
public static final Prefix PREFIX_TAG = new Prefix("t/");
}
diff --git a/src/main/java/staffconnect/logic/parser/EditCommandParser.java b/src/main/java/staffconnect/logic/parser/EditCommandParser.java
index 7281c65eacc..76ff492730f 100644
--- a/src/main/java/staffconnect/logic/parser/EditCommandParser.java
+++ b/src/main/java/staffconnect/logic/parser/EditCommandParser.java
@@ -2,11 +2,11 @@
import static java.util.Objects.requireNonNull;
import static staffconnect.logic.Messages.MESSAGE_INVALID_COMMAND_FORMAT;
-import static staffconnect.logic.parser.CliSyntax.PREFIX_ADDRESS;
import static staffconnect.logic.parser.CliSyntax.PREFIX_EMAIL;
import static staffconnect.logic.parser.CliSyntax.PREFIX_NAME;
import static staffconnect.logic.parser.CliSyntax.PREFIX_PHONE;
import static staffconnect.logic.parser.CliSyntax.PREFIX_TAG;
+import static staffconnect.logic.parser.CliSyntax.PREFIX_VENUE;
import java.util.Collection;
import java.util.Collections;
@@ -32,7 +32,7 @@ public class EditCommandParser implements Parser {
public EditCommand parse(String args) throws ParseException {
requireNonNull(args);
ArgumentMultimap argMultimap =
- ArgumentTokenizer.tokenize(args, PREFIX_NAME, PREFIX_PHONE, PREFIX_EMAIL, PREFIX_ADDRESS, PREFIX_TAG);
+ ArgumentTokenizer.tokenize(args, PREFIX_NAME, PREFIX_PHONE, PREFIX_EMAIL, PREFIX_VENUE, PREFIX_TAG);
Index index;
@@ -42,7 +42,7 @@ public EditCommand parse(String args) throws ParseException {
throw new ParseException(String.format(MESSAGE_INVALID_COMMAND_FORMAT, EditCommand.MESSAGE_USAGE), pe);
}
- argMultimap.verifyNoDuplicatePrefixesFor(PREFIX_NAME, PREFIX_PHONE, PREFIX_EMAIL, PREFIX_ADDRESS);
+ argMultimap.verifyNoDuplicatePrefixesFor(PREFIX_NAME, PREFIX_PHONE, PREFIX_EMAIL, PREFIX_VENUE);
EditPersonDescriptor editPersonDescriptor = new EditPersonDescriptor();
@@ -55,8 +55,8 @@ public EditCommand parse(String args) throws ParseException {
if (argMultimap.getValue(PREFIX_EMAIL).isPresent()) {
editPersonDescriptor.setEmail(ParserUtil.parseEmail(argMultimap.getValue(PREFIX_EMAIL).get()));
}
- if (argMultimap.getValue(PREFIX_ADDRESS).isPresent()) {
- editPersonDescriptor.setAddress(ParserUtil.parseAddress(argMultimap.getValue(PREFIX_ADDRESS).get()));
+ if (argMultimap.getValue(PREFIX_VENUE).isPresent()) {
+ editPersonDescriptor.setVenue(ParserUtil.parseVenue(argMultimap.getValue(PREFIX_VENUE).get()));
}
parseTagsForEdit(argMultimap.getAllValues(PREFIX_TAG)).ifPresent(editPersonDescriptor::setTags);
diff --git a/src/main/java/staffconnect/logic/parser/ParserUtil.java b/src/main/java/staffconnect/logic/parser/ParserUtil.java
index caa0239f860..182ab6e4755 100644
--- a/src/main/java/staffconnect/logic/parser/ParserUtil.java
+++ b/src/main/java/staffconnect/logic/parser/ParserUtil.java
@@ -9,10 +9,10 @@
import staffconnect.commons.core.index.Index;
import staffconnect.commons.util.StringUtil;
import staffconnect.logic.parser.exceptions.ParseException;
-import staffconnect.model.person.Address;
import staffconnect.model.person.Email;
import staffconnect.model.person.Name;
import staffconnect.model.person.Phone;
+import staffconnect.model.person.Venue;
import staffconnect.model.tag.Tag;
/**
@@ -66,18 +66,18 @@ public static Phone parsePhone(String phone) throws ParseException {
}
/**
- * Parses a {@code String address} into an {@code Address}.
+ * Parses a {@code String venue} into an {@code Venue}.
* Leading and trailing whitespaces will be trimmed.
*
- * @throws ParseException if the given {@code address} is invalid.
+ * @throws ParseException if the given {@code venue} is invalid.
*/
- public static Address parseAddress(String address) throws ParseException {
- requireNonNull(address);
- String trimmedAddress = address.trim();
- if (!Address.isValidAddress(trimmedAddress)) {
- throw new ParseException(Address.MESSAGE_CONSTRAINTS);
+ public static Venue parseVenue(String venue) throws ParseException {
+ requireNonNull(venue);
+ String trimmedVenue = venue.trim();
+ if (!Venue.isValidVenue(trimmedVenue)) {
+ throw new ParseException(Venue.MESSAGE_CONSTRAINTS);
}
- return new Address(trimmedAddress);
+ return new Venue(trimmedVenue);
}
/**
diff --git a/src/main/java/staffconnect/model/person/Person.java b/src/main/java/staffconnect/model/person/Person.java
index 2256a57b1d8..58424f05908 100644
--- a/src/main/java/staffconnect/model/person/Person.java
+++ b/src/main/java/staffconnect/model/person/Person.java
@@ -22,18 +22,18 @@ public class Person {
private final Email email;
// Data fields
- private final Address address;
+ private final Venue venue;
private final Set tags = new HashSet<>();
/**
* Every field must be present and not null.
*/
- public Person(Name name, Phone phone, Email email, Address address, Set tags) {
- requireAllNonNull(name, phone, email, address, tags);
+ public Person(Name name, Phone phone, Email email, Venue venue, Set tags) {
+ requireAllNonNull(name, phone, email, venue, tags);
this.name = name;
this.phone = phone;
this.email = email;
- this.address = address;
+ this.venue = venue;
this.tags.addAll(tags);
}
@@ -49,8 +49,8 @@ public Email getEmail() {
return email;
}
- public Address getAddress() {
- return address;
+ public Venue getVenue() {
+ return venue;
}
/**
@@ -93,14 +93,14 @@ public boolean equals(Object other) {
return name.equals(otherPerson.name)
&& phone.equals(otherPerson.phone)
&& email.equals(otherPerson.email)
- && address.equals(otherPerson.address)
+ && venue.equals(otherPerson.venue)
&& tags.equals(otherPerson.tags);
}
@Override
public int hashCode() {
// use this method for custom fields hashing instead of implementing your own
- return Objects.hash(name, phone, email, address, tags);
+ return Objects.hash(name, phone, email, venue, tags);
}
@Override
@@ -109,7 +109,7 @@ public String toString() {
.add("name", name)
.add("phone", phone)
.add("email", email)
- .add("address", address)
+ .add("venue", venue)
.add("tags", tags)
.toString();
}
diff --git a/src/main/java/staffconnect/model/person/Address.java b/src/main/java/staffconnect/model/person/Venue.java
similarity index 52%
rename from src/main/java/staffconnect/model/person/Address.java
rename to src/main/java/staffconnect/model/person/Venue.java
index b4f9e0616b5..f411acf9bd0 100644
--- a/src/main/java/staffconnect/model/person/Address.java
+++ b/src/main/java/staffconnect/model/person/Venue.java
@@ -4,15 +4,16 @@
import static staffconnect.commons.util.AppUtil.checkArgument;
/**
- * Represents a Person's address in the staff book.
- * Guarantees: immutable; is valid as declared in {@link #isValidAddress(String)}
+ * Represents a Person's venue in the staff book.
+ * Guarantees: immutable; is valid as declared in
+ * {@link #isValidVenue(String)}
*/
-public class Address {
+public class Venue {
- public static final String MESSAGE_CONSTRAINTS = "Addresses can take any values, and it should not be blank";
+ public static final String MESSAGE_CONSTRAINTS = "Venues can take any values, and it should not be blank";
/*
- * The first character of the address must not be a whitespace,
+ * The first character of the venue must not be a whitespace,
* otherwise " " (a blank string) becomes a valid input.
*/
public static final String VALIDATION_REGEX = "[^\\s].*";
@@ -20,20 +21,20 @@ public class Address {
public final String value;
/**
- * Constructs an {@code Address}.
+ * Constructs an {@code Venue}.
*
- * @param address A valid address.
+ * @param venue A valid venue.
*/
- public Address(String address) {
- requireNonNull(address);
- checkArgument(isValidAddress(address), MESSAGE_CONSTRAINTS);
- value = address;
+ public Venue(String venue) {
+ requireNonNull(venue);
+ checkArgument(isValidVenue(venue), MESSAGE_CONSTRAINTS);
+ value = venue;
}
/**
* Returns true if a given string is a valid email.
*/
- public static boolean isValidAddress(String test) {
+ public static boolean isValidVenue(String test) {
return test.matches(VALIDATION_REGEX);
}
@@ -49,12 +50,12 @@ public boolean equals(Object other) {
}
// instanceof handles nulls
- if (!(other instanceof Address)) {
+ if (!(other instanceof Venue)) {
return false;
}
- Address otherAddress = (Address) other;
- return value.equals(otherAddress.value);
+ Venue otherVenue = (Venue) other;
+ return value.equals(otherVenue.value);
}
@Override
diff --git a/src/main/java/staffconnect/model/util/SampleDataUtil.java b/src/main/java/staffconnect/model/util/SampleDataUtil.java
index df8f3de5d9a..b9704a48308 100644
--- a/src/main/java/staffconnect/model/util/SampleDataUtil.java
+++ b/src/main/java/staffconnect/model/util/SampleDataUtil.java
@@ -6,11 +6,11 @@
import staffconnect.model.ReadOnlyStaffBook;
import staffconnect.model.StaffBook;
-import staffconnect.model.person.Address;
import staffconnect.model.person.Email;
import staffconnect.model.person.Name;
import staffconnect.model.person.Person;
import staffconnect.model.person.Phone;
+import staffconnect.model.person.Venue;
import staffconnect.model.tag.Tag;
/**
@@ -20,22 +20,22 @@ public class SampleDataUtil {
public static Person[] getSamplePersons() {
return new Person[] {
new Person(new Name("Alex Yeoh"), new Phone("87438807"), new Email("alexyeoh@example.com"),
- new Address("Blk 30 Geylang Street 29, #06-40"),
+ new Venue("Blk 30 Geylang Street 29, #06-40"),
getTagSet("friends")),
new Person(new Name("Bernice Yu"), new Phone("99272758"), new Email("berniceyu@example.com"),
- new Address("Blk 30 Lorong 3 Serangoon Gardens, #07-18"),
+ new Venue("Blk 30 Lorong 3 Serangoon Gardens, #07-18"),
getTagSet("colleagues", "friends")),
new Person(new Name("Charlotte Oliveiro"), new Phone("93210283"), new Email("charlotte@example.com"),
- new Address("Blk 11 Ang Mo Kio Street 74, #11-04"),
+ new Venue("Blk 11 Ang Mo Kio Street 74, #11-04"),
getTagSet("neighbours")),
new Person(new Name("David Li"), new Phone("91031282"), new Email("lidavid@example.com"),
- new Address("Blk 436 Serangoon Gardens Street 26, #16-43"),
+ new Venue("Blk 436 Serangoon Gardens Street 26, #16-43"),
getTagSet("family")),
new Person(new Name("Irfan Ibrahim"), new Phone("92492021"), new Email("irfan@example.com"),
- new Address("Blk 47 Tampines Street 20, #17-35"),
+ new Venue("Blk 47 Tampines Street 20, #17-35"),
getTagSet("classmates")),
new Person(new Name("Roy Balakrishnan"), new Phone("92624417"), new Email("royb@example.com"),
- new Address("Blk 45 Aljunied Street 85, #11-31"),
+ new Venue("Blk 45 Aljunied Street 85, #11-31"),
getTagSet("colleagues"))
};
}
diff --git a/src/main/java/staffconnect/storage/JsonAdaptedPerson.java b/src/main/java/staffconnect/storage/JsonAdaptedPerson.java
index 0dde7c8df12..dd5958ff973 100644
--- a/src/main/java/staffconnect/storage/JsonAdaptedPerson.java
+++ b/src/main/java/staffconnect/storage/JsonAdaptedPerson.java
@@ -10,11 +10,11 @@
import com.fasterxml.jackson.annotation.JsonProperty;
import staffconnect.commons.exceptions.IllegalValueException;
-import staffconnect.model.person.Address;
import staffconnect.model.person.Email;
import staffconnect.model.person.Name;
import staffconnect.model.person.Person;
import staffconnect.model.person.Phone;
+import staffconnect.model.person.Venue;
import staffconnect.model.tag.Tag;
/**
@@ -27,7 +27,7 @@ class JsonAdaptedPerson {
private final String name;
private final String phone;
private final String email;
- private final String address;
+ private final String venue;
private final List tags = new ArrayList<>();
/**
@@ -35,12 +35,12 @@ class JsonAdaptedPerson {
*/
@JsonCreator
public JsonAdaptedPerson(@JsonProperty("name") String name, @JsonProperty("phone") String phone,
- @JsonProperty("email") String email, @JsonProperty("address") String address,
+ @JsonProperty("email") String email, @JsonProperty("venue") String venue,
@JsonProperty("tags") List tags) {
this.name = name;
this.phone = phone;
this.email = email;
- this.address = address;
+ this.venue = venue;
if (tags != null) {
this.tags.addAll(tags);
}
@@ -53,7 +53,7 @@ public JsonAdaptedPerson(Person source) {
name = source.getName().fullName;
phone = source.getPhone().value;
email = source.getEmail().value;
- address = source.getAddress().value;
+ venue = source.getVenue().value;
tags.addAll(source.getTags().stream()
.map(JsonAdaptedTag::new)
.collect(Collectors.toList()));
@@ -94,16 +94,16 @@ public Person toModelType() throws IllegalValueException {
}
final Email modelEmail = new Email(email);
- if (address == null) {
- throw new IllegalValueException(String.format(MISSING_FIELD_MESSAGE_FORMAT, Address.class.getSimpleName()));
+ if (venue == null) {
+ throw new IllegalValueException(String.format(MISSING_FIELD_MESSAGE_FORMAT, Venue.class.getSimpleName()));
}
- if (!Address.isValidAddress(address)) {
- throw new IllegalValueException(Address.MESSAGE_CONSTRAINTS);
+ if (!Venue.isValidVenue(venue)) {
+ throw new IllegalValueException(Venue.MESSAGE_CONSTRAINTS);
}
- final Address modelAddress = new Address(address);
+ final Venue modelVenue = new Venue(venue);
final Set modelTags = new HashSet<>(personTags);
- return new Person(modelName, modelPhone, modelEmail, modelAddress, modelTags);
+ return new Person(modelName, modelPhone, modelEmail, modelVenue, modelTags);
}
}
diff --git a/src/main/java/staffconnect/ui/PersonCard.java b/src/main/java/staffconnect/ui/PersonCard.java
index 7e8360c4b8b..0abadaa1092 100644
--- a/src/main/java/staffconnect/ui/PersonCard.java
+++ b/src/main/java/staffconnect/ui/PersonCard.java
@@ -35,7 +35,7 @@ public class PersonCard extends UiPart {
@FXML
private Label phone;
@FXML
- private Label address;
+ private Label venue;
@FXML
private Label email;
@FXML
@@ -50,7 +50,7 @@ public PersonCard(Person person, int displayedIndex) {
id.setText(displayedIndex + ". ");
name.setText(person.getName().fullName);
phone.setText(person.getPhone().value);
- address.setText(person.getAddress().value);
+ venue.setText(person.getVenue().value);
email.setText(person.getEmail().value);
person.getTags().stream()
.sorted(Comparator.comparing(tag -> tag.tagName))
diff --git a/src/main/resources/view/PersonListCard.fxml b/src/main/resources/view/PersonListCard.fxml
index f5e812e25e6..c75735e6b23 100644
--- a/src/main/resources/view/PersonListCard.fxml
+++ b/src/main/resources/view/PersonListCard.fxml
@@ -29,7 +29,7 @@
-
+
diff --git a/src/test/data/JsonSerializableStaffBookTest/duplicatePersonStaffBook.json b/src/test/data/JsonSerializableStaffBookTest/duplicatePersonStaffBook.json
index a7427fe7aa2..4fb3e28db98 100644
--- a/src/test/data/JsonSerializableStaffBookTest/duplicatePersonStaffBook.json
+++ b/src/test/data/JsonSerializableStaffBookTest/duplicatePersonStaffBook.json
@@ -3,12 +3,12 @@
"name": "Alice Pauline",
"phone": "94351253",
"email": "alice@example.com",
- "address": "123, Jurong West Ave 6, #08-111",
+ "venue": "123, Jurong West Ave 6, #08-111",
"tags": [ "friends" ]
}, {
"name": "Alice Pauline",
"phone": "94351253",
"email": "pauline@example.com",
- "address": "4th street"
+ "venue": "4th street"
} ]
}
diff --git a/src/test/data/JsonSerializableStaffBookTest/invalidPersonStaffBook.json b/src/test/data/JsonSerializableStaffBookTest/invalidPersonStaffBook.json
index ad3f135ae42..084ec4b3c5f 100644
--- a/src/test/data/JsonSerializableStaffBookTest/invalidPersonStaffBook.json
+++ b/src/test/data/JsonSerializableStaffBookTest/invalidPersonStaffBook.json
@@ -3,6 +3,6 @@
"name": "Hans Muster",
"phone": "9482424",
"email": "invalid@email!3e",
- "address": "4th street"
+ "venue": "4th street"
} ]
}
diff --git a/src/test/data/JsonSerializableStaffBookTest/typicalPersonsStaffBook.json b/src/test/data/JsonSerializableStaffBookTest/typicalPersonsStaffBook.json
index 72262099d35..6085e355057 100644
--- a/src/test/data/JsonSerializableStaffBookTest/typicalPersonsStaffBook.json
+++ b/src/test/data/JsonSerializableStaffBookTest/typicalPersonsStaffBook.json
@@ -4,43 +4,43 @@
"name" : "Alice Pauline",
"phone" : "94351253",
"email" : "alice@example.com",
- "address" : "123, Jurong West Ave 6, #08-111",
+ "venue" : "123, Jurong West Ave 6, #08-111",
"tags" : [ "friends" ]
}, {
"name" : "Benson Meier",
"phone" : "98765432",
"email" : "johnd@example.com",
- "address" : "311, Clementi Ave 2, #02-25",
+ "venue" : "311, Clementi Ave 2, #02-25",
"tags" : [ "owesMoney", "friends" ]
}, {
"name" : "Carl Kurz",
"phone" : "95352563",
"email" : "heinz@example.com",
- "address" : "wall street",
+ "venue" : "wall street",
"tags" : [ ]
}, {
"name" : "Daniel Meier",
"phone" : "87652533",
"email" : "cornelia@example.com",
- "address" : "10th street",
+ "venue" : "10th street",
"tags" : [ "friends" ]
}, {
"name" : "Elle Meyer",
"phone" : "9482224",
"email" : "werner@example.com",
- "address" : "michegan ave",
+ "venue" : "michegan ave",
"tags" : [ ]
}, {
"name" : "Fiona Kunz",
"phone" : "9482427",
"email" : "lydia@example.com",
- "address" : "little tokyo",
+ "venue" : "little tokyo",
"tags" : [ ]
}, {
"name" : "George Best",
"phone" : "9482442",
"email" : "anna@example.com",
- "address" : "4th street",
+ "venue" : "4th street",
"tags" : [ ]
} ]
}
diff --git a/src/test/data/JsonStaffBookStorageTest/invalidAndValidPersonStaffBook.json b/src/test/data/JsonStaffBookStorageTest/invalidAndValidPersonStaffBook.json
index 6a4d2b7181c..3498507e711 100644
--- a/src/test/data/JsonStaffBookStorageTest/invalidAndValidPersonStaffBook.json
+++ b/src/test/data/JsonStaffBookStorageTest/invalidAndValidPersonStaffBook.json
@@ -3,11 +3,11 @@
"name": "Valid Person",
"phone": "9482424",
"email": "hans@example.com",
- "address": "4th street"
+ "venue": "4th street"
}, {
"name": "Person With Invalid Phone Field",
"phone": "948asdf2424",
"email": "hans@example.com",
- "address": "4th street"
+ "venue": "4th street"
} ]
}
diff --git a/src/test/data/JsonStaffBookStorageTest/invalidPersonStaffBook.json b/src/test/data/JsonStaffBookStorageTest/invalidPersonStaffBook.json
index ccd21f7d1a9..46fdc860308 100644
--- a/src/test/data/JsonStaffBookStorageTest/invalidPersonStaffBook.json
+++ b/src/test/data/JsonStaffBookStorageTest/invalidPersonStaffBook.json
@@ -3,6 +3,6 @@
"name": "Person with invalid name field: Ha!ns Mu@ster",
"phone": "9482424",
"email": "hans@example.com",
- "address": "4th street"
+ "venue": "4th street"
} ]
}
diff --git a/src/test/java/staffconnect/logic/LogicManagerTest.java b/src/test/java/staffconnect/logic/LogicManagerTest.java
index 35c0b0fb985..f77a2001d48 100644
--- a/src/test/java/staffconnect/logic/LogicManagerTest.java
+++ b/src/test/java/staffconnect/logic/LogicManagerTest.java
@@ -3,10 +3,10 @@
import static org.junit.jupiter.api.Assertions.assertEquals;
import static staffconnect.logic.Messages.MESSAGE_INVALID_PERSON_DISPLAYED_INDEX;
import static staffconnect.logic.Messages.MESSAGE_UNKNOWN_COMMAND;
-import static staffconnect.logic.commands.CommandTestUtil.ADDRESS_DESC_AMY;
import static staffconnect.logic.commands.CommandTestUtil.EMAIL_DESC_AMY;
import static staffconnect.logic.commands.CommandTestUtil.NAME_DESC_AMY;
import static staffconnect.logic.commands.CommandTestUtil.PHONE_DESC_AMY;
+import static staffconnect.logic.commands.CommandTestUtil.VENUE_DESC_AMY;
import static staffconnect.testutil.Assert.assertThrows;
import static staffconnect.testutil.TypicalPersons.AMY;
@@ -166,7 +166,7 @@ public void saveStaffBook(ReadOnlyStaffBook staffBook, Path filePath)
// Triggers the saveStaffBook method by executing an add command
String addCommand = AddCommand.COMMAND_WORD + NAME_DESC_AMY + PHONE_DESC_AMY
- + EMAIL_DESC_AMY + ADDRESS_DESC_AMY;
+ + EMAIL_DESC_AMY + VENUE_DESC_AMY;
Person expectedPerson = new PersonBuilder(AMY).withTags().build();
ModelManager expectedModel = new ModelManager();
expectedModel.addPerson(expectedPerson);
diff --git a/src/test/java/staffconnect/logic/commands/CommandTestUtil.java b/src/test/java/staffconnect/logic/commands/CommandTestUtil.java
index ec44f77e0c0..03138de5717 100644
--- a/src/test/java/staffconnect/logic/commands/CommandTestUtil.java
+++ b/src/test/java/staffconnect/logic/commands/CommandTestUtil.java
@@ -2,11 +2,11 @@
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;
-import static staffconnect.logic.parser.CliSyntax.PREFIX_ADDRESS;
import static staffconnect.logic.parser.CliSyntax.PREFIX_EMAIL;
import static staffconnect.logic.parser.CliSyntax.PREFIX_NAME;
import static staffconnect.logic.parser.CliSyntax.PREFIX_PHONE;
import static staffconnect.logic.parser.CliSyntax.PREFIX_TAG;
+import static staffconnect.logic.parser.CliSyntax.PREFIX_VENUE;
import static staffconnect.testutil.Assert.assertThrows;
import java.util.ArrayList;
@@ -32,10 +32,10 @@ public class CommandTestUtil {
public static final String VALID_PHONE_BOB = "22222222";
public static final String VALID_EMAIL_AMY = "amy@example.com";
public static final String VALID_EMAIL_BOB = "bob@example.com";
- 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 VALID_VENUE_AMY = "Block 312, Amy Street 1";
+ public static final String VALID_VENUE_BOB = "Block 123, Bobby Street 3";
public static final String NAME_DESC_AMY = " " + PREFIX_NAME + VALID_NAME_AMY;
public static final String NAME_DESC_BOB = " " + PREFIX_NAME + VALID_NAME_BOB;
@@ -43,16 +43,16 @@ public class CommandTestUtil {
public static final String PHONE_DESC_BOB = " " + PREFIX_PHONE + VALID_PHONE_BOB;
public static final String EMAIL_DESC_AMY = " " + PREFIX_EMAIL + VALID_EMAIL_AMY;
public static final String EMAIL_DESC_BOB = " " + PREFIX_EMAIL + VALID_EMAIL_BOB;
- public static final String ADDRESS_DESC_AMY = " " + PREFIX_ADDRESS + VALID_ADDRESS_AMY;
- public static final String ADDRESS_DESC_BOB = " " + PREFIX_ADDRESS + VALID_ADDRESS_BOB;
public static final String TAG_DESC_FRIEND = " " + PREFIX_TAG + VALID_TAG_FRIEND;
public static final String TAG_DESC_HUSBAND = " " + PREFIX_TAG + VALID_TAG_HUSBAND;
+ public static final String VENUE_DESC_AMY = " " + PREFIX_VENUE + VALID_VENUE_AMY;
+ public static final String VENUE_DESC_BOB = " " + PREFIX_VENUE + VALID_VENUE_BOB;
public static final String INVALID_NAME_DESC = " " + PREFIX_NAME + "James&"; // '&' not allowed in names
public static final String INVALID_PHONE_DESC = " " + PREFIX_PHONE + "911a"; // 'a' not allowed in phones
public static final String INVALID_EMAIL_DESC = " " + PREFIX_EMAIL + "bob!yahoo"; // missing '@' symbol
- public static final String INVALID_ADDRESS_DESC = " " + PREFIX_ADDRESS; // empty string not allowed for addresses
public static final String INVALID_TAG_DESC = " " + PREFIX_TAG + "hubby*"; // '*' not allowed in tags
+ public static final String INVALID_VENUE_DESC = " " + PREFIX_VENUE; // empty string not allowed for venues
public static final String PREAMBLE_WHITESPACE = "\t \r \n";
public static final String PREAMBLE_NON_EMPTY = "NonEmptyPreamble";
@@ -62,10 +62,10 @@ public class CommandTestUtil {
static {
DESC_AMY = new EditPersonDescriptorBuilder().withName(VALID_NAME_AMY)
- .withPhone(VALID_PHONE_AMY).withEmail(VALID_EMAIL_AMY).withAddress(VALID_ADDRESS_AMY)
+ .withPhone(VALID_PHONE_AMY).withEmail(VALID_EMAIL_AMY).withVenue(VALID_VENUE_AMY)
.withTags(VALID_TAG_FRIEND).build();
DESC_BOB = new EditPersonDescriptorBuilder().withName(VALID_NAME_BOB)
- .withPhone(VALID_PHONE_BOB).withEmail(VALID_EMAIL_BOB).withAddress(VALID_ADDRESS_BOB)
+ .withPhone(VALID_PHONE_BOB).withEmail(VALID_EMAIL_BOB).withVenue(VALID_VENUE_BOB)
.withTags(VALID_TAG_HUSBAND, VALID_TAG_FRIEND).build();
}
diff --git a/src/test/java/staffconnect/logic/commands/EditPersonDescriptorTest.java b/src/test/java/staffconnect/logic/commands/EditPersonDescriptorTest.java
index acd176bae8d..640ef2dfa0b 100644
--- a/src/test/java/staffconnect/logic/commands/EditPersonDescriptorTest.java
+++ b/src/test/java/staffconnect/logic/commands/EditPersonDescriptorTest.java
@@ -5,11 +5,11 @@
import static org.junit.jupiter.api.Assertions.assertTrue;
import static staffconnect.logic.commands.CommandTestUtil.DESC_AMY;
import static staffconnect.logic.commands.CommandTestUtil.DESC_BOB;
-import static staffconnect.logic.commands.CommandTestUtil.VALID_ADDRESS_BOB;
import static staffconnect.logic.commands.CommandTestUtil.VALID_EMAIL_BOB;
import static staffconnect.logic.commands.CommandTestUtil.VALID_NAME_BOB;
import static staffconnect.logic.commands.CommandTestUtil.VALID_PHONE_BOB;
import static staffconnect.logic.commands.CommandTestUtil.VALID_TAG_HUSBAND;
+import static staffconnect.logic.commands.CommandTestUtil.VALID_VENUE_BOB;
import org.junit.jupiter.api.Test;
@@ -48,8 +48,8 @@ public void equals() {
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();
+ // different venue -> returns false
+ editedAmy = new EditPersonDescriptorBuilder(DESC_AMY).withVenue(VALID_VENUE_BOB).build();
assertFalse(DESC_AMY.equals(editedAmy));
// different tags -> returns false
@@ -63,8 +63,8 @@ public void toStringMethod() {
String expected = EditPersonDescriptor.class.getCanonicalName() + "{name="
+ editPersonDescriptor.getName().orElse(null) + ", phone="
+ editPersonDescriptor.getPhone().orElse(null) + ", email="
- + editPersonDescriptor.getEmail().orElse(null) + ", address="
- + editPersonDescriptor.getAddress().orElse(null) + ", tags="
+ + editPersonDescriptor.getEmail().orElse(null) + ", venue="
+ + editPersonDescriptor.getVenue().orElse(null) + ", tags="
+ editPersonDescriptor.getTags().orElse(null) + "}";
assertEquals(expected, editPersonDescriptor.toString());
}
diff --git a/src/test/java/staffconnect/logic/parser/AddCommandParserTest.java b/src/test/java/staffconnect/logic/parser/AddCommandParserTest.java
index 3fbefa58dee..953c812fb9f 100644
--- a/src/test/java/staffconnect/logic/parser/AddCommandParserTest.java
+++ b/src/test/java/staffconnect/logic/parser/AddCommandParserTest.java
@@ -1,15 +1,13 @@
package staffconnect.logic.parser;
import static staffconnect.logic.Messages.MESSAGE_INVALID_COMMAND_FORMAT;
-import static staffconnect.logic.commands.CommandTestUtil.ADDRESS_DESC_AMY;
-import static staffconnect.logic.commands.CommandTestUtil.ADDRESS_DESC_BOB;
import static staffconnect.logic.commands.CommandTestUtil.EMAIL_DESC_AMY;
import static staffconnect.logic.commands.CommandTestUtil.EMAIL_DESC_BOB;
-import static staffconnect.logic.commands.CommandTestUtil.INVALID_ADDRESS_DESC;
import static staffconnect.logic.commands.CommandTestUtil.INVALID_EMAIL_DESC;
import static staffconnect.logic.commands.CommandTestUtil.INVALID_NAME_DESC;
import static staffconnect.logic.commands.CommandTestUtil.INVALID_PHONE_DESC;
import static staffconnect.logic.commands.CommandTestUtil.INVALID_TAG_DESC;
+import static staffconnect.logic.commands.CommandTestUtil.INVALID_VENUE_DESC;
import static staffconnect.logic.commands.CommandTestUtil.NAME_DESC_AMY;
import static staffconnect.logic.commands.CommandTestUtil.NAME_DESC_BOB;
import static staffconnect.logic.commands.CommandTestUtil.PHONE_DESC_AMY;
@@ -18,16 +16,18 @@
import static staffconnect.logic.commands.CommandTestUtil.PREAMBLE_WHITESPACE;
import static staffconnect.logic.commands.CommandTestUtil.TAG_DESC_FRIEND;
import static staffconnect.logic.commands.CommandTestUtil.TAG_DESC_HUSBAND;
-import static staffconnect.logic.commands.CommandTestUtil.VALID_ADDRESS_BOB;
import static staffconnect.logic.commands.CommandTestUtil.VALID_EMAIL_BOB;
import static staffconnect.logic.commands.CommandTestUtil.VALID_NAME_BOB;
import static staffconnect.logic.commands.CommandTestUtil.VALID_PHONE_BOB;
import static staffconnect.logic.commands.CommandTestUtil.VALID_TAG_FRIEND;
import static staffconnect.logic.commands.CommandTestUtil.VALID_TAG_HUSBAND;
-import static staffconnect.logic.parser.CliSyntax.PREFIX_ADDRESS;
+import static staffconnect.logic.commands.CommandTestUtil.VALID_VENUE_BOB;
+import static staffconnect.logic.commands.CommandTestUtil.VENUE_DESC_AMY;
+import static staffconnect.logic.commands.CommandTestUtil.VENUE_DESC_BOB;
import static staffconnect.logic.parser.CliSyntax.PREFIX_EMAIL;
import static staffconnect.logic.parser.CliSyntax.PREFIX_NAME;
import static staffconnect.logic.parser.CliSyntax.PREFIX_PHONE;
+import static staffconnect.logic.parser.CliSyntax.PREFIX_VENUE;
import static staffconnect.logic.parser.CommandParserTestUtil.assertParseFailure;
import static staffconnect.logic.parser.CommandParserTestUtil.assertParseSuccess;
import static staffconnect.testutil.TypicalPersons.AMY;
@@ -37,11 +37,11 @@
import staffconnect.logic.Messages;
import staffconnect.logic.commands.AddCommand;
-import staffconnect.model.person.Address;
import staffconnect.model.person.Email;
import staffconnect.model.person.Name;
import staffconnect.model.person.Person;
import staffconnect.model.person.Phone;
+import staffconnect.model.person.Venue;
import staffconnect.model.tag.Tag;
import staffconnect.testutil.PersonBuilder;
@@ -54,21 +54,20 @@ public void parse_allFieldsPresent_success() {
// whitespace only preamble
assertParseSuccess(parser, PREAMBLE_WHITESPACE + NAME_DESC_BOB + PHONE_DESC_BOB + EMAIL_DESC_BOB
- + ADDRESS_DESC_BOB + TAG_DESC_FRIEND, new AddCommand(expectedPerson));
-
+ + VENUE_DESC_BOB + TAG_DESC_FRIEND, new AddCommand(expectedPerson));
// multiple tags - all accepted
Person expectedPersonMultipleTags = new PersonBuilder(BOB).withTags(VALID_TAG_FRIEND, VALID_TAG_HUSBAND)
.build();
assertParseSuccess(parser,
- NAME_DESC_BOB + PHONE_DESC_BOB + EMAIL_DESC_BOB + ADDRESS_DESC_BOB + TAG_DESC_HUSBAND + TAG_DESC_FRIEND,
+ NAME_DESC_BOB + PHONE_DESC_BOB + EMAIL_DESC_BOB + VENUE_DESC_BOB + TAG_DESC_HUSBAND + TAG_DESC_FRIEND,
new AddCommand(expectedPersonMultipleTags));
}
@Test
public void parse_repeatedNonTagValue_failure() {
String validExpectedPersonString = NAME_DESC_BOB + PHONE_DESC_BOB + EMAIL_DESC_BOB
- + ADDRESS_DESC_BOB + TAG_DESC_FRIEND;
+ + VENUE_DESC_BOB + TAG_DESC_FRIEND;
// multiple names
assertParseFailure(parser, NAME_DESC_AMY + validExpectedPersonString,
@@ -82,15 +81,15 @@ public void parse_repeatedNonTagValue_failure() {
assertParseFailure(parser, EMAIL_DESC_AMY + validExpectedPersonString,
Messages.getErrorMessageForDuplicatePrefixes(PREFIX_EMAIL));
- // multiple addresses
- assertParseFailure(parser, ADDRESS_DESC_AMY + validExpectedPersonString,
- Messages.getErrorMessageForDuplicatePrefixes(PREFIX_ADDRESS));
+ // multiple venues
+ assertParseFailure(parser, VENUE_DESC_AMY + validExpectedPersonString,
+ Messages.getErrorMessageForDuplicatePrefixes(PREFIX_VENUE));
// multiple fields repeated
assertParseFailure(parser,
- validExpectedPersonString + PHONE_DESC_AMY + EMAIL_DESC_AMY + NAME_DESC_AMY + ADDRESS_DESC_AMY
+ validExpectedPersonString + PHONE_DESC_AMY + EMAIL_DESC_AMY + NAME_DESC_AMY + VENUE_DESC_AMY
+ validExpectedPersonString,
- Messages.getErrorMessageForDuplicatePrefixes(PREFIX_NAME, PREFIX_ADDRESS, PREFIX_EMAIL, PREFIX_PHONE));
+ Messages.getErrorMessageForDuplicatePrefixes(PREFIX_NAME, PREFIX_VENUE, PREFIX_EMAIL, PREFIX_PHONE));
// invalid value followed by valid value
@@ -106,9 +105,9 @@ public void parse_repeatedNonTagValue_failure() {
assertParseFailure(parser, INVALID_PHONE_DESC + validExpectedPersonString,
Messages.getErrorMessageForDuplicatePrefixes(PREFIX_PHONE));
- // invalid address
- assertParseFailure(parser, INVALID_ADDRESS_DESC + validExpectedPersonString,
- Messages.getErrorMessageForDuplicatePrefixes(PREFIX_ADDRESS));
+ // invalid venue
+ assertParseFailure(parser, INVALID_VENUE_DESC + validExpectedPersonString,
+ Messages.getErrorMessageForDuplicatePrefixes(PREFIX_VENUE));
// valid value followed by invalid value
@@ -124,16 +123,16 @@ public void parse_repeatedNonTagValue_failure() {
assertParseFailure(parser, validExpectedPersonString + INVALID_PHONE_DESC,
Messages.getErrorMessageForDuplicatePrefixes(PREFIX_PHONE));
- // invalid address
- assertParseFailure(parser, validExpectedPersonString + INVALID_ADDRESS_DESC,
- Messages.getErrorMessageForDuplicatePrefixes(PREFIX_ADDRESS));
+ // invalid venue
+ assertParseFailure(parser, validExpectedPersonString + INVALID_VENUE_DESC,
+ Messages.getErrorMessageForDuplicatePrefixes(PREFIX_VENUE));
}
@Test
public void parse_optionalFieldsMissing_success() {
// zero tags
Person expectedPerson = new PersonBuilder(AMY).withTags().build();
- assertParseSuccess(parser, NAME_DESC_AMY + PHONE_DESC_AMY + EMAIL_DESC_AMY + ADDRESS_DESC_AMY,
+ assertParseSuccess(parser, NAME_DESC_AMY + PHONE_DESC_AMY + EMAIL_DESC_AMY + VENUE_DESC_AMY,
new AddCommand(expectedPerson));
}
@@ -142,55 +141,55 @@ public void parse_compulsoryFieldMissing_failure() {
String expectedMessage = String.format(MESSAGE_INVALID_COMMAND_FORMAT, AddCommand.MESSAGE_USAGE);
// missing name prefix
- assertParseFailure(parser, VALID_NAME_BOB + PHONE_DESC_BOB + EMAIL_DESC_BOB + ADDRESS_DESC_BOB,
+ assertParseFailure(parser, VALID_NAME_BOB + PHONE_DESC_BOB + EMAIL_DESC_BOB + VENUE_DESC_BOB,
expectedMessage);
// missing phone prefix
- assertParseFailure(parser, NAME_DESC_BOB + VALID_PHONE_BOB + EMAIL_DESC_BOB + ADDRESS_DESC_BOB,
+ assertParseFailure(parser, NAME_DESC_BOB + VALID_PHONE_BOB + EMAIL_DESC_BOB + VENUE_DESC_BOB,
expectedMessage);
// missing email prefix
- assertParseFailure(parser, NAME_DESC_BOB + PHONE_DESC_BOB + VALID_EMAIL_BOB + ADDRESS_DESC_BOB,
+ assertParseFailure(parser, NAME_DESC_BOB + PHONE_DESC_BOB + VALID_EMAIL_BOB + VENUE_DESC_BOB,
expectedMessage);
- // missing address prefix
- assertParseFailure(parser, NAME_DESC_BOB + PHONE_DESC_BOB + EMAIL_DESC_BOB + VALID_ADDRESS_BOB,
+ // missing venue prefix
+ assertParseFailure(parser, NAME_DESC_BOB + PHONE_DESC_BOB + EMAIL_DESC_BOB + VALID_VENUE_BOB,
expectedMessage);
// all prefixes missing
- assertParseFailure(parser, VALID_NAME_BOB + VALID_PHONE_BOB + VALID_EMAIL_BOB + VALID_ADDRESS_BOB,
+ assertParseFailure(parser, VALID_NAME_BOB + VALID_PHONE_BOB + VALID_EMAIL_BOB + VALID_VENUE_BOB,
expectedMessage);
}
@Test
public void parse_invalidValue_failure() {
// invalid name
- assertParseFailure(parser, INVALID_NAME_DESC + PHONE_DESC_BOB + EMAIL_DESC_BOB + ADDRESS_DESC_BOB
+ assertParseFailure(parser, INVALID_NAME_DESC + PHONE_DESC_BOB + EMAIL_DESC_BOB + VENUE_DESC_BOB
+ TAG_DESC_HUSBAND + TAG_DESC_FRIEND, Name.MESSAGE_CONSTRAINTS);
// invalid phone
- assertParseFailure(parser, NAME_DESC_BOB + INVALID_PHONE_DESC + EMAIL_DESC_BOB + ADDRESS_DESC_BOB
+ assertParseFailure(parser, NAME_DESC_BOB + INVALID_PHONE_DESC + EMAIL_DESC_BOB + VENUE_DESC_BOB
+ TAG_DESC_HUSBAND + TAG_DESC_FRIEND, Phone.MESSAGE_CONSTRAINTS);
// invalid email
- assertParseFailure(parser, NAME_DESC_BOB + PHONE_DESC_BOB + INVALID_EMAIL_DESC + ADDRESS_DESC_BOB
+ assertParseFailure(parser, NAME_DESC_BOB + PHONE_DESC_BOB + INVALID_EMAIL_DESC + VENUE_DESC_BOB
+ TAG_DESC_HUSBAND + TAG_DESC_FRIEND, Email.MESSAGE_CONSTRAINTS);
- // invalid address
- assertParseFailure(parser, NAME_DESC_BOB + PHONE_DESC_BOB + EMAIL_DESC_BOB + INVALID_ADDRESS_DESC
- + TAG_DESC_HUSBAND + TAG_DESC_FRIEND, Address.MESSAGE_CONSTRAINTS);
+ // invalid venue
+ assertParseFailure(parser, NAME_DESC_BOB + PHONE_DESC_BOB + EMAIL_DESC_BOB + INVALID_VENUE_DESC
+ + TAG_DESC_HUSBAND + TAG_DESC_FRIEND, Venue.MESSAGE_CONSTRAINTS);
// invalid tag
- assertParseFailure(parser, NAME_DESC_BOB + PHONE_DESC_BOB + EMAIL_DESC_BOB + ADDRESS_DESC_BOB
+ assertParseFailure(parser, NAME_DESC_BOB + PHONE_DESC_BOB + EMAIL_DESC_BOB + VENUE_DESC_BOB
+ INVALID_TAG_DESC + VALID_TAG_FRIEND, Tag.MESSAGE_CONSTRAINTS);
// two invalid values, only first invalid value reported
- assertParseFailure(parser, INVALID_NAME_DESC + PHONE_DESC_BOB + EMAIL_DESC_BOB + INVALID_ADDRESS_DESC,
+ assertParseFailure(parser, INVALID_NAME_DESC + PHONE_DESC_BOB + EMAIL_DESC_BOB + INVALID_VENUE_DESC,
Name.MESSAGE_CONSTRAINTS);
// non-empty preamble
assertParseFailure(parser, PREAMBLE_NON_EMPTY + NAME_DESC_BOB + PHONE_DESC_BOB + EMAIL_DESC_BOB
- + ADDRESS_DESC_BOB + TAG_DESC_HUSBAND + TAG_DESC_FRIEND,
+ + VENUE_DESC_BOB + TAG_DESC_HUSBAND + TAG_DESC_FRIEND,
String.format(MESSAGE_INVALID_COMMAND_FORMAT, AddCommand.MESSAGE_USAGE));
}
}
diff --git a/src/test/java/staffconnect/logic/parser/EditCommandParserTest.java b/src/test/java/staffconnect/logic/parser/EditCommandParserTest.java
index b1822865efd..b402c6d986e 100644
--- a/src/test/java/staffconnect/logic/parser/EditCommandParserTest.java
+++ b/src/test/java/staffconnect/logic/parser/EditCommandParserTest.java
@@ -1,31 +1,31 @@
package staffconnect.logic.parser;
import static staffconnect.logic.Messages.MESSAGE_INVALID_COMMAND_FORMAT;
-import static staffconnect.logic.commands.CommandTestUtil.ADDRESS_DESC_AMY;
-import static staffconnect.logic.commands.CommandTestUtil.ADDRESS_DESC_BOB;
import static staffconnect.logic.commands.CommandTestUtil.EMAIL_DESC_AMY;
import static staffconnect.logic.commands.CommandTestUtil.EMAIL_DESC_BOB;
-import static staffconnect.logic.commands.CommandTestUtil.INVALID_ADDRESS_DESC;
import static staffconnect.logic.commands.CommandTestUtil.INVALID_EMAIL_DESC;
import static staffconnect.logic.commands.CommandTestUtil.INVALID_NAME_DESC;
import static staffconnect.logic.commands.CommandTestUtil.INVALID_PHONE_DESC;
import static staffconnect.logic.commands.CommandTestUtil.INVALID_TAG_DESC;
+import static staffconnect.logic.commands.CommandTestUtil.INVALID_VENUE_DESC;
import static staffconnect.logic.commands.CommandTestUtil.NAME_DESC_AMY;
import static staffconnect.logic.commands.CommandTestUtil.PHONE_DESC_AMY;
import static staffconnect.logic.commands.CommandTestUtil.PHONE_DESC_BOB;
import static staffconnect.logic.commands.CommandTestUtil.TAG_DESC_FRIEND;
import static staffconnect.logic.commands.CommandTestUtil.TAG_DESC_HUSBAND;
-import static staffconnect.logic.commands.CommandTestUtil.VALID_ADDRESS_AMY;
import static staffconnect.logic.commands.CommandTestUtil.VALID_EMAIL_AMY;
import static staffconnect.logic.commands.CommandTestUtil.VALID_NAME_AMY;
import static staffconnect.logic.commands.CommandTestUtil.VALID_PHONE_AMY;
import static staffconnect.logic.commands.CommandTestUtil.VALID_PHONE_BOB;
import static staffconnect.logic.commands.CommandTestUtil.VALID_TAG_FRIEND;
import static staffconnect.logic.commands.CommandTestUtil.VALID_TAG_HUSBAND;
-import static staffconnect.logic.parser.CliSyntax.PREFIX_ADDRESS;
+import static staffconnect.logic.commands.CommandTestUtil.VALID_VENUE_AMY;
+import static staffconnect.logic.commands.CommandTestUtil.VENUE_DESC_AMY;
+import static staffconnect.logic.commands.CommandTestUtil.VENUE_DESC_BOB;
import static staffconnect.logic.parser.CliSyntax.PREFIX_EMAIL;
import static staffconnect.logic.parser.CliSyntax.PREFIX_PHONE;
import static staffconnect.logic.parser.CliSyntax.PREFIX_TAG;
+import static staffconnect.logic.parser.CliSyntax.PREFIX_VENUE;
import static staffconnect.logic.parser.CommandParserTestUtil.assertParseFailure;
import static staffconnect.logic.parser.CommandParserTestUtil.assertParseSuccess;
import static staffconnect.testutil.TypicalIndexes.INDEX_FIRST_PERSON;
@@ -38,10 +38,10 @@
import staffconnect.logic.Messages;
import staffconnect.logic.commands.EditCommand;
import staffconnect.logic.commands.EditCommand.EditPersonDescriptor;
-import staffconnect.model.person.Address;
import staffconnect.model.person.Email;
import staffconnect.model.person.Name;
import staffconnect.model.person.Phone;
+import staffconnect.model.person.Venue;
import staffconnect.model.tag.Tag;
import staffconnect.testutil.EditPersonDescriptorBuilder;
@@ -86,7 +86,7 @@ public void parse_invalidValue_failure() {
assertParseFailure(parser, "1" + INVALID_NAME_DESC, Name.MESSAGE_CONSTRAINTS); // invalid name
assertParseFailure(parser, "1" + INVALID_PHONE_DESC, Phone.MESSAGE_CONSTRAINTS); // invalid phone
assertParseFailure(parser, "1" + INVALID_EMAIL_DESC, Email.MESSAGE_CONSTRAINTS); // invalid email
- assertParseFailure(parser, "1" + INVALID_ADDRESS_DESC, Address.MESSAGE_CONSTRAINTS); // invalid address
+ assertParseFailure(parser, "1" + INVALID_VENUE_DESC, Venue.MESSAGE_CONSTRAINTS); // invalid venue
assertParseFailure(parser, "1" + INVALID_TAG_DESC, Tag.MESSAGE_CONSTRAINTS); // invalid tag
// invalid phone followed by valid email
@@ -99,7 +99,7 @@ public void parse_invalidValue_failure() {
assertParseFailure(parser, "1" + TAG_EMPTY + TAG_DESC_FRIEND + TAG_DESC_HUSBAND, Tag.MESSAGE_CONSTRAINTS);
// multiple invalid values, but only the first invalid value is captured
- assertParseFailure(parser, "1" + INVALID_NAME_DESC + INVALID_EMAIL_DESC + VALID_ADDRESS_AMY + VALID_PHONE_AMY,
+ assertParseFailure(parser, "1" + INVALID_NAME_DESC + INVALID_EMAIL_DESC + VALID_VENUE_AMY + VALID_PHONE_AMY,
Name.MESSAGE_CONSTRAINTS);
}
@@ -107,10 +107,10 @@ public void parse_invalidValue_failure() {
public void parse_allFieldsSpecified_success() {
Index targetIndex = INDEX_SECOND_PERSON;
String userInput = targetIndex.getOneBased() + PHONE_DESC_BOB + TAG_DESC_HUSBAND
- + EMAIL_DESC_AMY + ADDRESS_DESC_AMY + NAME_DESC_AMY + TAG_DESC_FRIEND;
+ + EMAIL_DESC_AMY + VENUE_DESC_AMY + NAME_DESC_AMY + TAG_DESC_FRIEND;
EditPersonDescriptor descriptor = new EditPersonDescriptorBuilder().withName(VALID_NAME_AMY)
- .withPhone(VALID_PHONE_BOB).withEmail(VALID_EMAIL_AMY).withAddress(VALID_ADDRESS_AMY)
+ .withPhone(VALID_PHONE_BOB).withEmail(VALID_EMAIL_AMY).withVenue(VALID_VENUE_AMY)
.withTags(VALID_TAG_HUSBAND, VALID_TAG_FRIEND).build();
EditCommand expectedCommand = new EditCommand(targetIndex, descriptor);
@@ -150,9 +150,9 @@ public void parse_oneFieldSpecified_success() {
expectedCommand = new EditCommand(targetIndex, descriptor);
assertParseSuccess(parser, userInput, expectedCommand);
- // address
- userInput = targetIndex.getOneBased() + ADDRESS_DESC_AMY;
- descriptor = new EditPersonDescriptorBuilder().withAddress(VALID_ADDRESS_AMY).build();
+ // venue
+ userInput = targetIndex.getOneBased() + VENUE_DESC_AMY;
+ descriptor = new EditPersonDescriptorBuilder().withVenue(VALID_VENUE_AMY).build();
expectedCommand = new EditCommand(targetIndex, descriptor);
assertParseSuccess(parser, userInput, expectedCommand);
@@ -180,19 +180,19 @@ public void parse_multipleRepeatedFields_failure() {
assertParseFailure(parser, userInput, Messages.getErrorMessageForDuplicatePrefixes(PREFIX_PHONE));
// mulltiple valid fields repeated
- userInput = targetIndex.getOneBased() + PHONE_DESC_AMY + ADDRESS_DESC_AMY + EMAIL_DESC_AMY
- + TAG_DESC_FRIEND + PHONE_DESC_AMY + ADDRESS_DESC_AMY + EMAIL_DESC_AMY + TAG_DESC_FRIEND
- + PHONE_DESC_BOB + ADDRESS_DESC_BOB + EMAIL_DESC_BOB + TAG_DESC_HUSBAND;
+ userInput = targetIndex.getOneBased() + PHONE_DESC_AMY + VENUE_DESC_AMY + EMAIL_DESC_AMY
+ + TAG_DESC_FRIEND + PHONE_DESC_AMY + VENUE_DESC_AMY + EMAIL_DESC_AMY + TAG_DESC_FRIEND
+ + PHONE_DESC_BOB + VENUE_DESC_BOB + EMAIL_DESC_BOB + TAG_DESC_HUSBAND;
assertParseFailure(parser, userInput,
- Messages.getErrorMessageForDuplicatePrefixes(PREFIX_PHONE, PREFIX_EMAIL, PREFIX_ADDRESS));
+ Messages.getErrorMessageForDuplicatePrefixes(PREFIX_PHONE, PREFIX_EMAIL, PREFIX_VENUE));
// multiple invalid values
- userInput = targetIndex.getOneBased() + INVALID_PHONE_DESC + INVALID_ADDRESS_DESC + INVALID_EMAIL_DESC
- + INVALID_PHONE_DESC + INVALID_ADDRESS_DESC + INVALID_EMAIL_DESC;
+ userInput = targetIndex.getOneBased() + INVALID_PHONE_DESC + INVALID_VENUE_DESC + INVALID_EMAIL_DESC
+ + INVALID_PHONE_DESC + INVALID_VENUE_DESC + INVALID_EMAIL_DESC;
assertParseFailure(parser, userInput,
- Messages.getErrorMessageForDuplicatePrefixes(PREFIX_PHONE, PREFIX_EMAIL, PREFIX_ADDRESS));
+ Messages.getErrorMessageForDuplicatePrefixes(PREFIX_PHONE, PREFIX_EMAIL, PREFIX_VENUE));
}
@Test
diff --git a/src/test/java/staffconnect/logic/parser/ParserUtilTest.java b/src/test/java/staffconnect/logic/parser/ParserUtilTest.java
index 58c3ef0219a..752e0989e58 100644
--- a/src/test/java/staffconnect/logic/parser/ParserUtilTest.java
+++ b/src/test/java/staffconnect/logic/parser/ParserUtilTest.java
@@ -14,22 +14,22 @@
import org.junit.jupiter.api.Test;
import staffconnect.logic.parser.exceptions.ParseException;
-import staffconnect.model.person.Address;
import staffconnect.model.person.Email;
import staffconnect.model.person.Name;
import staffconnect.model.person.Phone;
+import staffconnect.model.person.Venue;
import staffconnect.model.tag.Tag;
public class ParserUtilTest {
private static final String INVALID_NAME = "R@chel";
private static final String INVALID_PHONE = "+651234";
- private static final String INVALID_ADDRESS = " ";
+ private static final String INVALID_VENUE = " ";
private static final String INVALID_EMAIL = "example.com";
private static final String INVALID_TAG = "#friend";
private static final String VALID_NAME = "Rachel Walker";
private static final String VALID_PHONE = "123456";
- private static final String VALID_ADDRESS = "123 Main Street #0505";
+ private static final String VALID_VENUE = "123 Main Street #0505";
private static final String VALID_EMAIL = "rachel@example.com";
private static final String VALID_TAG_1 = "friend";
private static final String VALID_TAG_2 = "neighbour";
@@ -103,26 +103,26 @@ public void parsePhone_validValueWithWhitespace_returnsTrimmedPhone() throws Exc
}
@Test
- public void parseAddress_null_throwsNullPointerException() {
- assertThrows(NullPointerException.class, () -> ParserUtil.parseAddress((String) null));
+ public void parseVenue_null_throwsNullPointerException() {
+ assertThrows(NullPointerException.class, () -> ParserUtil.parseVenue((String) null));
}
@Test
- public void parseAddress_invalidValue_throwsParseException() {
- assertThrows(ParseException.class, () -> ParserUtil.parseAddress(INVALID_ADDRESS));
+ public void parseVenue_invalidValue_throwsParseException() {
+ assertThrows(ParseException.class, () -> ParserUtil.parseVenue(INVALID_VENUE));
}
@Test
- public void parseAddress_validValueWithoutWhitespace_returnsAddress() throws Exception {
- Address expectedAddress = new Address(VALID_ADDRESS);
- assertEquals(expectedAddress, ParserUtil.parseAddress(VALID_ADDRESS));
+ public void parseVenue_validValueWithoutWhitespace_returnsVenue() throws Exception {
+ Venue expectedVenue = new Venue(VALID_VENUE);
+ assertEquals(expectedVenue, ParserUtil.parseVenue(VALID_VENUE));
}
@Test
- public void parseAddress_validValueWithWhitespace_returnsTrimmedAddress() throws Exception {
- String addressWithWhitespace = WHITESPACE + VALID_ADDRESS + WHITESPACE;
- Address expectedAddress = new Address(VALID_ADDRESS);
- assertEquals(expectedAddress, ParserUtil.parseAddress(addressWithWhitespace));
+ public void parseVenue_validValueWithWhitespace_returnsTrimmedVenue() throws Exception {
+ String venueWithWhitespace = WHITESPACE + VALID_VENUE + WHITESPACE;
+ Venue expectedVenue = new Venue(VALID_VENUE);
+ assertEquals(expectedVenue, ParserUtil.parseVenue(venueWithWhitespace));
}
@Test
diff --git a/src/test/java/staffconnect/model/StaffBookTest.java b/src/test/java/staffconnect/model/StaffBookTest.java
index 7f622b4e5f6..aabc19a248e 100644
--- a/src/test/java/staffconnect/model/StaffBookTest.java
+++ b/src/test/java/staffconnect/model/StaffBookTest.java
@@ -3,8 +3,8 @@
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertTrue;
-import static staffconnect.logic.commands.CommandTestUtil.VALID_ADDRESS_BOB;
import static staffconnect.logic.commands.CommandTestUtil.VALID_TAG_HUSBAND;
+import static staffconnect.logic.commands.CommandTestUtil.VALID_VENUE_BOB;
import static staffconnect.testutil.Assert.assertThrows;
import static staffconnect.testutil.TypicalPersons.ALICE;
import static staffconnect.testutil.TypicalPersons.getTypicalStaffBook;
@@ -46,7 +46,7 @@ public void resetData_withValidReadOnlyStaffBook_replacesData() {
@Test
public void resetData_withDuplicatePersons_throwsDuplicatePersonException() {
// Two persons with the same identity fields
- Person editedAlice = new PersonBuilder(ALICE).withAddress(VALID_ADDRESS_BOB).withTags(VALID_TAG_HUSBAND)
+ Person editedAlice = new PersonBuilder(ALICE).withVenue(VALID_VENUE_BOB).withTags(VALID_TAG_HUSBAND)
.build();
List newPersons = Arrays.asList(ALICE, editedAlice);
StaffBookStub newData = new StaffBookStub(newPersons);
@@ -73,7 +73,7 @@ public void hasPerson_personInStaffBook_returnsTrue() {
@Test
public void hasPerson_personWithSameIdentityFieldsInStaffBook_returnsTrue() {
staffBook.addPerson(ALICE);
- Person editedAlice = new PersonBuilder(ALICE).withAddress(VALID_ADDRESS_BOB).withTags(VALID_TAG_HUSBAND)
+ Person editedAlice = new PersonBuilder(ALICE).withVenue(VALID_VENUE_BOB).withTags(VALID_TAG_HUSBAND)
.build();
assertTrue(staffBook.hasPerson(editedAlice));
}
diff --git a/src/test/java/staffconnect/model/person/AddressTest.java b/src/test/java/staffconnect/model/person/AddressTest.java
deleted file mode 100644
index fa8ecd329b5..00000000000
--- a/src/test/java/staffconnect/model/person/AddressTest.java
+++ /dev/null
@@ -1,56 +0,0 @@
-package staffconnect.model.person;
-
-import static org.junit.jupiter.api.Assertions.assertFalse;
-import static org.junit.jupiter.api.Assertions.assertTrue;
-import static staffconnect.testutil.Assert.assertThrows;
-
-import org.junit.jupiter.api.Test;
-
-public class AddressTest {
-
- @Test
- public void constructor_null_throwsNullPointerException() {
- assertThrows(NullPointerException.class, () -> new Address(null));
- }
-
- @Test
- public void constructor_invalidAddress_throwsIllegalArgumentException() {
- String invalidAddress = "";
- assertThrows(IllegalArgumentException.class, () -> new Address(invalidAddress));
- }
-
- @Test
- public void isValidAddress() {
- // null address
- assertThrows(NullPointerException.class, () -> Address.isValidAddress(null));
-
- // invalid addresses
- assertFalse(Address.isValidAddress("")); // empty string
- assertFalse(Address.isValidAddress(" ")); // spaces only
-
- // valid addresses
- assertTrue(Address.isValidAddress("Blk 456, Den Road, #01-355"));
- assertTrue(Address.isValidAddress("-")); // one character
- assertTrue(Address.isValidAddress("Leng Inc; 1234 Market St; San Francisco CA 2349879; USA")); // long address
- }
-
- @Test
- public void equals() {
- Address address = new Address("Valid Address");
-
- // same values -> returns true
- assertTrue(address.equals(new Address("Valid Address")));
-
- // same object -> returns true
- assertTrue(address.equals(address));
-
- // null -> returns false
- assertFalse(address.equals(null));
-
- // different types -> returns false
- assertFalse(address.equals(5.0f));
-
- // different values -> returns false
- assertFalse(address.equals(new Address("Other Valid Address")));
- }
-}
diff --git a/src/test/java/staffconnect/model/person/NameContainsKeywordsPredicateTest.java b/src/test/java/staffconnect/model/person/NameContainsKeywordsPredicateTest.java
index fae45b71e55..458bc63e967 100644
--- a/src/test/java/staffconnect/model/person/NameContainsKeywordsPredicateTest.java
+++ b/src/test/java/staffconnect/model/person/NameContainsKeywordsPredicateTest.java
@@ -68,10 +68,10 @@ public void test_nameDoesNotContainKeywords_returnsFalse() {
predicate = new NameContainsKeywordsPredicate(Arrays.asList("Carol"));
assertFalse(predicate.test(new PersonBuilder().withName("Alice Bob").build()));
- // Keywords match phone, email and address, but does not match name
+ // Keywords match phone, email and venue, but does not match name
predicate = new NameContainsKeywordsPredicate(Arrays.asList("12345", "alice@email.com", "Main", "Street"));
assertFalse(predicate.test(new PersonBuilder().withName("Alice").withPhone("12345")
- .withEmail("alice@email.com").withAddress("Main Street").build()));
+ .withEmail("alice@email.com").withVenue("Main Street").build()));
}
@Test
diff --git a/src/test/java/staffconnect/model/person/PersonTest.java b/src/test/java/staffconnect/model/person/PersonTest.java
index a15144c6c2d..e2ad32cbe86 100644
--- a/src/test/java/staffconnect/model/person/PersonTest.java
+++ b/src/test/java/staffconnect/model/person/PersonTest.java
@@ -3,11 +3,11 @@
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertTrue;
-import static staffconnect.logic.commands.CommandTestUtil.VALID_ADDRESS_BOB;
import static staffconnect.logic.commands.CommandTestUtil.VALID_EMAIL_BOB;
import static staffconnect.logic.commands.CommandTestUtil.VALID_NAME_BOB;
import static staffconnect.logic.commands.CommandTestUtil.VALID_PHONE_BOB;
import static staffconnect.logic.commands.CommandTestUtil.VALID_TAG_HUSBAND;
+import static staffconnect.logic.commands.CommandTestUtil.VALID_VENUE_BOB;
import static staffconnect.testutil.Assert.assertThrows;
import static staffconnect.testutil.TypicalPersons.ALICE;
import static staffconnect.testutil.TypicalPersons.BOB;
@@ -34,7 +34,7 @@ public void isSamePerson() {
// same name, all other attributes different -> returns true
Person editedAlice = new PersonBuilder(ALICE).withPhone(VALID_PHONE_BOB).withEmail(VALID_EMAIL_BOB)
- .withAddress(VALID_ADDRESS_BOB).withTags(VALID_TAG_HUSBAND).build();
+ .withVenue(VALID_VENUE_BOB).withTags(VALID_TAG_HUSBAND).build();
assertTrue(ALICE.isSamePerson(editedAlice));
// different name, all other attributes same -> returns false
@@ -81,8 +81,8 @@ public void equals() {
editedAlice = new PersonBuilder(ALICE).withEmail(VALID_EMAIL_BOB).build();
assertFalse(ALICE.equals(editedAlice));
- // different address -> returns false
- editedAlice = new PersonBuilder(ALICE).withAddress(VALID_ADDRESS_BOB).build();
+ // different venue -> returns false
+ editedAlice = new PersonBuilder(ALICE).withVenue(VALID_VENUE_BOB).build();
assertFalse(ALICE.equals(editedAlice));
// different tags -> returns false
@@ -93,7 +93,7 @@ public void equals() {
@Test
public void toStringMethod() {
String expected = Person.class.getCanonicalName() + "{name=" + ALICE.getName() + ", phone=" + ALICE.getPhone()
- + ", email=" + ALICE.getEmail() + ", address=" + ALICE.getAddress() + ", tags=" + ALICE.getTags() + "}";
+ + ", email=" + ALICE.getEmail() + ", venue=" + ALICE.getVenue() + ", tags=" + ALICE.getTags() + "}";
assertEquals(expected, ALICE.toString());
}
}
diff --git a/src/test/java/staffconnect/model/person/UniquePersonListTest.java b/src/test/java/staffconnect/model/person/UniquePersonListTest.java
index 74cb6f91d6c..d440d8a244b 100644
--- a/src/test/java/staffconnect/model/person/UniquePersonListTest.java
+++ b/src/test/java/staffconnect/model/person/UniquePersonListTest.java
@@ -3,8 +3,8 @@
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertTrue;
-import static staffconnect.logic.commands.CommandTestUtil.VALID_ADDRESS_BOB;
import static staffconnect.logic.commands.CommandTestUtil.VALID_TAG_HUSBAND;
+import static staffconnect.logic.commands.CommandTestUtil.VALID_VENUE_BOB;
import static staffconnect.testutil.Assert.assertThrows;
import static staffconnect.testutil.TypicalPersons.ALICE;
import static staffconnect.testutil.TypicalPersons.BOB;
@@ -42,7 +42,7 @@ public void contains_personInList_returnsTrue() {
@Test
public void contains_personWithSameIdentityFieldsInList_returnsTrue() {
uniquePersonList.add(ALICE);
- Person editedAlice = new PersonBuilder(ALICE).withAddress(VALID_ADDRESS_BOB).withTags(VALID_TAG_HUSBAND)
+ Person editedAlice = new PersonBuilder(ALICE).withVenue(VALID_VENUE_BOB).withTags(VALID_TAG_HUSBAND)
.build();
assertTrue(uniquePersonList.contains(editedAlice));
}
@@ -85,7 +85,7 @@ public void setPerson_editedPersonIsSamePerson_success() {
@Test
public void setPerson_editedPersonHasSameIdentity_success() {
uniquePersonList.add(ALICE);
- Person editedAlice = new PersonBuilder(ALICE).withAddress(VALID_ADDRESS_BOB).withTags(VALID_TAG_HUSBAND)
+ Person editedAlice = new PersonBuilder(ALICE).withVenue(VALID_VENUE_BOB).withTags(VALID_TAG_HUSBAND)
.build();
uniquePersonList.setPerson(ALICE, editedAlice);
UniquePersonList expectedUniquePersonList = new UniquePersonList();
diff --git a/src/test/java/staffconnect/model/person/VenueTest.java b/src/test/java/staffconnect/model/person/VenueTest.java
new file mode 100644
index 00000000000..2515c1c176e
--- /dev/null
+++ b/src/test/java/staffconnect/model/person/VenueTest.java
@@ -0,0 +1,56 @@
+package staffconnect.model.person;
+
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+import static staffconnect.testutil.Assert.assertThrows;
+
+import org.junit.jupiter.api.Test;
+
+public class VenueTest {
+
+ @Test
+ public void constructor_null_throwsNullPointerException() {
+ assertThrows(NullPointerException.class, () -> new Venue(null));
+ }
+
+ @Test
+ public void constructor_invalidVenue_throwsIllegalArgumentException() {
+ String invalidVenue = "";
+ assertThrows(IllegalArgumentException.class, () -> new Venue(invalidVenue));
+ }
+
+ @Test
+ public void isValidVenue() {
+ // null venue
+ assertThrows(NullPointerException.class, () -> Venue.isValidVenue(null));
+
+ // invalid venues
+ assertFalse(Venue.isValidVenue("")); // empty string
+ assertFalse(Venue.isValidVenue(" ")); // spaces only
+
+ // valid venues
+ assertTrue(Venue.isValidVenue("Blk 456, Den Road, #01-355"));
+ assertTrue(Venue.isValidVenue("-")); // one character
+ assertTrue(Venue.isValidVenue("Leng Inc; 1234 Market St; San Francisco CA 2349879; USA")); // long venue
+ }
+
+ @Test
+ public void equals() {
+ Venue venue = new Venue("Valid Venue");
+
+ // same values -> returns true
+ assertTrue(venue.equals(new Venue("Valid Venue")));
+
+ // same object -> returns true
+ assertTrue(venue.equals(venue));
+
+ // null -> returns false
+ assertFalse(venue.equals(null));
+
+ // different types -> returns false
+ assertFalse(venue.equals(5.0f));
+
+ // different values -> returns false
+ assertFalse(venue.equals(new Venue("Other Valid Venue")));
+ }
+}
diff --git a/src/test/java/staffconnect/storage/JsonAdaptedPersonTest.java b/src/test/java/staffconnect/storage/JsonAdaptedPersonTest.java
index 0b386d4efb5..c9d9896ee55 100644
--- a/src/test/java/staffconnect/storage/JsonAdaptedPersonTest.java
+++ b/src/test/java/staffconnect/storage/JsonAdaptedPersonTest.java
@@ -12,22 +12,22 @@
import org.junit.jupiter.api.Test;
import staffconnect.commons.exceptions.IllegalValueException;
-import staffconnect.model.person.Address;
import staffconnect.model.person.Email;
import staffconnect.model.person.Name;
import staffconnect.model.person.Phone;
+import staffconnect.model.person.Venue;
public class JsonAdaptedPersonTest {
private static final String INVALID_NAME = "R@chel";
private static final String INVALID_PHONE = "+651234";
- private static final String INVALID_ADDRESS = " ";
+ private static final String INVALID_VENUE = " ";
private static final String INVALID_EMAIL = "example.com";
private static final String INVALID_TAG = "#friend";
private static final String VALID_NAME = BENSON.getName().toString();
private static final String VALID_PHONE = BENSON.getPhone().toString();
private static final String VALID_EMAIL = BENSON.getEmail().toString();
- private static final String VALID_ADDRESS = BENSON.getAddress().toString();
+ private static final String VALID_VENUE = BENSON.getVenue().toString();
private static final List VALID_TAGS = BENSON.getTags().stream()
.map(JsonAdaptedTag::new)
.collect(Collectors.toList());
@@ -41,14 +41,14 @@ public void toModelType_validPersonDetails_returnsPerson() throws Exception {
@Test
public void toModelType_invalidName_throwsIllegalValueException() {
JsonAdaptedPerson person =
- new JsonAdaptedPerson(INVALID_NAME, VALID_PHONE, VALID_EMAIL, VALID_ADDRESS, VALID_TAGS);
+ new JsonAdaptedPerson(INVALID_NAME, VALID_PHONE, VALID_EMAIL, VALID_VENUE, VALID_TAGS);
String expectedMessage = Name.MESSAGE_CONSTRAINTS;
assertThrows(IllegalValueException.class, expectedMessage, person::toModelType);
}
@Test
public void toModelType_nullName_throwsIllegalValueException() {
- JsonAdaptedPerson person = new JsonAdaptedPerson(null, VALID_PHONE, VALID_EMAIL, VALID_ADDRESS, VALID_TAGS);
+ JsonAdaptedPerson person = new JsonAdaptedPerson(null, VALID_PHONE, VALID_EMAIL, VALID_VENUE, VALID_TAGS);
String expectedMessage = String.format(MISSING_FIELD_MESSAGE_FORMAT, Name.class.getSimpleName());
assertThrows(IllegalValueException.class, expectedMessage, person::toModelType);
}
@@ -56,14 +56,14 @@ public void toModelType_nullName_throwsIllegalValueException() {
@Test
public void toModelType_invalidPhone_throwsIllegalValueException() {
JsonAdaptedPerson person =
- new JsonAdaptedPerson(VALID_NAME, INVALID_PHONE, VALID_EMAIL, VALID_ADDRESS, VALID_TAGS);
+ new JsonAdaptedPerson(VALID_NAME, INVALID_PHONE, VALID_EMAIL, VALID_VENUE, VALID_TAGS);
String expectedMessage = Phone.MESSAGE_CONSTRAINTS;
assertThrows(IllegalValueException.class, expectedMessage, person::toModelType);
}
@Test
public void toModelType_nullPhone_throwsIllegalValueException() {
- JsonAdaptedPerson person = new JsonAdaptedPerson(VALID_NAME, null, VALID_EMAIL, VALID_ADDRESS, VALID_TAGS);
+ JsonAdaptedPerson person = new JsonAdaptedPerson(VALID_NAME, null, VALID_EMAIL, VALID_VENUE, VALID_TAGS);
String expectedMessage = String.format(MISSING_FIELD_MESSAGE_FORMAT, Phone.class.getSimpleName());
assertThrows(IllegalValueException.class, expectedMessage, person::toModelType);
}
@@ -71,30 +71,30 @@ public void toModelType_nullPhone_throwsIllegalValueException() {
@Test
public void toModelType_invalidEmail_throwsIllegalValueException() {
JsonAdaptedPerson person =
- new JsonAdaptedPerson(VALID_NAME, VALID_PHONE, INVALID_EMAIL, VALID_ADDRESS, VALID_TAGS);
+ new JsonAdaptedPerson(VALID_NAME, VALID_PHONE, INVALID_EMAIL, VALID_VENUE, VALID_TAGS);
String expectedMessage = Email.MESSAGE_CONSTRAINTS;
assertThrows(IllegalValueException.class, expectedMessage, person::toModelType);
}
@Test
public void toModelType_nullEmail_throwsIllegalValueException() {
- JsonAdaptedPerson person = new JsonAdaptedPerson(VALID_NAME, VALID_PHONE, null, VALID_ADDRESS, VALID_TAGS);
+ JsonAdaptedPerson person = new JsonAdaptedPerson(VALID_NAME, VALID_PHONE, null, VALID_VENUE, VALID_TAGS);
String expectedMessage = String.format(MISSING_FIELD_MESSAGE_FORMAT, Email.class.getSimpleName());
assertThrows(IllegalValueException.class, expectedMessage, person::toModelType);
}
@Test
- public void toModelType_invalidAddress_throwsIllegalValueException() {
+ public void toModelType_invalidVenue_throwsIllegalValueException() {
JsonAdaptedPerson person =
- new JsonAdaptedPerson(VALID_NAME, VALID_PHONE, VALID_EMAIL, INVALID_ADDRESS, VALID_TAGS);
- String expectedMessage = Address.MESSAGE_CONSTRAINTS;
+ new JsonAdaptedPerson(VALID_NAME, VALID_PHONE, VALID_EMAIL, INVALID_VENUE, VALID_TAGS);
+ String expectedMessage = Venue.MESSAGE_CONSTRAINTS;
assertThrows(IllegalValueException.class, expectedMessage, person::toModelType);
}
@Test
- public void toModelType_nullAddress_throwsIllegalValueException() {
+ public void toModelType_nullVenue_throwsIllegalValueException() {
JsonAdaptedPerson person = new JsonAdaptedPerson(VALID_NAME, VALID_PHONE, VALID_EMAIL, null, VALID_TAGS);
- String expectedMessage = String.format(MISSING_FIELD_MESSAGE_FORMAT, Address.class.getSimpleName());
+ String expectedMessage = String.format(MISSING_FIELD_MESSAGE_FORMAT, Venue.class.getSimpleName());
assertThrows(IllegalValueException.class, expectedMessage, person::toModelType);
}
@@ -103,7 +103,7 @@ public void toModelType_invalidTags_throwsIllegalValueException() {
List invalidTags = new ArrayList<>(VALID_TAGS);
invalidTags.add(new JsonAdaptedTag(INVALID_TAG));
JsonAdaptedPerson person =
- new JsonAdaptedPerson(VALID_NAME, VALID_PHONE, VALID_EMAIL, VALID_ADDRESS, invalidTags);
+ new JsonAdaptedPerson(VALID_NAME, VALID_PHONE, VALID_EMAIL, VALID_VENUE, invalidTags);
assertThrows(IllegalValueException.class, person::toModelType);
}
diff --git a/src/test/java/staffconnect/testutil/EditPersonDescriptorBuilder.java b/src/test/java/staffconnect/testutil/EditPersonDescriptorBuilder.java
index 2aa6c86ea64..26f7212673f 100644
--- a/src/test/java/staffconnect/testutil/EditPersonDescriptorBuilder.java
+++ b/src/test/java/staffconnect/testutil/EditPersonDescriptorBuilder.java
@@ -5,11 +5,11 @@
import java.util.stream.Stream;
import staffconnect.logic.commands.EditCommand.EditPersonDescriptor;
-import staffconnect.model.person.Address;
import staffconnect.model.person.Email;
import staffconnect.model.person.Name;
import staffconnect.model.person.Person;
import staffconnect.model.person.Phone;
+import staffconnect.model.person.Venue;
import staffconnect.model.tag.Tag;
/**
@@ -35,7 +35,7 @@ public EditPersonDescriptorBuilder(Person person) {
descriptor.setName(person.getName());
descriptor.setPhone(person.getPhone());
descriptor.setEmail(person.getEmail());
- descriptor.setAddress(person.getAddress());
+ descriptor.setVenue(person.getVenue());
descriptor.setTags(person.getTags());
}
@@ -64,10 +64,10 @@ public EditPersonDescriptorBuilder withEmail(String email) {
}
/**
- * Sets the {@code Address} of the {@code EditPersonDescriptor} that we are building.
+ * Sets the {@code Venue} of the {@code EditPersonDescriptor} that we are building.
*/
- public EditPersonDescriptorBuilder withAddress(String address) {
- descriptor.setAddress(new Address(address));
+ public EditPersonDescriptorBuilder withVenue(String venue) {
+ descriptor.setVenue(new Venue(venue));
return this;
}
diff --git a/src/test/java/staffconnect/testutil/PersonBuilder.java b/src/test/java/staffconnect/testutil/PersonBuilder.java
index 4c3a8546f71..b68d86cee65 100644
--- a/src/test/java/staffconnect/testutil/PersonBuilder.java
+++ b/src/test/java/staffconnect/testutil/PersonBuilder.java
@@ -3,11 +3,11 @@
import java.util.HashSet;
import java.util.Set;
-import staffconnect.model.person.Address;
import staffconnect.model.person.Email;
import staffconnect.model.person.Name;
import staffconnect.model.person.Person;
import staffconnect.model.person.Phone;
+import staffconnect.model.person.Venue;
import staffconnect.model.tag.Tag;
import staffconnect.model.util.SampleDataUtil;
@@ -19,12 +19,12 @@ public class PersonBuilder {
public static final String DEFAULT_NAME = "Amy Bee";
public static final String DEFAULT_PHONE = "85355255";
public static final String DEFAULT_EMAIL = "amy@gmail.com";
- public static final String DEFAULT_ADDRESS = "123, Jurong West Ave 6, #08-111";
+ public static final String DEFAULT_VENUE = "123, Jurong West Ave 6, #08-111";
private Name name;
private Phone phone;
private Email email;
- private Address address;
+ private Venue venue;
private Set tags;
/**
@@ -34,7 +34,7 @@ public PersonBuilder() {
name = new Name(DEFAULT_NAME);
phone = new Phone(DEFAULT_PHONE);
email = new Email(DEFAULT_EMAIL);
- address = new Address(DEFAULT_ADDRESS);
+ venue = new Venue(DEFAULT_VENUE);
tags = new HashSet<>();
}
@@ -45,7 +45,7 @@ public PersonBuilder(Person personToCopy) {
name = personToCopy.getName();
phone = personToCopy.getPhone();
email = personToCopy.getEmail();
- address = personToCopy.getAddress();
+ venue = personToCopy.getVenue();
tags = new HashSet<>(personToCopy.getTags());
}
@@ -66,10 +66,10 @@ public PersonBuilder withTags(String ... tags) {
}
/**
- * Sets the {@code Address} of the {@code Person} that we are building.
+ * Sets the {@code Venue} of the {@code Person} that we are building.
*/
- public PersonBuilder withAddress(String address) {
- this.address = new Address(address);
+ public PersonBuilder withVenue(String venue) {
+ this.venue = new Venue(venue);
return this;
}
@@ -90,7 +90,7 @@ public PersonBuilder withEmail(String email) {
}
public Person build() {
- return new Person(name, phone, email, address, tags);
+ return new Person(name, phone, email, venue, tags);
}
}
diff --git a/src/test/java/staffconnect/testutil/PersonUtil.java b/src/test/java/staffconnect/testutil/PersonUtil.java
index 784b7d4c6d8..4cbe2c15444 100644
--- a/src/test/java/staffconnect/testutil/PersonUtil.java
+++ b/src/test/java/staffconnect/testutil/PersonUtil.java
@@ -1,10 +1,10 @@
package staffconnect.testutil;
-import static staffconnect.logic.parser.CliSyntax.PREFIX_ADDRESS;
import static staffconnect.logic.parser.CliSyntax.PREFIX_EMAIL;
import static staffconnect.logic.parser.CliSyntax.PREFIX_NAME;
import static staffconnect.logic.parser.CliSyntax.PREFIX_PHONE;
import static staffconnect.logic.parser.CliSyntax.PREFIX_TAG;
+import static staffconnect.logic.parser.CliSyntax.PREFIX_VENUE;
import java.util.Set;
@@ -33,7 +33,7 @@ public static String getPersonDetails(Person person) {
sb.append(PREFIX_NAME + person.getName().fullName + " ");
sb.append(PREFIX_PHONE + person.getPhone().value + " ");
sb.append(PREFIX_EMAIL + person.getEmail().value + " ");
- sb.append(PREFIX_ADDRESS + person.getAddress().value + " ");
+ sb.append(PREFIX_VENUE + person.getVenue().value + " ");
person.getTags().stream().forEach(
s -> sb.append(PREFIX_TAG + s.tagName + " ")
);
@@ -48,7 +48,7 @@ public static String getEditPersonDescriptorDetails(EditPersonDescriptor descrip
descriptor.getName().ifPresent(name -> sb.append(PREFIX_NAME).append(name.fullName).append(" "));
descriptor.getPhone().ifPresent(phone -> sb.append(PREFIX_PHONE).append(phone.value).append(" "));
descriptor.getEmail().ifPresent(email -> sb.append(PREFIX_EMAIL).append(email.value).append(" "));
- descriptor.getAddress().ifPresent(address -> sb.append(PREFIX_ADDRESS).append(address.value).append(" "));
+ descriptor.getVenue().ifPresent(venue -> sb.append(PREFIX_VENUE).append(venue.value).append(" "));
if (descriptor.getTags().isPresent()) {
Set tags = descriptor.getTags().get();
if (tags.isEmpty()) {
diff --git a/src/test/java/staffconnect/testutil/TypicalPersons.java b/src/test/java/staffconnect/testutil/TypicalPersons.java
index f6497f7c60b..1dd397a5656 100644
--- a/src/test/java/staffconnect/testutil/TypicalPersons.java
+++ b/src/test/java/staffconnect/testutil/TypicalPersons.java
@@ -1,7 +1,5 @@
package staffconnect.testutil;
-import static staffconnect.logic.commands.CommandTestUtil.VALID_ADDRESS_AMY;
-import static staffconnect.logic.commands.CommandTestUtil.VALID_ADDRESS_BOB;
import static staffconnect.logic.commands.CommandTestUtil.VALID_EMAIL_AMY;
import static staffconnect.logic.commands.CommandTestUtil.VALID_EMAIL_BOB;
import static staffconnect.logic.commands.CommandTestUtil.VALID_NAME_AMY;
@@ -10,6 +8,8 @@
import static staffconnect.logic.commands.CommandTestUtil.VALID_PHONE_BOB;
import static staffconnect.logic.commands.CommandTestUtil.VALID_TAG_FRIEND;
import static staffconnect.logic.commands.CommandTestUtil.VALID_TAG_HUSBAND;
+import static staffconnect.logic.commands.CommandTestUtil.VALID_VENUE_AMY;
+import static staffconnect.logic.commands.CommandTestUtil.VALID_VENUE_BOB;
import java.util.ArrayList;
import java.util.Arrays;
@@ -24,35 +24,35 @@
public class TypicalPersons {
public static final Person ALICE = new PersonBuilder().withName("Alice Pauline")
- .withAddress("123, Jurong West Ave 6, #08-111").withEmail("alice@example.com")
+ .withVenue("123, Jurong West Ave 6, #08-111").withEmail("alice@example.com")
.withPhone("94351253")
.withTags("friends").build();
public static final Person BENSON = new PersonBuilder().withName("Benson Meier")
- .withAddress("311, Clementi Ave 2, #02-25")
+ .withVenue("311, Clementi Ave 2, #02-25")
.withEmail("johnd@example.com").withPhone("98765432")
.withTags("owesMoney", "friends").build();
public static final Person CARL = new PersonBuilder().withName("Carl Kurz").withPhone("95352563")
- .withEmail("heinz@example.com").withAddress("wall street").build();
+ .withEmail("heinz@example.com").withVenue("wall street").build();
public static final Person DANIEL = new PersonBuilder().withName("Daniel Meier").withPhone("87652533")
- .withEmail("cornelia@example.com").withAddress("10th street").withTags("friends").build();
+ .withEmail("cornelia@example.com").withVenue("10th street").withTags("friends").build();
public static final Person ELLE = new PersonBuilder().withName("Elle Meyer").withPhone("9482224")
- .withEmail("werner@example.com").withAddress("michegan ave").build();
+ .withEmail("werner@example.com").withVenue("michegan ave").build();
public static final Person FIONA = new PersonBuilder().withName("Fiona Kunz").withPhone("9482427")
- .withEmail("lydia@example.com").withAddress("little tokyo").build();
+ .withEmail("lydia@example.com").withVenue("little tokyo").build();
public static final Person GEORGE = new PersonBuilder().withName("George Best").withPhone("9482442")
- .withEmail("anna@example.com").withAddress("4th street").build();
+ .withEmail("anna@example.com").withVenue("4th street").build();
// Manually added
public static final Person HOON = new PersonBuilder().withName("Hoon Meier").withPhone("8482424")
- .withEmail("stefan@example.com").withAddress("little india").build();
+ .withEmail("stefan@example.com").withVenue("little india").build();
public static final Person IDA = new PersonBuilder().withName("Ida Mueller").withPhone("8482131")
- .withEmail("hans@example.com").withAddress("chicago ave").build();
+ .withEmail("hans@example.com").withVenue("chicago ave").build();
// Manually added - Person's details found in {@code CommandTestUtil}
public static final Person AMY = new PersonBuilder().withName(VALID_NAME_AMY).withPhone(VALID_PHONE_AMY)
- .withEmail(VALID_EMAIL_AMY).withAddress(VALID_ADDRESS_AMY).withTags(VALID_TAG_FRIEND).build();
+ .withEmail(VALID_EMAIL_AMY).withVenue(VALID_VENUE_AMY).withTags(VALID_TAG_FRIEND).build();
public static final Person BOB = new PersonBuilder().withName(VALID_NAME_BOB).withPhone(VALID_PHONE_BOB)
- .withEmail(VALID_EMAIL_BOB).withAddress(VALID_ADDRESS_BOB).withTags(VALID_TAG_HUSBAND, VALID_TAG_FRIEND)
+ .withEmail(VALID_EMAIL_BOB).withVenue(VALID_VENUE_BOB).withTags(VALID_TAG_HUSBAND, VALID_TAG_FRIEND)
.build();
public static final String KEYWORD_MATCHING_MEIER = "Meier"; // A keyword that matches MEIER