package com.atlassian.stash.internal.pull;

import com.atlassian.bitbucket.util.Page;

import javax.annotation.Nonnull;

/**
 * Enriches {@link InternalPullRequestActivity activities}, adding context where appropriate.
 * <p>
 * Implementations are encouraged to perform any grouping/batching possible while adding context.
 */
public interface PullRequestActivityEnricher {

    /**
     * Enriches the {@link InternalPullRequestActivity activities} on the provided {@link Page page}, adding context
     * as appropriate.
     * <p>
     * Note: Because {@link Page} is immutable, implementations may only augment the activities on the page; they may
     * not remove or replace them.
     *
     * @param pullRequest the pull request to which all activities on the page belong
     * @param activities  the activities to process with context
     */
    void enrich(@Nonnull InternalPullRequest pullRequest, @Nonnull Iterable<InternalPullRequestActivity> activities);
}
