Skip to content

Commit 34bd419

Browse files
committed
EDX 1701 Independent school students in grade 8/9 cross enrolment collection being incorrectly flagged as already funded in authority
1 parent af40947 commit 34bd419

File tree

3 files changed

+45
-40
lines changed

3 files changed

+45
-40
lines changed

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

Lines changed: 43 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -35,26 +35,29 @@ public FteCalculationResult calculateFte(StudentRuleData studentData) {
3535
if (isJulyCollection && !isFacilityTypeSummerSchool) {
3636
FteCalculationResult fteCalculationResult = new FteCalculationResult();
3737

38-
// v93
39-
var includedInCollectionThisSchoolYearForDistrictWithNonZeroFteWithSchoolTypeNotOnline = fteCalculatorUtils.includedInCollectionThisSchoolYearForDistrictWithNonZeroFteWithSchoolTypeNotOnline(studentData);
40-
// The student was included in any collection in this school year for the district with a non-zero FTE
41-
// and was reported in any school with a type different than Online.
42-
if (includedInCollectionThisSchoolYearForDistrictWithNonZeroFteWithSchoolTypeNotOnline) {
43-
log.debug("CollectionAndFacilityTypeCalculator: FTE Zero; The district has already received funding for the student this year. :: " + studentData.getSdcSchoolCollectionStudentEntity().getSdcSchoolCollectionStudentID());
44-
fteCalculationResult.setFte(BigDecimal.ZERO);
45-
fteCalculationResult.setFteZeroReason(ZeroFteReasonCodes.DISTRICT_DUPLICATE_FUNDING.getCode());
46-
return fteCalculationResult;
47-
}
38+
if (studentData.getSchool().getIndependentAuthorityId() == null)
39+
{
40+
// v93
41+
var includedInCollectionThisSchoolYearForDistrictWithNonZeroFteWithSchoolTypeNotOnline = fteCalculatorUtils.includedInCollectionThisSchoolYearForDistrictWithNonZeroFteWithSchoolTypeNotOnline(studentData);
42+
// The student was included in any collection in this school year for the district with a non-zero FTE
43+
// and was reported in any school with a type different than Online.
44+
if (includedInCollectionThisSchoolYearForDistrictWithNonZeroFteWithSchoolTypeNotOnline) {
45+
log.debug("CollectionAndFacilityTypeCalculator: FTE Zero; The district has already received funding for the student this year. :: " + studentData.getSdcSchoolCollectionStudentEntity().getSdcSchoolCollectionStudentID());
46+
fteCalculationResult.setFte(BigDecimal.ZERO);
47+
fteCalculationResult.setFteZeroReason(ZeroFteReasonCodes.DISTRICT_DUPLICATE_FUNDING.getCode());
48+
return fteCalculationResult;
49+
}
4850

49-
// v93
50-
var includedInCollectionThisSchoolYearForDistrictWithNonZeroFteWithSchoolTypeOnlineInGradeKto9 = fteCalculatorUtils.includedInCollectionThisSchoolYearForDistrictWithNonZeroFteWithSchoolTypeOnlineInGradeKto9(studentData);
51-
// The student was included in any collection in this school year for the district with a non-zero FTE
52-
// and was reported in an Online school in grade K to 9.
53-
if (includedInCollectionThisSchoolYearForDistrictWithNonZeroFteWithSchoolTypeOnlineInGradeKto9) {
54-
log.debug("CollectionAndFacilityTypeCalculator: FTE Zero; The district has already received funding for the student this year. :: " + studentData.getSdcSchoolCollectionStudentEntity().getSdcSchoolCollectionStudentID());
55-
fteCalculationResult.setFte(BigDecimal.ZERO);
56-
fteCalculationResult.setFteZeroReason(ZeroFteReasonCodes.DISTRICT_DUPLICATE_FUNDING.getCode());
57-
return fteCalculationResult;
51+
// v93
52+
var includedInCollectionThisSchoolYearForDistrictWithNonZeroFteWithSchoolTypeOnlineInGradeKto9 = fteCalculatorUtils.includedInCollectionThisSchoolYearForDistrictWithNonZeroFteWithSchoolTypeOnlineInGradeKto9(studentData);
53+
// The student was included in any collection in this school year for the district with a non-zero FTE
54+
// and was reported in an Online school in grade K to 9.
55+
if (includedInCollectionThisSchoolYearForDistrictWithNonZeroFteWithSchoolTypeOnlineInGradeKto9) {
56+
log.debug("CollectionAndFacilityTypeCalculator: FTE Zero; The district has already received funding for the student this year. :: " + studentData.getSdcSchoolCollectionStudentEntity().getSdcSchoolCollectionStudentID());
57+
fteCalculationResult.setFte(BigDecimal.ZERO);
58+
fteCalculationResult.setFteZeroReason(ZeroFteReasonCodes.DISTRICT_DUPLICATE_FUNDING.getCode());
59+
return fteCalculationResult;
60+
}
5861
}
5962

6063
// v99
@@ -79,26 +82,28 @@ public FteCalculationResult calculateFte(StudentRuleData studentData) {
7982
return fteCalculationResult;
8083
}
8184

82-
// v103
83-
var includedInCollectionThisSchoolYearForAuthWithNonZeroFteWithSchoolTypeNotOnline = fteCalculatorUtils.includedInCollectionThisSchoolYearForAuthWithNonZeroFteWithSchoolTypeNotOnline(studentData);
84-
// The student was included in any collection in this school year for the auth with a non-zero FTE
85-
// and was reported in any school with a type different than Online.
86-
if (includedInCollectionThisSchoolYearForAuthWithNonZeroFteWithSchoolTypeNotOnline) {
87-
log.debug("CollectionAndFacilityTypeCalculator: FTE Zero; The authority has already received funding for the student this year. :: " + studentData.getSdcSchoolCollectionStudentEntity().getSdcSchoolCollectionStudentID());
88-
fteCalculationResult.setFte(BigDecimal.ZERO);
89-
fteCalculationResult.setFteZeroReason(ZeroFteReasonCodes.IND_AUTH_DUPLICATE_FUNDING.getCode());
90-
return fteCalculationResult;
91-
}
85+
if (studentData.getSchool().getIndependentAuthorityId() != null) {
86+
// v103
87+
var includedInCollectionThisSchoolYearForAuthWithNonZeroFteWithSchoolTypeNotOnline = fteCalculatorUtils.includedInCollectionThisSchoolYearForAuthWithNonZeroFteWithSchoolTypeNotOnline(studentData);
88+
// The student was included in any collection in this school year for the auth with a non-zero FTE
89+
// and was reported in any school with a type different than Online.
90+
if (includedInCollectionThisSchoolYearForAuthWithNonZeroFteWithSchoolTypeNotOnline) {
91+
log.debug("CollectionAndFacilityTypeCalculator: FTE Zero; The authority has already received funding for the student this year. :: " + studentData.getSdcSchoolCollectionStudentEntity().getSdcSchoolCollectionStudentID());
92+
fteCalculationResult.setFte(BigDecimal.ZERO);
93+
fteCalculationResult.setFteZeroReason(ZeroFteReasonCodes.IND_AUTH_DUPLICATE_FUNDING.getCode());
94+
return fteCalculationResult;
95+
}
9296

93-
// v103
94-
var includedInCollectionThisSchoolYearForAuthWithNonZeroFteWithSchoolTypeOnlineInGradeKto9 = fteCalculatorUtils.includedInCollectionThisSchoolYearForAuthWithNonZeroFteWithSchoolTypeOnlineInGradeKto9(studentData);
95-
// The student was included in any collection in this school year for the auth with a non-zero FTE
96-
// and was reported in an Online school in grade K to 9.
97-
if (includedInCollectionThisSchoolYearForAuthWithNonZeroFteWithSchoolTypeOnlineInGradeKto9) {
98-
log.debug("CollectionAndFacilityTypeCalculator: FTE Zero; The authority has already received funding for the student this year. :: " + studentData.getSdcSchoolCollectionStudentEntity().getSdcSchoolCollectionStudentID());
99-
fteCalculationResult.setFte(BigDecimal.ZERO);
100-
fteCalculationResult.setFteZeroReason(ZeroFteReasonCodes.IND_AUTH_DUPLICATE_FUNDING.getCode());
101-
return fteCalculationResult;
97+
// v103
98+
var includedInCollectionThisSchoolYearForAuthWithNonZeroFteWithSchoolTypeOnlineInGradeKto9 = fteCalculatorUtils.includedInCollectionThisSchoolYearForAuthWithNonZeroFteWithSchoolTypeOnlineInGradeKto9(studentData);
99+
// The student was included in any collection in this school year for the auth with a non-zero FTE
100+
// and was reported in an Online school in grade K to 9.
101+
if (includedInCollectionThisSchoolYearForAuthWithNonZeroFteWithSchoolTypeOnlineInGradeKto9) {
102+
log.debug("CollectionAndFacilityTypeCalculator: FTE Zero; The authority has already received funding for the student this year. :: " + studentData.getSdcSchoolCollectionStudentEntity().getSdcSchoolCollectionStudentID());
103+
fteCalculationResult.setFte(BigDecimal.ZERO);
104+
fteCalculationResult.setFteZeroReason(ZeroFteReasonCodes.IND_AUTH_DUPLICATE_FUNDING.getCode());
105+
return fteCalculationResult;
106+
}
102107
}
103108

104109
log.debug("CollectionAndFacilityTypeCalculator: No FTE result, moving to next calculation for student :: " + studentData.getSdcSchoolCollectionStudentEntity().getSdcSchoolCollectionStudentID());

api/src/main/java/ca/bc/gov/educ/studentdatacollection/api/rules/validationrules/impl/SummerStudentReportedInAuthorityRule.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public List<SdcSchoolCollectionStudentValidationIssue> executeValidation(Student
5757
log.debug("In executeValidation of SummerStudentReportedInAuthorityRule-V93 for sdcSchoolCollectionStudentID ::" + studentRuleData.getSdcSchoolCollectionStudentEntity().getSdcSchoolCollectionStudentID());
5858
final List<SdcSchoolCollectionStudentValidationIssue> errors = new ArrayList<>();
5959
validationRulesService.setupPENMatchAndEllAndGraduateValues(studentRuleData);
60-
if (studentRuleData.getSdcSchoolCollectionStudentEntity().getAssignedStudentId() != null) {
60+
if (studentRuleData.getSdcSchoolCollectionStudentEntity().getAssignedStudentId() != null && studentRuleData.getSchool().getIndependentAuthorityId() != null) {
6161
var historicalStudentCollection = validationRulesService.getStudentInHistoricalCollectionWithInSameAuthority(studentRuleData, "3");
6262
for (SdcSchoolCollectionStudentEntity studentEntity : historicalStudentCollection) {
6363
Optional<SchoolTombstone> school = restUtils.getSchoolBySchoolID(studentEntity.getSdcSchoolCollection().getSchoolID().toString());

api/src/main/java/ca/bc/gov/educ/studentdatacollection/api/rules/validationrules/impl/SummerStudentReportedInDistrictRule.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public List<SdcSchoolCollectionStudentValidationIssue> executeValidation(Student
5757
log.debug("In executeValidation of SummerStudentReportedInDistrictRule-V93 for sdcSchoolCollectionStudentID ::" + studentRuleData.getSdcSchoolCollectionStudentEntity().getSdcSchoolCollectionStudentID());
5858
final List<SdcSchoolCollectionStudentValidationIssue> errors = new ArrayList<>();
5959
validationRulesService.setupPENMatchAndEllAndGraduateValues(studentRuleData);
60-
if (studentRuleData.getSdcSchoolCollectionStudentEntity().getAssignedStudentId() != null) {
60+
if (studentRuleData.getSdcSchoolCollectionStudentEntity().getAssignedStudentId() != null && studentRuleData.getSchool().getIndependentAuthorityId() == null) {
6161
var historicalStudentCollection = validationRulesService.getStudentInHistoricalCollectionWithInSameDistrict(studentRuleData, "3");
6262
for (SdcSchoolCollectionStudentEntity studentEntity : historicalStudentCollection) {
6363
Optional<SchoolTombstone> school = restUtils.getSchoolBySchoolID(studentEntity.getSdcSchoolCollection().getSchoolID().toString());

0 commit comments

Comments
 (0)