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

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

import javax.annotation.Nonnull;
import java.util.Map;

/**
 * @since 4.8
 */
public class CommitCommentRepliedPullRequestNotificationHandler
        extends AbstractPullRequestNotificationHandler<CommitCommentRepliedPullRequestNotification> {

    private static final String TEMPLATE = "bitbucket.internal.notification.email.pullRequest.comment";

    public CommitCommentRepliedPullRequestNotificationHandler(@Nonnull NotificationHelper helper) {
        super(helper, TEMPLATE);
    }

    @Override
    protected Map<String, Object> getContext(CommitCommentRepliedPullRequestNotification notification) {
        Map<String, Object> context = super.getContext(notification);
        context.put("parent", notification.getParent());
        context.put("comment", notification.getComment());
        context.put("since", notification.getSince());
        context.put("until", notification.getUntil());
        return context;
    }
}
