public boolean isWorkEstimationVotingComplete() { for (User user : getProject().getTeamMembers()) { RequirementEstimationVote vote = getEstimationVote(user); if (vote == null || vote.getEstimatedWork() == null) return false; } return true; }
public void setVote(Float estimatedWork) { RequirementEstimationVote vote = getEstimationVote(Scope.get().getComponent(Auth.class).getUser()); if (vote == null) throw new IllegalStateException("vote == null"); vote.setEstimatedWork(estimatedWork); if (estimatedWork != null && isWorkEstimationVotingComplete()) activateWorkEstimationVotingShowoff(); updateLocalModificationTime(); }
public RequirementEstimationVote getEstimationVote(User user) { for (RequirementEstimationVote vote : getEstimationVotes()) { if (vote.isUser(user)) return vote; } return null; }
public boolean containsWorkEstimationVotes() { for (RequirementEstimationVote vote : getEstimationVotes()) { if (vote.getEstimatedWork() != null) return true; } return false; }