-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
146 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
src/main/java/ch/fhnw/deardevbackend/dto/TeamConfigDTO.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package ch.fhnw.deardevbackend.dto; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
|
||
import java.util.List; | ||
|
||
@Data | ||
@Builder | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
public class TeamConfigDTO { | ||
private Integer id; | ||
private String teamName; | ||
private List<WorkKindDTO> workKinds; | ||
private Boolean happinessSurvey; | ||
private Boolean workKindSurvey; | ||
private Boolean emotionSurvey; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package ch.fhnw.deardevbackend.dto; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Data | ||
@Builder | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
public class WorkKindDTO { | ||
private Integer id; | ||
private String name; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
src/main/java/ch/fhnw/deardevbackend/mapper/TeamConfigMapper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package ch.fhnw.deardevbackend.mapper; | ||
|
||
import ch.fhnw.deardevbackend.dto.TeamConfigDTO; | ||
import ch.fhnw.deardevbackend.dto.WorkKindDTO; | ||
import ch.fhnw.deardevbackend.entities.Team; | ||
import ch.fhnw.deardevbackend.entities.TeamConfig; | ||
import ch.fhnw.deardevbackend.entities.WorkKind; | ||
import org.mapstruct.Mapper; | ||
import org.mapstruct.Mapping; | ||
import org.mapstruct.factory.Mappers; | ||
|
||
import java.util.List; | ||
|
||
@Mapper(componentModel = "spring", unmappedTargetPolicy = org.mapstruct.ReportingPolicy.IGNORE) | ||
public interface TeamConfigMapper { | ||
TeamConfigMapper INSTANCE = Mappers.getMapper(TeamConfigMapper.class); | ||
|
||
@Mapping(source = "team.name", target = "teamName") | ||
@Mapping(source = "config.id", target = "id") | ||
@Mapping(source = "workKinds", target = "workKinds") | ||
@Mapping(source = "config.happinessSurvey", target = "happinessSurvey") | ||
@Mapping(source = "config.workKindSurvey", target = "workKindSurvey") | ||
@Mapping(source = "config.emotionSurvey", target = "emotionSurvey") | ||
TeamConfigDTO toTeamConfigDTO(TeamConfig config, Team team, List<WorkKindDTO> workKinds); | ||
|
||
WorkKindDTO toWorkKindDTO(WorkKind workKind); | ||
} |
9 changes: 9 additions & 0 deletions
9
src/main/java/ch/fhnw/deardevbackend/repositories/TeamConfigRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package ch.fhnw.deardevbackend.repositories; | ||
|
||
import ch.fhnw.deardevbackend.entities.TeamConfig; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
import org.springframework.stereotype.Repository; | ||
|
||
@Repository | ||
public interface TeamConfigRepository extends JpaRepository<TeamConfig, Integer> { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters