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);
        }

    }

}

@@ -483,36 +483,55 @@
 s a 
-person to the address book. 
+task, deadline or event to the task manager. %5Cn
 %22%0A  
@@ -543,16 +543,21 @@
      + %22
+Task 
 Paramete
@@ -564,50 +564,238 @@
 rs: 
-NAME p/PHONE e/EMAIL a/ADDRESS  %5Bt/TAG%5D...
+%22 + Type.TASK_WORD + %22 n/NAME %5Cn%22%0A            + %22Deadline Parameters: %22 + Type.DEADLINE_WORD + %22 n/NAME d/%5BDATE%5D t/%5BTIME%5D %5Cn%22%0A            + %22Event Parameters: %22 + Type.EVENT_WORD + %22 n/NAME sd/%5BDATE%5D st/%5BTIME%5D ed/%5BDATE%5D et/%5BTIME%5D 
 %5Cn%22%0A
@@ -816,16 +816,23 @@
 %22Example
+ (Task)
 : %22 + CO
@@ -845,114 +845,72 @@
 WORD
-%0A            + %22 John Doe p/98765432 e/johnd@gmail.com a/311, Clementi Ave 2, #02-25 t/friends t/owesMoney
+ +  %22 %22 + Type.TASK_WORD %0A            + %22 Win Facebook hackathon
 %22;%0A%0A

Update MESSAGE_USAGE in AddCommand