Skip to content

Commit

Permalink
change handle application signed to create different entries by Parish
Browse files Browse the repository at this point in the history
  • Loading branch information
lkemperman-cfa committed Jul 11, 2024
1 parent cc2dc8b commit bfbd408
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@
import formflow.library.data.SubmissionRepositoryService;
import lombok.extern.slf4j.Slf4j;
import org.ladocuploader.app.data.TransmissionRepositoryService;
import org.ladocuploader.app.data.enums.Parish;
import org.ladocuploader.app.data.enums.TransmissionType;
import org.springframework.stereotype.Component;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Objects;

import static java.util.Collections.emptyList;
import static org.ladocuploader.app.submission.actions.SetExperimentGroups.ExperimentGroup.APPLY;
Expand Down Expand Up @@ -45,9 +47,19 @@ public void run(Submission submission) {

}

if (!transmissionRepositoryService.transmissionExists(submission, TransmissionType.ECE)) {
String parish = (String) submission.getInputData().get("parish");

TransmissionType transmissionType = null;

if (Objects.equals(parish, Parish.ORLEANS.name())){
transmissionType = TransmissionType.ECE_ORLEANS;
} else if (Objects.equals(parish, Parish.JEFFERSON.name())) {
transmissionType = TransmissionType.ECE_JEFFERSON;
}

if ((transmissionType != null) && (!transmissionRepositoryService.transmissionExists(submission, transmissionType))){
if (inExperimentGroup(APPLY.name(), submission)) {
transmissionRepositoryService.createTransmissionRecord(submission, TransmissionType.ECE);
transmissionRepositoryService.createTransmissionRecord(submission, transmissionType);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,10 @@ public static boolean inExperimentGroup(String groupName, Submission submission)
return groupName.equals(submission.getInputData().get("experimentGroup"));
}

public static boolean inParish(String parish, Submission submission){
return parish.equals(submission.getInputData().get("parish"));
}

public static String householdMemberFullName(Map<String, Object> householdMember) {
return householdMember.get("householdMemberFirstName") + " " + householdMember.get("householdMemberLastName");
}
Expand Down

0 comments on commit bfbd408

Please sign in to comment.