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

    }

}

@@ -274,38 +274,36 @@
 *%0A * Adds a 
-person
+task
  to the 
 address book
@@ -290,28 +290,28 @@
  to the 
-address book
+task manager
 .%0A */%0Apu
@@ -481,22 +481,20 @@
 s a 
-person
+task
  to the 
 addr
@@ -489,28 +489,28 @@
  to the 
-address book
+task manager
 . %22%0A    
@@ -536,46 +536,96 @@
 rs: 
-NAME p/PHONE e/EMAIL a/ADDRESS  %5Bt/
+%5C%22TASK_DESCRIPTION%5C%22 %5Bon DATE%5D %5Bby DEADLINE_TIME%5D %5Bfrom START_TIME%5D %5Bto END_TIME%5D %5B#
 TAG
+S
 %5D...
@@ -689,97 +689,72 @@
 + %22 
-John Doe p/98765432 e/johnd@gmail.com a/311, Clementi Ave 2, #02-25 t/friends t/owesMoney
+add %5C%22CS2103T Lecture%5C%22 on 7 Oct 2016 from 2pm to 4pm #Important
 %22;%0A%0A

change the constant string literals