Skip to content

Commit

Permalink
feat/VIC-837-Admin-can-create-and-edit-team
Browse files Browse the repository at this point in the history
  • Loading branch information
adnanalicic committed Jul 24, 2022
1 parent 1640fef commit 7ee2e57
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import de.caritas.cob.userservice.api.service.appointment.AppointmentService;
import de.caritas.cob.userservice.generated.api.adapters.web.controller.UseradminApi;
import io.swagger.annotations.Api;
import java.util.ArrayList;
import java.util.List;
import javax.validation.Valid;
import javax.validation.constraints.NotNull;
Expand Down Expand Up @@ -114,12 +115,13 @@ public ResponseEntity<Void> createConsultantAgency(@PathVariable String consulta
@Override
public ResponseEntity<Void> setConsultantAgencies(String consultantId,
List<CreateConsultantAgencyDTO> agencyList) {
var notFilteredAgencyList = new ArrayList<>(agencyList);
var agencyIdsForDeletions = consultantAdminFacade.filterAgencyListForDeletion(consultantId, agencyList);
consultantAdminFacade.markConsultantAgenciesForDeletion(consultantId, agencyIdsForDeletions);
consultantAdminFacade.filterAgencyListForCreation(consultantId, agencyList);
consultantAdminFacade.prepareConsultantAgencyRelation(consultantId, agencyList);
consultantAdminFacade.completeConsultantAgencyAssigment(consultantId, agencyList);
appointmentService.syncAgencies(consultantId, agencyList);
appointmentService.syncAgencies(consultantId, notFilteredAgencyList);
return ResponseEntity.ok().build();
}

Expand Down

0 comments on commit 7ee2e57

Please sign in to comment.