package de.fete.application.service.exception;

import java.time.LocalDate;

/** Thrown when an event's expiry date is not in the future. */
public class ExpiryDateInPastException extends RuntimeException {

  private final LocalDate expiryDate;

  /** Creates a new exception for the given invalid expiry date. */
  public ExpiryDateInPastException(LocalDate expiryDate) {
    super("Expiry date must be in the future: " + expiryDate);
    this.expiryDate = expiryDate;
  }

  /** Returns the invalid expiry date. */
  public LocalDate getExpiryDate() {
    return expiryDate;
  }
}
