package seedu.address.model.task;

import java.time.ZonedDateTime;
import java.util.Objects;

import seedu.address.model.task.exceptions.PastDateTimeException;

//@@author A0140023E
public class Deadline {
    public static final String MESSAGE_DEADLINE_CONSTRAINTS = "Deadline should not be in the past";

    private ZonedDateTime dateTime;

    public Deadline(ZonedDateTime dateTime) throws PastDateTimeException {
        assert dateTime != null;

        if (dateTime.isBefore(ZonedDateTime.now())) {
            throw new PastDateTimeException(MESSAGE_DEADLINE_CONSTRAINTS);
        }

        this.dateTime = dateTime;
    }

    public ZonedDateTime getValue() {
        return dateTime;
    }

    @Override
    public String toString() {
        return dateTime.toString();
    }

    @Override
    public boolean equals(Object o) {
        if (o == null) {
            return false;
        }
        if (o == this) {
            return true;
        }
        if (this.getClass() != o.getClass()) {
            return false;
        }
        final Deadline other = (Deadline) o;

        return Objects.equals(getValue(), other.getValue());
    }

    @Override
    public int hashCode() {
        return dateTime.hashCode();
    }
}

@@ -345,113 +345,1078 @@
     
-public Deadline(ZonedDateTime dateTime) throws PastDateTimeException %7B%0A        assert dateTime != null;%0A%0A
+/**%0A     * Constructs a new Deadline with the given DateTime.%0A     *%0A     * @param dateTime the DateTime to specify for the deadline%0A     * @throws PastDateTimeException if %7B@code dateTime%7D is before the current DateTime%0A     */%0A    public Deadline(ZonedDateTime dateTime) throws PastDateTimeException %7B%0A        this(dateTime, false);%0A    %7D%0A%0A    /**%0A     * Constructs a new Deadline with the given DateTime. Ignores checking for dates in the past if%0A     * %7B@code ignorePast%7D is true.%0A     *%0A     * @param dateTime the DateTime to specify for the deadline%0A     * @param allowPastDateTime ignore checking if %7B@code dateTime%7D is in the past. Avoid setting%0A     *        to true except for cases such as loading from storage%0A     * @throws PastDateTimeException if %7B@code dateTime%7D is before the current DateTime and%0A     *         %7B@code allowPastDateTime%7D is %7B@code false%7D%0A     */%0A    public Deadline(ZonedDateTime dateTime, boolean allowPastDateTime) throws PastDateTimeException %7B%0A        assert dateTime != null;%0A%0A        // TODO%0A        if (!allowPastDateTime) %7B%0A    
     
@@ -1461,24 +1461,28 @@
 e.now())) %7B%0A
+    
             
@@ -1544,16 +1544,30 @@
 AINTS);%0A
+            %7D%0A
         

Add option to allow past dates in Deadline