package com.atlassian.stash.internal.build.hook;

import com.atlassian.bitbucket.audit.Channels;
import com.atlassian.bitbucket.audit.Priority;
import com.atlassian.bitbucket.event.repository.RepositoryEvent;
import com.atlassian.bitbucket.event.annotation.Audited;
import com.atlassian.bitbucket.repository.Repository;

import javax.annotation.Nonnull;

@Audited(converter = RequiredBuildChangedEventConverter.class, channels = {Channels.REPOSITORY_UI}, priority = Priority.HIGH)
public class RequiredBuildsChangedEvent extends RepositoryEvent {

    private final Integer currentCount;
    private final Integer previousCount;

    protected RequiredBuildsChangedEvent(@Nonnull Object source, Repository repository, Integer currentCount,
                                         Integer previousCount) {
        super(source, repository);
        this.currentCount = currentCount;
        this.previousCount = previousCount;
    }

    public Integer getCurrentCount() {
        return currentCount;
    }

    public Integer getPreviousCount() {
        return previousCount;
    }
}
