Skip to content

Commit

Permalink
BCP call initiation now sends messages based on the role tree selected
Browse files Browse the repository at this point in the history
  • Loading branch information
AlessandroArosio committed Apr 12, 2020
1 parent 587d37d commit 19622a7
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import org.jetbrains.annotations.NotNull;
import org.springframework.stereotype.Service;
import org.wicket.calltree.dto.Response;
import org.wicket.calltree.enums.Role;
import org.wicket.calltree.model.BcpStartRequest;
import org.wicket.calltree.model.Recipient;
import org.wicket.calltree.service.TwilioService;
Expand All @@ -28,8 +27,7 @@ public class CallTreeServiceImpl implements CallTreeService {
@NotNull
@Override
public List<Response> initiateCalls(@NotNull BcpStartRequest bcpStartRequest) {
List<Recipient> recipientList = contactService.getAllContacts().stream()
.filter(c -> !c.getRole().equals(Role.CHAMPION))
List<Recipient> recipientList = contactService.getCalltreeUntilRole(bcpStartRequest.getToRoles()).stream()
.map(c -> new Recipient(new PhoneNumber(c.getPhoneNumber()), bcpStartRequest.getText()))
.collect(Collectors.toList());

Expand Down

0 comments on commit 19622a7

Please sign in to comment.