--- /dev/null
+/*
+ * Copyright (C) 2017 Roland Häder
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+package org.mxchange.jfinancials.events.receipt.added;
+
+import java.io.Serializable;
+import org.mxchange.jfinancials.model.receipt.BillableReceipt;
+
+/**
+ * An interface for events being fired when a receipt instance has been added.
+ * <p>
+ * @author Roland Häder<roland@mxchange.org>
+ */
+public interface ObservableReceiptAddedEvent extends Serializable {
+
+ /**
+ * Getter for receipt instance
+ * <p>
+ * @return Receipt instance
+ */
+ BillableReceipt getReceipt ();
+
+}
--- /dev/null
+/*
+ * Copyright (C) 2017 Roland Haeder<roland@mxchange.org>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+package org.mxchange.jfinancials.events.receipt.added;
+
+import java.text.MessageFormat;
+import org.mxchange.jfinancials.model.receipt.BillableReceipt;
+
+/**
+ * An event being fired when a new receipt has been added
+ * <p>
+ * @author Roland Haeder<roland@mxchange.org>
+ */
+public class ReceiptAddedEvent implements ObservableReceiptAddedEvent {
+
+ /**
+ * Serial number
+ */
+ private static final long serialVersionUID = 157_582_667_163_547L;
+
+ /**
+ * New receipt instance being added
+ */
+ private final BillableReceipt receipt;
+
+ /**
+ * Constructor with receipt instance
+ * <p>
+ * @param receipt Receipt instance
+ */
+ public ReceiptAddedEvent (final BillableReceipt receipt) {
+ // Validate parameter
+ if (null == receipt) {
+ // Throw NPE
+ throw new NullPointerException("receipt is null");
+ } else if (receipt.getReceiptId() == null) {
+ // Throw NPE again
+ throw new NullPointerException("receipt.receiptId is null");
+ } else if (receipt.getReceiptId() < 1) {
+ // Throw NPE again
+ throw new NullPointerException(MessageFormat.format("receipt.receiptId={0} is not valid", receipt.getReceiptId()));
+ }
+
+ // Set it here
+ this.receipt = receipt;
+ }
+
+ @Override
+ public BillableReceipt getReceipt () {
+ return this.receipt;
+ }
+
+}