Skip to content

Commit

Permalink
Issue #85: Set SkillStatus to value received in AchievableSkillDTO
Browse files Browse the repository at this point in the history
This was previously hardcoded to always assign SkillStatus.ACHIEVED

The change in TeamSkillDTO is done to prevent a type error at
runtime. Previously the class used the SkillStatus enum generated
by jhipster and not our custom one, which is returned by the
getSkillStatus method.
  • Loading branch information
Amar-Bolkan committed Jun 13, 2022
1 parent 5c42c73 commit 6ea6f1d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
package com.iteratec.teamdojo.service.dto;

import com.iteratec.teamdojo.GeneratedByJHipster;
import com.iteratec.teamdojo.domain.enumeration.SkillStatus;
// ### MODIFICATION-START ###
import com.iteratec.teamdojo.domain.enumeration.custom.SkillStatus;
// ### MODIFICATION-END ###
import java.io.Serializable;
import java.time.Instant;
import java.util.Objects;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import com.iteratec.teamdojo.domain.Badge;
import com.iteratec.teamdojo.domain.Level;
import com.iteratec.teamdojo.domain.Team;
import com.iteratec.teamdojo.domain.enumeration.SkillStatus;
import com.iteratec.teamdojo.domain.enumeration.custom.SkillStatus;
import com.iteratec.teamdojo.repository.SkillRepository;
import com.iteratec.teamdojo.repository.TeamRepository;
import com.iteratec.teamdojo.repository.custom.CustomAchievableSkillRepository;
Expand Down Expand Up @@ -152,7 +152,7 @@ public AchievableSkillDTO updateAchievableSkill(final Long teamId, final Achieva
teamSkill.setVote((achievableSkill.getVote() != null) ? achievableSkill.getVote() : 0);
teamSkill.setVoters(achievableSkill.getVoters());
teamSkill.setIrrelevant(achievableSkill.isIrrelevant());
teamSkill.setSkillStatus(SkillStatus.ACHIEVED);
teamSkill.setSkillStatus(achievableSkill.getSkillStatus());

final var persistedTeamSkill = teamSkillService.save(teamSkill);

Expand Down

0 comments on commit 6ea6f1d

Please sign in to comment.