package util.events.testevents;

import util.events.Event;

public class UpdateDummyRepoEvent extends Event {

    public final UpdateType updateType;
    public final String repoId;
    public final int itemId; // For issues and milestones
    public final String idString; // For labels and users
    public final String updateText;

    public enum UpdateType {NEW_ISSUE, UPDATE_ISSUE, DELETE_ISSUE,
        NEW_LABEL, DELETE_LABEL,
        NEW_MILESTONE, UPDATE_MILESTONE, DELETE_MILESTONE,
        NEW_USER, DELETE_USER,
        RESET_REPO
    }

    /**
     * Most generic constructor for UpdateDummyRepoEvent.
     *
     * @param updateType The type of update to be carried out.
     * @param repoId The full name of the repository.
     * @param itemId The id of the element to be updated or deleted, if necessary.
     * @param updateText The text to update the element with, if necessary.
     */
    public UpdateDummyRepoEvent(UpdateType updateType, String repoId, int itemId, String idString, String updateText) {
        this.updateType = updateType;
        this.repoId = repoId;
        this.itemId = itemId;
        this.idString = idString;
        this.updateText = updateText;
    }

    // Overloaded constructors

    // Hardly used, maybe to clean up entire model
    public UpdateDummyRepoEvent(UpdateType updateType) {
        this(updateType, null, -1, null, null);
    }

    // e.g. Clean repo, new issue
    public UpdateDummyRepoEvent(UpdateType updateType, String repoId) {
        this(updateType, repoId, -1, null, null);
    }

    // e.g. Delete issue
    public UpdateDummyRepoEvent(UpdateType updateType, String repoId, int itemId) {
        this(updateType, repoId, itemId, null, null);
    }

    // e.g. Delete label
    public UpdateDummyRepoEvent(UpdateType updateType, String repoId, String idString) {
        this(updateType, repoId, -1, idString, null);
    }

    // e.g. Update issue
    public UpdateDummyRepoEvent(UpdateType updateType, String repoId, int itemId, String updateText) {
        this(updateType, repoId, itemId, null, updateText);
    }

    // e.g. Update label
    public UpdateDummyRepoEvent(UpdateType updateType, String repoId, String idString, String updateText) {
        this(updateType, repoId, -1, idString, updateText);
    }
}

@@ -327,16 +327,47 @@
 ateText;
+%0A    public final String actor;
 %0A%0A    pu
@@ -550,16 +550,37 @@
 E_USER,%0A
+        ADD_COMMENT,%0A
         
@@ -1062,32 +1062,78 @@
 tring updateText
+,%0A                                String actor
 ) %7B%0A        this
@@ -1286,24 +1286,52 @@
 updateText;%0A
+        this.actor = actor;%0A
     %7D%0A%0A    /
@@ -1502,32 +1502,36 @@
 , -1, null, null
+, %22%22
 );%0A    %7D%0A%0A    //
@@ -1669,32 +1669,36 @@
 , -1, null, null
+, %22%22
 );%0A    %7D%0A%0A    //
@@ -1707,32 +1707,50 @@
 .g. Delete issue
+, delete milestone
 %0A    public Upda
@@ -1865,24 +1865,28 @@
 , null, null
+, %22%22
 );%0A    %7D%0A%0A  
@@ -2048,16 +2048,20 @@
 ng, null
+, %22%22
 );%0A    %7D
@@ -2082,24 +2082,42 @@
 Update issue
+, update milestone
 %0A    public 
@@ -2257,32 +2257,36 @@
 null, updateText
+, %22%22
 );%0A    %7D%0A%0A    //
@@ -2469,16 +2469,231 @@
 dateText
+, %22%22);%0A    %7D%0A%0A    // e.g. Comment%0A    public UpdateDummyRepoEvent(UpdateType updateType, String repoId, int itemId, String updateText, String actor) %7B%0A        this(updateType, repoId, itemId, null, updateText, actor
 );%0A    %7D

Add ADD_COMMENT as an UpdateDummyRepoEvent type