Skip to content

Commit d08b3b0

Browse files
committed
Add DISTONLINE to indy double reported fte calc
1 parent c71c4d4 commit d08b3b0

File tree

3 files changed

+27
-22
lines changed

3 files changed

+27
-22
lines changed

api/src/main/java/ca/bc/gov/educ/studentdatacollection/api/calculator/FteCalculatorUtils.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public boolean studentPreviouslyReportedInDistrict(StudentRuleData studentRuleDa
7373
}
7474
var school = studentRuleData.getSchool();
7575
var isPublicOnlineOrContEdSchool = (school.getSchoolCategoryCode().equals(SchoolCategoryCodes.PUBLIC.getCode()) &&
76-
(school.getFacilityTypeCode().equals(FacilityTypeCodes.DIST_LEARN.getCode()) || school.getFacilityTypeCode().equals(FacilityTypeCodes.DISTONLINE.getCode()))) ||
76+
(school.getFacilityTypeCode().equals(FacilityTypeCodes.DIST_LEARN.getCode()) || FacilityTypeCodes.ONLINE_SCHOOLS.contains(school.getFacilityTypeCode()))) ||
7777
school.getFacilityTypeCode().equals(FacilityTypeCodes.CONT_ED.getCode());
7878
var isStudentInDistrictFundedGrade = SchoolGradeCodes.getDistrictFundingGrades().contains(studentRuleData.getSdcSchoolCollectionStudentEntity().getEnrolledGradeCode());
7979
var assignedStudentId = studentRuleData.getSdcSchoolCollectionStudentEntity().getAssignedStudentId();
@@ -114,7 +114,7 @@ public boolean studentPreviouslyReportedInIndependentAuthority(StudentRuleData s
114114
}
115115
var student = studentRuleData.getSdcSchoolCollectionStudentEntity();
116116
var school = studentRuleData.getSchool();
117-
var isIndependentOnlineSchool = school != null && SchoolCategoryCodes.INDEPENDENTS.contains(school.getSchoolCategoryCode()) && StringUtils.equals(school.getFacilityTypeCode(), FacilityTypeCodes.DIST_LEARN.getCode());
117+
var isIndependentOnlineSchool = school != null && SchoolCategoryCodes.INDEPENDENTS.contains(school.getSchoolCategoryCode()) && FacilityTypeCodes.ONLINE_SCHOOLS.contains(school.getFacilityTypeCode());
118118
var isStudentInDistrictFundedGrade = SchoolGradeCodes.getDistrictFundingGrades().contains(student.getEnrolledGradeCode());
119119

120120
long countAllByAssignedStudentIdAndSdcSchoolCollectionSdcSchoolCollectionIDIn = 0;

api/src/main/java/ca/bc/gov/educ/studentdatacollection/api/constants/v1/FacilityTypeCodes.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
import lombok.Getter;
44

5+
import java.util.Arrays;
6+
import java.util.HashSet;
7+
import java.util.Set;
8+
59
/**
610
* The enum for school's facility type codes
711
*/
@@ -25,6 +29,7 @@ public enum FacilityTypeCodes {
2529
JUSTB4PRO("JUSTB4PRO");
2630

2731
private final String code;
32+
public static final Set<String> ONLINE_SCHOOLS = new HashSet<>(Arrays.asList(DIST_LEARN.getCode(), DISTONLINE.getCode()));
2833
FacilityTypeCodes(String code) { this.code = code; }
2934

3035
public static String[] getFacilityCodesWithoutOLAndCE(){

api/src/test/java/ca/bc/gov/educ/studentdatacollection/api/calculator/FteCalculatorUtilsTest.java

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -676,32 +676,32 @@ void studentPreviouslyReportedInIndependentAuthority_NoSchoolIdsFound_ReturnsFal
676676

677677
@ParameterizedTest
678678
@CsvSource({
679-
"HS, true",
680-
"KH, true",
681-
"KF, true",
682-
"01, true",
683-
"02, true",
684-
"03, true",
685-
"04, true",
686-
"05, true",
687-
"06, true",
688-
"07, true",
689-
"EU, true",
690-
"08, true",
691-
"09, true",
692-
"10, false",
693-
"11, false",
694-
"12, false",
695-
"SU, false",
696-
"GA, false"
679+
"HS, true, DIST_LEARN",
680+
"KH, true, DIST_LEARN",
681+
"KF, true, DIST_LEARN",
682+
"01, true, DIST_LEARN",
683+
"02, true, DIST_LEARN",
684+
"03, true, DIST_LEARN",
685+
"04, true, DIST_LEARN",
686+
"05, true, DIST_LEARN",
687+
"06, true, DIST_LEARN",
688+
"07, true, DISTONLINE",
689+
"EU, true, DISTONLINE",
690+
"08, true, DISTONLINE",
691+
"09, true, DISTONLINE",
692+
"10, false, DISTONLINE",
693+
"11, false, DISTONLINE",
694+
"12, false, DISTONLINE",
695+
"SU, false, DISTONLINE",
696+
"GA, false, DISTONLINE"
697697
})
698-
void studentPreviouslyReportedInIndependentAuthority_GivenDifferentGrades_ReturnExpectedResult(String enrolledGradeCode, boolean expectedResult) {
698+
void studentPreviouslyReportedInIndependentAuthority_GivenDifferentGrades_ReturnExpectedResult(String enrolledGradeCode, boolean expectedResult, String facilityTypeCode) {
699699
// Given
700700
StudentRuleData sdcStudentSagaData = new StudentRuleData();
701701
SchoolTombstone schoolTombstone = new SchoolTombstone();
702702
schoolTombstone.setSchoolId(UUID.randomUUID().toString());
703703
schoolTombstone.setSchoolCategoryCode("INDEPEND");
704-
schoolTombstone.setFacilityTypeCode("DIST_LEARN");
704+
schoolTombstone.setFacilityTypeCode(facilityTypeCode);
705705
schoolTombstone.setIndependentAuthorityId("AUTH_ID");
706706
sdcStudentSagaData.setSchool(schoolTombstone);
707707
SdcSchoolCollectionStudentEntity student = new SdcSchoolCollectionStudentEntity();

0 commit comments

Comments
 (0)