package com.acme.structure.exception.main;

import com.acme.structure.exception.base.ApplicationException;
import com.acme.structure.exception.base.InfrastructureException;

import com.acme.structure.util.DateUtility;

import java.util.Date;

public class InvalidDateInputException extends InfrastructureException
{
    private Date date;

    //this class is used if date input exception is not excepted as a valid input
    //ex: date cannot be before today

    public InvalidDateInputException(Date date)
    {
        exceptionCode = "17";
        exceptionType = ApplicationException.EXCEPTION_TYPE_ERROR;

        this.date = date;
    }

    @Override
    public String getReason()
    {
        return DateUtility.convertDateToString(date);
    }

}
