Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sped revision #1524

Merged
merged 1 commit into from
Jan 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public FteCalculationResult processFteCalculator(StudentRuleData studentRuleData
String collectionType = student.getSdcSchoolCollection().getCollectionEntity().getCollectionTypeCode();
String facilityType = studentRuleData.getSchool().getFacilityTypeCode();
var onlineFacilityCodes = Arrays.asList(FacilityTypeCodes.DISTONLINE.getCode(), FacilityTypeCodes.DIST_LEARN.getCode());
var historicalIndyStudents = validationRulesService.findIndyStudentInCurrentFiscal(studentRuleData, "8", studentRuleData.getSchool().getIndependentAuthorityId());
var historicalStudents = validationRulesService.findStudentInCurrentFiscal(studentRuleData, "1");

for (int i = 0; i < fteCalculators.size() - 1; i++) {
FteCalculator currentCalculator = fteCalculators.get(i);
Expand All @@ -44,8 +44,8 @@ public FteCalculationResult processFteCalculator(StudentRuleData studentRuleData
if(SchoolCategoryCodes.INDEPENDENTS.contains(studentRuleData.getSchool().getSchoolCategoryCode())
&& student.getFte() != null
&& collectionType.equalsIgnoreCase(CollectionTypeCodes.FEBRUARY.getTypeCode()) && onlineFacilityCodes.contains(facilityType)
&& (historicalIndyStudents.isEmpty()
|| historicalIndyStudents.stream().noneMatch(stu -> stu.getFte().compareTo(BigDecimal.ZERO) > 0))
&& (historicalStudents.isEmpty()
|| historicalStudents.stream().noneMatch(stu -> stu.getFte().compareTo(BigDecimal.ZERO) > 0))
&& student.getFte().compareTo(BigDecimal.ZERO) == 0) {
log.debug("ProgramEligibilityBaseRule - SpecialEducationProgramsRule: CollectionTypeCodes - {}, facilityType - {}, for sdcSchoolCollectionStudentID :: {}", collectionType, facilityType, studentRuleData.getSdcSchoolCollectionStudentEntity().getSdcSchoolCollectionStudentID());
studentRuleData.getSdcSchoolCollectionStudentEntity().setSpecialEducationNonEligReasonCode(ProgramEligibilityIssueCode.FEB_ONLINE_WITH_HISTORICAL_FUNDING.getCode());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1150,11 +1150,10 @@ NOT IN (SELECT saga.sdcSchoolCollectionStudentID FROM SdcSagaEntity saga WHERE s
AND SSCS.assignedStudentId in :assignedStudentIDs
AND C.collectionID != :collectionID
AND SSCS.sdcSchoolCollectionStudentStatusCode != 'DELETED'
AND SSC.sdcDistrictCollectionID IS null
AND C.collectionID IN
(SELECT CE.collectionID FROM CollectionEntity CE WHERE CE.collectionStatusCode = 'COMPLETED' AND CE.snapshotDate < :snapshotDate ORDER BY CE.snapshotDate DESC LIMIT :noOfCollections)
""")
List<SdcSchoolCollectionStudentEntity> findIndyStudentInCurrentFiscal(List<UUID> assignedStudentIDs, String noOfCollections, UUID collectionID, LocalDate snapshotDate);
List<SdcSchoolCollectionStudentEntity> findStudentInCurrentFiscal(List<UUID> assignedStudentIDs, String noOfCollections, UUID collectionID, LocalDate snapshotDate);



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public List<ProgramEligibilityIssueCode> executeValidation(StudentRuleData stude
Boolean isGA = SchoolGradeCodes.GRADUATED_ADULT.getCode().equals(student.getEnrolledGradeCode());
String collectionType = student.getSdcSchoolCollection().getCollectionEntity().getCollectionTypeCode();
String facilityType = studentRuleData.getSchool().getFacilityTypeCode();
var historicalIndyStudents = validationRulesService.findIndyStudentInCurrentFiscal(studentRuleData, "8", studentRuleData.getSchool().getIndependentAuthorityId());
var historicalStudents = validationRulesService.findStudentInCurrentFiscal(studentRuleData, "1");

if (StringUtils.isEmpty(student.getSpecialEducationCategoryCode()) || !activeSpecialEdPrograms.contains(student.getSpecialEducationCategoryCode())) {
log.debug("ProgramEligibilityBaseRule - SpecialEducationProgramsRule: Sped code value - {} for sdcSchoolCollectionStudentID :: {}", student.getSpecialEducationCategoryCode(), studentRuleData.getSdcSchoolCollectionStudentEntity().getSdcSchoolCollectionStudentID());
Expand All @@ -71,8 +71,8 @@ public List<ProgramEligibilityIssueCode> executeValidation(StudentRuleData stude
} else if(SchoolCategoryCodes.INDEPENDENTS.contains(studentRuleData.getSchool().getSchoolCategoryCode())
&& student.getFte() != null && collectionType.equalsIgnoreCase(CollectionTypeCodes.FEBRUARY.getTypeCode())
&& onlineFacilityCodes.contains(facilityType) &&
(historicalIndyStudents.isEmpty()
|| historicalIndyStudents.stream().noneMatch(stu -> stu.getFte().compareTo(BigDecimal.ZERO) > 0))
(historicalStudents.isEmpty()
|| historicalStudents.stream().noneMatch(stu -> stu.getFte().compareTo(BigDecimal.ZERO) > 0))
&& student.getFte().compareTo(BigDecimal.ZERO) == 0) {
log.debug("ProgramEligibilityBaseRule - SpecialEducationProgramsRule: CollectionTypeCodes - {}, facilityType - {}, for sdcSchoolCollectionStudentID :: {}", collectionType, facilityType, studentRuleData.getSdcSchoolCollectionStudentEntity().getSdcSchoolCollectionStudentID());
errors.add(ProgramEligibilityIssueCode.FEB_ONLINE_WITH_HISTORICAL_FUNDING);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,15 +187,10 @@ public List<SdcSchoolCollectionStudentEntity> getStudentInHistoricalCollectionWi
return sdcSchoolStudentRepository.findStudentInCurrentFiscalWithInSameDistrict(UUID.fromString(studentRuleData.getSchool().getDistrictId()), studentRuleData.getHistoricStudentIds(), noOfCollectionsForLookup, collection.getCollectionID(), collection.getSnapshotDate());
}

public List<SdcSchoolCollectionStudentEntity> findIndyStudentInCurrentFiscal(StudentRuleData studentRuleData, String noOfCollectionsForLookup, String independentAuthorityId) {
if(independentAuthorityId != null) {
setupMergedStudentIdValues(studentRuleData);
var collection = studentRuleData.getSdcSchoolCollectionStudentEntity().getSdcSchoolCollection().getCollectionEntity();
var studentsInIndyInSept = sdcSchoolStudentRepository.findIndyStudentInCurrentFiscal(studentRuleData.getHistoricStudentIds(), noOfCollectionsForLookup, collection.getCollectionID(), collection.getSnapshotDate());
var schoolIDs = restUtils.getSchoolIDsByIndependentAuthorityID(independentAuthorityId);
return schoolIDs.map(uuids -> studentsInIndyInSept.stream().filter(student -> uuids.contains(student.getSdcSchoolCollection().getSchoolID())).toList()).orElse(Collections.emptyList());
}
return Collections.emptyList();
public List<SdcSchoolCollectionStudentEntity> findStudentInCurrentFiscal(StudentRuleData studentRuleData, String noOfCollectionsForLookup) {
setupMergedStudentIdValues(studentRuleData);
var collection = studentRuleData.getSdcSchoolCollectionStudentEntity().getSdcSchoolCollection().getCollectionEntity();
return sdcSchoolStudentRepository.findStudentInCurrentFiscal(studentRuleData.getHistoricStudentIds(), noOfCollectionsForLookup, collection.getCollectionID(), collection.getSnapshotDate());
}

public List<SdcSchoolCollectionStudentEntity> getStudentInHistoricalCollectionInAllDistrict(StudentRuleData studentRuleData) {
Expand Down
Loading