package net.congstar.jira.plugins.scrumpoker.action;

import net.congstar.jira.plugins.scrumpoker.data.StoryPointFieldSupport;

public class ConfirmEstimationAction extends ScrumPokerAction {

    private static final long serialVersionUID = 1L;

    private final StoryPointFieldSupport storyPointFieldSupport;

    public ConfirmEstimationAction(StoryPointFieldSupport storyPointFieldSupport) {
        this.storyPointFieldSupport = storyPointFieldSupport;
    }

    @Override
    protected String doExecute() throws Exception {
        String issueKey = getHttpRequest().getParameter(PARAM_ISSUE_KEY);
        String finalVote = getHttpRequest().getParameter("finalVote");

        storyPointFieldSupport.save(issueKey, new Double(finalVote));

        String returnUrl = (String) getHttpSession().getAttribute(PARAM_RETURN_URL);
        getHttpSession().removeAttribute(PARAM_RETURN_URL);

        return getRedirect(returnUrl);
    }

}

@@ -47,16 +47,87 @@
 ction;%0A%0A
+import net.congstar.jira.plugins.scrumpoker.data.PlanningPokerStorage;%0A
 import n
@@ -191,16 +191,16 @@
 upport;%0A
-
 %0Apublic 
@@ -377,16 +377,78 @@
 pport;%0A%0A
+    private final PlanningPokerStorage planningPokerStorage;%0A%0A
     publ
@@ -519,16 +519,59 @@
 dSupport
+, PlanningPokerStorage planningPokerStorage
 ) %7B%0A    
@@ -628,16 +628,74 @@
 upport;%0A
+        this.planningPokerStorage = planningPokerStorage;%0A
     %7D%0A%0A 
@@ -901,24 +901,24 @@
 nalVote%22);%0A%0A
-
         stor
@@ -974,16 +974,66 @@
 lVote));
+%0A        planningPokerStorage.resetDeck(issueKey);
 %0A%0A      

reset planning poker after confirming an estimation