Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/519 team management #559

Merged
merged 77 commits into from
Nov 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
77 commits
Select commit Hold shift + click to select a range
00f567a
begin with implementing backend of team management
Vakmeth Nov 7, 2023
3ebc850
format files
Vakmeth Nov 7, 2023
b556bc9
implement authorization flow of organisation
Vakmeth Nov 7, 2023
3d4ad10
replace organisation business service with organisation authorization…
Vakmeth Nov 7, 2023
f301fb7
implement mapper and dtos in controller
Vakmeth Nov 7, 2023
935ee39
format mapper
Vakmeth Nov 7, 2023
44d90c6
write first test to check whether controller return organisations cor…
Vakmeth Nov 7, 2023
d81bd40
implement dialog which opens on click to header section
Vakmeth Nov 7, 2023
337edbf
format newly generated dialog
Vakmeth Nov 7, 2023
9557069
fix tests by adding missing import of matdialog module
Vakmeth Nov 7, 2023
1a50a5f
fix problem of multiple dialogs opening by storing dialogRef
Vakmeth Nov 7, 2023
f4c8a81
rearrange structure of backend validation of organisations and implem…
Vakmeth Nov 8, 2023
90aa298
format new models and service
Vakmeth Nov 8, 2023
ac96a20
fix backend call by changing fetchType
Vakmeth Nov 8, 2023
0687508
fix frontend service test by inserting httpclienttesting module
Vakmeth Nov 8, 2023
4502f88
implement hidden view of team management icon if user is not part of …
Vakmeth Nov 8, 2023
fc85fbd
style teammanagement to match other dialogs
Vakmeth Nov 8, 2023
ffabeab
format components
Vakmeth Nov 8, 2023
28be409
implement submit button in form
Vakmeth Nov 8, 2023
98e6339
implement workflow to create new teams with organisations
Vakmeth Nov 8, 2023
90585fa
format new authorization service of teams
Vakmeth Nov 8, 2023
b861316
fix tests by mocking authorizationservice instead of business service…
Vakmeth Nov 8, 2023
875332e
format files and delete unnecessary console log
Vakmeth Nov 8, 2023
fbbdaee
rename test file of dialog to match convention
Vakmeth Nov 8, 2023
37ce3eb
fix test by rewriting it to unit test
Vakmeth Nov 8, 2023
ef0c117
implement workflow to edit teams
Vakmeth Nov 10, 2023
e840ecc
insert attribute into overview entities to check whether user has wri…
Vakmeth Nov 10, 2023
13dbea8
fix tests by adding writable attribute and delete wrong update test
Vakmeth Nov 10, 2023
096500a
implement edit icon and hide it if user has not write all rights
Vakmeth Nov 10, 2023
afedaf6
implement edit dialog and controller call to display organisations of…
Vakmeth Nov 10, 2023
54c206e
fix test by providing mat-dialog-data in test and delete console logs
Vakmeth Nov 10, 2023
82363d0
implement edit in frontend
Vakmeth Nov 10, 2023
dedb5d7
delete unused constant of dialog
Vakmeth Nov 10, 2023
b1d1c37
implement deleting of teams
Vakmeth Nov 10, 2023
a308893
implement logic of active and inactive teams
Vakmeth Nov 10, 2023
b1f1d99
fix delete logic of teams
Vakmeth Nov 10, 2023
a147c46
update display of report problem icon whenever option is clicked in d…
Vakmeth Nov 10, 2023
a3939ad
implement tests for team-management-dialog
Vakmeth Nov 13, 2023
2b422d0
write tests for TeamController and return created instead of ok when …
Vakmeth Nov 13, 2023
e395ef3
implement tests for team business service
Vakmeth Nov 13, 2023
9b6ab49
change order of validation statements and implement tests of validati…
Vakmeth Nov 13, 2023
2e02231
fix problem of flakey tests by checking if error message contains nee…
Vakmeth Nov 13, 2023
d406b03
implement authorization service test for team authorization service
Vakmeth Nov 13, 2023
e0bbfb9
implement new dto which holds boolean of adminAccess
Vakmeth Nov 13, 2023
4cd2275
format new dto
Vakmeth Nov 13, 2023
33d6105
fix failing backend tests by modifying tests to match new dto structure
Vakmeth Nov 13, 2023
6a4fe80
reimplement button of team-management with new style
Vakmeth Nov 13, 2023
0408576
format imports and file of application-top-bar component
Vakmeth Nov 13, 2023
86b3e39
fix tabbing problem of team management icon
Vakmeth Nov 13, 2023
bae6ab6
use subscribe of delete request to close dialog after delete has been…
Vakmeth Nov 13, 2023
be6276f
add check if team with given name already exists
Vakmeth Nov 13, 2023
f2eae75
extend method to not throw errors when editing existent team
Vakmeth Nov 13, 2023
e8d3ff1
implement tests to check if new repsitory method works
Vakmeth Nov 13, 2023
6b5980c
implement dialog which opens on click to header section
Vakmeth Nov 7, 2023
371111d
implement hidden view of team management icon if user is not part of …
Vakmeth Nov 8, 2023
4e19fc0
add tests for organisation authorization service
kcinay055679 Nov 13, 2023
173a812
add test for organisation business service
kcinay055679 Nov 13, 2023
08914e0
add organisationpersistence service
kcinay055679 Nov 13, 2023
50f14a8
fix error in shouldRemoveEmptryEntriesOfListTest
kcinay055679 Nov 13, 2023
864f293
remove not needed methods
Vakmeth Nov 13, 2023
378bf76
refactor structure
Vakmeth Nov 13, 2023
f8f620e
replace edit button with same as in check-in-history
Vakmeth Nov 14, 2023
d2fb028
implement two endpoints to get organisations and to get organisations…
Vakmeth Nov 14, 2023
9c756dc
disable button when team has inactive organisations
Vakmeth Nov 14, 2023
d7122db
implement error icon when team has inactive organisations in it
Vakmeth Nov 14, 2023
b46ed1d
implement conditional display of icons
Vakmeth Nov 14, 2023
91bbd3d
implement tests for new method in team component
Vakmeth Nov 14, 2023
d435b0f
implement missing tests for new backend operations
Vakmeth Nov 14, 2023
ea9ca65
disable call if user has no write all access
Vakmeth Nov 14, 2023
556e84f
add necesary authorization to check inactive teams in test
Vakmeth Nov 14, 2023
9024a31
implement missing tests and fix error of dublicated organisations in …
Vakmeth Nov 15, 2023
e309e1e
use replay subject to emit has admin access
Vakmeth Nov 15, 2023
ddbdb1e
make call to admin access only when given
Vakmeth Nov 15, 2023
4ab3628
change order of tests
Vakmeth Nov 15, 2023
6135240
fix header style on mobile
Vakmeth Nov 15, 2023
2eb43b0
move click event one div down
Vakmeth Nov 15, 2023
f1bc9d4
style dropdown to allign with dropdown field
Nov 16, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
package ch.puzzle.okr.controller;

