package homepage.events.articel;

import homepage.core.events.DeletedEvent;

import java.util.UUID;

public class ArticelDeletedEvent extends DeletedEvent {

	private UUID key;
	private ArticelDetails details;
	private boolean deletionCompleted;

	private ArticelDeletedEvent(UUID key) {
		this.key = key;
	}

	public ArticelDeletedEvent(UUID key, ArticelDetails details) {
		this.key = key;
		this.details = details;
		this.deletionCompleted = true;
	}

	public UUID getKey() {
		return key;
	}

	public ArticelDetails getDetails() {
		return details;
	}

	public boolean isDeletionCompleted() {
		return deletionCompleted;
	}

	public static ArticelDeletedEvent deletionForbidden(UUID key,
			ArticelDetails details) {
		ArticelDeletedEvent ev = new ArticelDeletedEvent(key, details);
		ev.entityFound = true;
		ev.deletionCompleted = false;
		return ev;
	}

	public static ArticelDeletedEvent notFound(UUID key) {
		ArticelDeletedEvent ev = new ArticelDeletedEvent(key);
		ev.entityFound = false;
		return ev;
	}
}