package com.atlassian.stash.internal.notification.pull.handlers;

import com.atlassian.bitbucket.notification.pull.PullRequestReviewersUpdatedNotification;
import com.atlassian.stash.internal.notification.handlers.NotificationHelper;

import java.util.Map;

public class PullRequestReviewersUpdatedNotificationHandler
        extends AbstractPullRequestNotificationHandler<PullRequestReviewersUpdatedNotification> {

    private static final String ADDED_REVIEWERS = "addedReviewers";
    private static final String REMOVED_REVIEWERS = "removedReviewers";
    private static final String TEMPLATE = "bitbucket.internal.notification.email.pullRequest.reviewersUpdated";

    public PullRequestReviewersUpdatedNotificationHandler(NotificationHelper helper) {
        super(helper, TEMPLATE);
    }

    @Override
    protected Map<String, Object> getContext(PullRequestReviewersUpdatedNotification notification) {
        Map<String, Object> context = super.getContext(notification);
        context.put(ADDED_REVIEWERS, notification.getAddedReviewers());
        context.put(REMOVED_REVIEWERS, notification.getRemovedReviewers());
        return context;
    }
}