import ch.puzzle.okr.dto.OrganisationDto;
import ch.puzzle.okr.mapper.OrganisationMapper;
import ch.puzzle.okr.service.authorization.OrganisationAuthorizationService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.responses.ApiResponses;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("api/v1/organisations")
public class OrganisationController {
private final OrganisationAuthorizationService organisationAuthorizationService;
private final OrganisationMapper organisationMapper;

public OrganisationController(OrganisationAuthorizationService organisationAuthorizationService,
OrganisationMapper organisationMapper) {
this.organisationAuthorizationService = organisationAuthorizationService;
this.organisationMapper = organisationMapper;
}

@Operation(summary = "Get all active Organisations", description = "Get all active Organisations")
@ApiResponses(value = {
@ApiResponse(responseCode = "200", description = "Returned all active Organisations", content = {
@Content(mediaType = "application/json", schema = @Schema(implementation = OrganisationDto.class)) }),
@ApiResponse(responseCode = "401", description = "Not authorized to read organisations", content = @Content) })
@GetMapping
public ResponseEntity<List<OrganisationDto>> getActiveOrganisations() {
return ResponseEntity.status(HttpStatus.OK).body(
organisationAuthorizationService.getEntities().stream().map(this.organisationMapper::toDto).toList());
}

@Operation(summary = "Get Organisations of team", description = "Get all Organisations of team")
@ApiResponses(value = {
@ApiResponse(responseCode = "200", description = "Returned all Organisations of team", content = {
@Content(mediaType = "application/json", schema = @Schema(implementation = OrganisationDto.class)) }),
@ApiResponse(responseCode = "401", description = "Not authorized to read organisations of team", content = @Content) })
@GetMapping("/{id}")
public ResponseEntity<List<OrganisationDto>> getOrganisationsByTeam(@PathVariable Long id) {
return ResponseEntity.status(HttpStatus.OK).body(organisationAuthorizationService.getEntitiesByTeam(id).stream()
.map(this.organisationMapper::toDto).toList());
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package ch.puzzle.okr.controller;

import ch.puzzle.okr.dto.overview.DashboardDto;
import ch.puzzle.okr.dto.overview.OverviewDto;
import ch.puzzle.okr.mapper.DashboardMapper;
import ch.puzzle.okr.mapper.OverviewMapper;
import ch.puzzle.okr.service.authorization.OverviewAuthorizationService;
import io.swagger.v3.oas.annotations.Operation;
Expand All @@ -21,12 +23,14 @@
@RequestMapping("api/v2/overview")
public class OverviewController {
private final OverviewMapper overviewMapper;
private final DashboardMapper dashboardMapper;
private final OverviewAuthorizationService overviewAuthorizationService;

public OverviewController(OverviewMapper overviewMapper,
OverviewAuthorizationService overviewAuthorizationService) {
public OverviewController(OverviewMapper overviewMapper, OverviewAuthorizationService overviewAuthorizationService,
DashboardMapper dashboardMapper) {
this.overviewMapper = overviewMapper;
this.overviewAuthorizationService = overviewAuthorizationService;
this.dashboardMapper = dashboardMapper;
}

@Operation(summary = "Get all teams and their objectives", description = "Get a List of teams with their objectives")
Expand All @@ -37,11 +41,14 @@ public OverviewController(OverviewMapper overviewMapper,
@ApiResponse(responseCode = "401", description = "Not authorized to read teams with their objectives", content = @Content),
@ApiResponse(responseCode = "404", description = "The quarter or one of the teams were not found", content = @Content) })
@GetMapping("")
public ResponseEntity<List<OverviewDto>> getOverview(
public ResponseEntity<DashboardDto> getOverview(
@RequestParam(required = false, defaultValue = "", name = "team") List<Long> teamFilter,
@RequestParam(required = false, defaultValue = "", name = "quarter") Long quarterFilter,
@RequestParam(required = false, defaultValue = "", name = "objectiveQuery") String objectiveQuery) {
return ResponseEntity.status(HttpStatus.OK).body(overviewMapper
.toDto(overviewAuthorizationService.getFilteredOverview(quarterFilter, teamFilter, objectiveQuery)));
boolean hasWriteAllAccess = overviewAuthorizationService.hasWriteAllAccess();
return ResponseEntity.status(HttpStatus.OK)
.body(dashboardMapper.toDto(overviewMapper.toDto(
overviewAuthorizationService.getFilteredOverview(quarterFilter, teamFilter, objectiveQuery)),
hasWriteAllAccess));
}
}
59 changes: 50 additions & 9 deletions backend/src/main/java/ch/puzzle/okr/controller/TeamController.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,30 @@

import ch.puzzle.okr.dto.TeamDto;
import ch.puzzle.okr.mapper.TeamMapper;
import ch.puzzle.okr.service.business.TeamBusinessService;
import ch.puzzle.okr.models.Team;
import ch.puzzle.okr.service.authorization.TeamAuthorizationService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.responses.ApiResponses;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

import java.util.List;

import static org.springframework.http.HttpStatus.OK;

@RestController
@RequestMapping("api/v2/teams")
public class TeamController {
private final TeamBusinessService teamBusinessService;
private final TeamAuthorizationService teamAuthorizationService;
private final TeamMapper teamMapper;

public TeamController(TeamBusinessService teamBusinessService, TeamMapper teamMapper) {
this.teamBusinessService = teamBusinessService;
public TeamController(TeamAuthorizationService teamAuthorizationService, TeamMapper teamMapper) {
this.teamAuthorizationService = teamAuthorizationService;
this.teamMapper = teamMapper;
}

Expand All @@ -32,6 +35,44 @@ public TeamController(TeamBusinessService teamBusinessService, TeamMapper teamMa
@Content(mediaType = "application/json", schema = @Schema(implementation = TeamDto.class)) }), })
@GetMapping
public List<TeamDto> getAllTeams(@RequestParam(value = "quarterId", required = false) Long quarterId) {
return teamBusinessService.getAllTeams().stream().map(team -> teamMapper.toDto(team, quarterId)).toList();
return teamAuthorizationService.getEntities().stream().map(team -> teamMapper.toDto(team, quarterId)).toList();
}

@Operation(summary = "Create Team", description = "Create a new Team")
@ApiResponses(value = {
@ApiResponse(responseCode = "201", description = "Created new Team", content = {
@Content(mediaType = "application/json", schema = @Schema(implementation = TeamDto.class)) }),
@ApiResponse(responseCode = "400", description = "Can't create new Team, not allowed to give an ID", content = @Content),
@ApiResponse(responseCode = "401", description = "Not authorized to create a Team", content = @Content) })
@PostMapping
public ResponseEntity<TeamDto> createTeam(
@io.swagger.v3.oas.annotations.parameters.RequestBody(description = "The Team as json to create a new Team.", required = true) @RequestBody TeamDto teamDto) {
Team createdTeam = teamAuthorizationService.createEntity(teamMapper.toTeam(teamDto));
return ResponseEntity.status(HttpStatus.CREATED).body(teamMapper.toDto(createdTeam, null));
}

@Operation(summary = "Update Team", description = "Update a Team by ID.")
@ApiResponses(value = {
@ApiResponse(responseCode = "200", description = "Updated Team in db.", content = {
@Content(mediaType = "application/json", schema = @Schema(allOf = { TeamDto.class })) }),
@ApiResponse(responseCode = "401", description = "Not authorized to update a Team", content = @Content),
@ApiResponse(responseCode = "404", description = "Did not find a Team with a specified ID to update.", content = @Content),
@ApiResponse(responseCode = "422", description = "Can't update Team since Team was updated or deleted by another user.", content = @Content) })
@PutMapping("/{id}")
public ResponseEntity<TeamDto> updateTeam(
@Parameter(description = "The ID for updating a Team.", required = true) @PathVariable long id,
@RequestBody TeamDto teamDto) {
Team updatedTeam = teamAuthorizationService.updateEntity(teamMapper.toTeam(teamDto), id);
return ResponseEntity.status(OK).body(teamMapper.toDto(updatedTeam, null));
}

@Operation(summary = "Delete Team by ID", description = "Delete Team by ID")
@ApiResponses(value = { @ApiResponse(responseCode = "200", description = "Deleted Team by ID"),
@ApiResponse(responseCode = "401", description = "Not authorized to delete an Team", content = @Content),
@ApiResponse(responseCode = "404", description = "Did not find the Team with requested ID") })
@DeleteMapping("/{id}")
public void deleteTeamById(
@Parameter(description = "The ID of an Team to delete it.", required = true) @PathVariable long id) {
teamAuthorizationService.deleteEntity(id);
}
}
6 changes: 6 additions & 0 deletions backend/src/main/java/ch/puzzle/okr/dto/OrganisationDto.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package ch.puzzle.okr.dto;

import ch.puzzle.okr.models.OrganisationState;

public record OrganisationDto(Long id, int version, String orgName, OrganisationState state) {
}
4 changes: 3 additions & 1 deletion backend/src/main/java/ch/puzzle/okr/dto/TeamDto.java
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
package ch.puzzle.okr.dto;

public record TeamDto(Long id, String name, Integer activeObjectives) {
import java.util.List;

public record TeamDto(Long id, String name, Integer activeObjectives, List<OrganisationDto> organisations) {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package ch.puzzle.okr.dto.overview;

import java.util.List;

public record DashboardDto(Boolean adminAccess, List<OverviewDto> overviews) {
}
15 changes: 15 additions & 0 deletions backend/src/main/java/ch/puzzle/okr/mapper/DashboardMapper.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package ch.puzzle.okr.mapper;

import ch.puzzle.okr.dto.overview.DashboardDto;
import ch.puzzle.okr.dto.overview.OverviewDto;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public class DashboardMapper {

public DashboardDto toDto(List<OverviewDto> overviews, Boolean adminAccess) {
return new DashboardDto(adminAccess, overviews);
}
}
19 changes: 19 additions & 0 deletions backend/src/main/java/ch/puzzle/okr/mapper/OrganisationMapper.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package ch.puzzle.okr.mapper;

import ch.puzzle.okr.dto.OrganisationDto;
import ch.puzzle.okr.models.Organisation;
import org.springframework.stereotype.Component;

@Component
public class OrganisationMapper {

public OrganisationDto toDto(Organisation organisation) {
return new OrganisationDto(organisation.getId(), organisation.getVersion(), organisation.getOrgName(),
organisation.getState());
}

public Organisation toOrganisation(OrganisationDto organisationDto) {
return Organisation.Builder.builder().withId(organisationDto.id()).withVersion(organisationDto.version())
.withOrgName(organisationDto.orgName()).withState(organisationDto.state()).build();
}
}
18 changes: 15 additions & 3 deletions backend/src/main/java/ch/puzzle/okr/mapper/TeamMapper.java
Original file line number Diff line number Diff line change
@@ -1,29 +1,41 @@
package ch.puzzle.okr.mapper;

import ch.puzzle.okr.dto.OrganisationDto;
import ch.puzzle.okr.dto.TeamDto;
import ch.puzzle.okr.models.Organisation;
import ch.puzzle.okr.models.Team;
import ch.puzzle.okr.service.business.QuarterBusinessService;
import ch.puzzle.okr.service.business.TeamBusinessService;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public class TeamMapper {

private final TeamBusinessService teamBusinessService;
private final QuarterBusinessService quarterBusinessService;
private final OrganisationMapper organisationMapper;

public TeamMapper(TeamBusinessService teamBusinessService, QuarterBusinessService quarterBusinessService) {
public TeamMapper(TeamBusinessService teamBusinessService, QuarterBusinessService quarterBusinessService,
OrganisationMapper organisationMapper) {
this.teamBusinessService = teamBusinessService;
this.quarterBusinessService = quarterBusinessService;
this.organisationMapper = organisationMapper;
}

public TeamDto toDto(Team team, Long quarterId) {
long chosenQuarterId = quarterId == null ? quarterBusinessService.getCurrentQuarter().getId() : quarterId;
Integer activeObjectives = teamBusinessService.activeObjectivesAmountOfTeam(team, chosenQuarterId);
return new TeamDto(team.getId(), team.getName(), activeObjectives);
List<OrganisationDto> organisationDTOs = team.getAuthorizationOrganisation().stream()
.map(organisationMapper::toDto).toList();
return new TeamDto(team.getId(), team.getName(), activeObjectives, organisationDTOs);
}

public Team toTeam(TeamDto teamDto) {
return Team.Builder.builder().withId(teamDto.id()).withName(teamDto.name()).build();
List<Organisation> organisations = teamDto.organisations().stream().map(organisationMapper::toOrganisation)
.toList();
return Team.Builder.builder().withId(teamDto.id()).withName(teamDto.name())
.withAuthorizationOrganisation(organisations).build();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class Organisation {
@NotBlank
private String orgName;

@ManyToMany(mappedBy = "authorizationOrganisation")
@ManyToMany(mappedBy = "authorizationOrganisation", fetch = FetchType.EAGER)
private List<Team> teams;

@Enumerated(EnumType.STRING)
Expand Down
2 changes: 1 addition & 1 deletion backend/src/main/java/ch/puzzle/okr/models/Team.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public class Team {
@Size(min = 2, max = 250, message = "Attribute name must have size between 2 and 250 characters when saving team")
private String name;

@ManyToMany
@ManyToMany(fetch = FetchType.EAGER)
@JoinTable(name = "team_organisation", joinColumns = @JoinColumn(name = "team_id"), inverseJoinColumns = @JoinColumn(name = "organisation_id"))
private List<Organisation> authorizationOrganisation;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,12 @@
import org.springframework.data.repository.CrudRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface ObjectiveRepository extends CrudRepository<Objective, Long> {

Integer countByTeamAndQuarter(Team team, Quarter quarter);

List<Objective> findObjectivesByTeamId(Long id);
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,21 @@
package ch.puzzle.okr.repository;

import ch.puzzle.okr.models.Organisation;
import ch.puzzle.okr.models.OrganisationState;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import org.springframework.data.repository.query.Param;

import java.util.List;

public interface OrganisationRepository extends CrudRepository<Organisation, Long> {

Vakmeth marked this conversation as resolved.
Show resolved Hide resolved
Organisation findByOrgName(String name);

boolean existsOrganisationByOrgName(String name);

@Query(value = "SELECT * FROM organisation LEFT JOIN team_organisation ON organisation.id=team_organisation.organisation_id WHERE team_organisation.team_id = :id", nativeQuery = true)
List<Organisation> findOrganisationsByTeamId(@Param("id") Long id);

List<Organisation> findOrganisationsByState(OrganisationState state);
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,6 @@ public interface TeamRepository extends CrudRepository<Team, Long> {
where o.org_name in (:organisationNames)
""", nativeQuery = true)
List<Long> findTeamIdsByOrganisationNames(@Param("organisationNames") List<String> organisationNames);

List<Team> findTeamsByName(String name);
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,20 +45,10 @@ public AuthorizationUser registerAuthorizationUser(User user, Jwt token) {
}

private List<Long> getTeamIds(List<String> organisationNames) {
List<Long> teamIds = teamPersistenceService.findTeamIdsByOrganisationNames(organisationNames);
if (teamIds.isEmpty()) {
throw new ResponseStatusException(UNAUTHORIZED,
"no team found for given organisations " + organisationNames);
}
return teamIds;
return teamPersistenceService.findTeamIdsByOrganisationNames(organisationNames);
}

private List<Long> getFirstLevelTeamIds() {
List<Long> teamIds = teamPersistenceService.findTeamIdsByOrganisationName(firstLevelOrganisationName);
if (teamIds.isEmpty()) {
throw new ResponseStatusException(UNAUTHORIZED,
"no team found for given organisation " + firstLevelOrganisationName);
}
return teamIds;
return teamPersistenceService.findTeamIdsByOrganisationName(firstLevelOrganisationName);
}
}
Loading
Loading