package seedu.address.logic.commands;

import seedu.address.commons.exceptions.IllegalValueException;
import seedu.address.model.person.*;
import seedu.address.model.tag.Tag;
import seedu.address.model.tag.UniqueTagList;

import java.util.HashSet;
import java.util.Set;

/**
 * Adds a person to the address book.
 */
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. "
            + "Parameters: NAME p/PHONE e/EMAIL a/ADDRESS  [t/TAG]...\n"
            + "Example: " + COMMAND_WORD
            + " John Doe p/98765432 e/johnd@gmail.com a/311, Clementi Ave 2, #02-25 t/friends t/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";

    private final Person toAdd;

    /**
     * Convenience constructor using raw values.
     *
     * @throws IllegalValueException if any of the raw values are invalid
     */
    public AddCommand(String name, String phone, String email, String address, Set<String> tags)
            throws IllegalValueException {
        final Set<Tag> tagSet = new HashSet<>();
        for (String tagName : tags) {
            tagSet.add(new Tag(tagName));
        }
        this.toAdd = new Person(
                new Name(name),
                new Phone(phone),
                new Email(email),
                new Address(address),
                new UniqueTagList(tagSet)
        );
    }

    @Override
    public CommandResult execute() {
        assert model != null;
        try {
            model.addPerson(toAdd);
            return new CommandResult(String.format(MESSAGE_SUCCESS, toAdd));
        } catch (UniquePersonList.DuplicatePersonException e) {
            return new CommandResult(MESSAGE_DUPLICATE_PERSON);
        }

    }

}

@@ -95,16 +95,62 @@
 eption;%0A
+import seedu.address.model.activity.Activity;%0A
 import s
@@ -980,22 +980,24 @@
 e final 
-Person
+Activity
  toAdd;%0A
@@ -1180,475 +1180,91 @@
 name
-, String phone, String email, String address, Set%3CString%3E tags)%0A            throws IllegalValueException %7B%0A        final Set%3CTag%3E tagSet = new HashSet%3C%3E();%0A        for (String tagName : tags) %7B%0A            tagSet.add(new Tag(tagName));%0A        %7D%0A        this.toAdd = new Person(%0A                new Name(name),%0A                new Phone(phone),%0A                new Email(email),%0A                new Address(address),%0A                new UniqueTagList(tagSet)%0A        
+)%0A            throws IllegalValueException %7B%0A        this.toAdd = new Activity(name
 );%0A 
@@ -1354,26 +1354,8 @@
 ll;%0A
-        try %7B%0A    
     
@@ -1382,20 +1382,16 @@
 toAdd);%0A
-    
         
@@ -1459,147 +1459,8 @@
 ));%0A
-        %7D catch (UniquePersonList.DuplicatePersonException e) %7B%0A            return new CommandResult(MESSAGE_DUPLICATE_PERSON);%0A        %7D%0A%0A
     

Update AddCommand class to use new Activity class