package seedu.address.logic.commands;

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

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

    }

}

@@ -268,38 +268,36 @@
 %0A%0A/**%0A * Adds a 
-person
+task
  to the address 
@@ -475,22 +475,20 @@
  Adds a 
-person
+task
  to the 
@@ -539,33 +539,43 @@
 AME 
-p/PHONE e/EMAIL a/ADDRESS
+o/OPENTIME c/CLOSETIME i/IMPORTANCE
   %5Bt
@@ -647,97 +647,19 @@
 + %22 
-John Doe p/98765432 e/johnd@gmail.com a/311, Clementi Ave 2, #02-25 t/friends t/owesMoney
+Finish 2103
 %22;%0A%0A
@@ -860,22 +860,20 @@
 e final 
-Person
+Task
  toAdd;%0A
@@ -1061,20 +1061,23 @@
  String 
-phon
+openTim
 e, Strin
@@ -1082,29 +1082,36 @@
 ing 
-email, String address
+closeTime, String importance
 , Se
@@ -1333,22 +1333,20 @@
 d = new 
-Person
+Task
 (%0A      
@@ -1395,18 +1395,24 @@
 new 
-Phone(phon
+DateTime(openTim
 e),%0A
@@ -1435,19 +1435,26 @@
 new 
-Email(email
+DateTime(closeTime
 ),%0A 
@@ -1476,23 +1476,26 @@
 new 
-Address(address
+Boolean(importance
 ),%0A 
@@ -1669,22 +1669,20 @@
 odel.add
-Person
+Task
 (toAdd);
@@ -1782,22 +1782,20 @@
  (Unique
-Person
+Task
 List.Dup
@@ -1804,14 +1804,12 @@
 cate
-Person
+Task
 Exce

Implement Add command(initial)