From fe3bd5e481546841fd89e126c2b25934744fe940 Mon Sep 17 00:00:00 2001 From: alexmcdermid Date: Wed, 11 Sep 2024 14:59:53 -0700 Subject: [PATCH 1/6] Independent Funding Reports --- backend/src/components/ministrySDCReports.js | 3 ++- frontend/src/components/data-collection/ReportSection.vue | 4 ++-- frontend/src/utils/constants.js | 4 ++++ 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/backend/src/components/ministrySDCReports.js b/backend/src/components/ministrySDCReports.js index ab81a3aa..b62f90ba 100644 --- a/backend/src/components/ministrySDCReports.js +++ b/backend/src/components/ministrySDCReports.js @@ -3,7 +3,7 @@ const { logApiError, errorResponse, getData } = require('./utils'); const config = require('../config/index'); const HttpStatus = require('http-status-codes'); let reportTypes = ['indy-inclusive-ed-enrollment-headcounts', 'school-enrollment-headcounts', 'indy-school-enrollment-headcounts', 'school-address-report', 'fsa-registration-report', - 'offshore-enrollment-headcounts', 'offshore-languages-headcounts', 'indy-inclusive-ed-funding-headcounts', 'inclusive-education-variance-headcounts']; + 'offshore-enrollment-headcounts', 'offshore-languages-headcounts', 'indy-inclusive-ed-funding-headcounts', 'indy-funding-report']; async function getMinistrySDCReport(req, res) { try { @@ -50,6 +50,7 @@ function getFileDetails(reportType) { 'offshore-enrollment-headcounts': { filename: 'OffshoreSchoolsHeadcounts.csv', contentType: 'text/csv' }, 'offshore-languages-headcounts': { filename: 'OffshoreSpokenLanguageHeadcounts.csv', contentType: 'text/csv' }, 'indy-inclusive-ed-funding-headcounts': { filename: 'IndependentSchoolsInclusiveEdFundingHeadcounts.csv', contentType: 'text/csv' }, + 'indy-funding-report': { filename: 'IndependentSchoolsFundingReport.csv', contentType: 'text/csv' }, 'DEFAULT': { filename: 'download.pdf', contentType: 'application/pdf' } }; return mappings[reportType] || mappings['DEFAULT']; diff --git a/frontend/src/components/data-collection/ReportSection.vue b/frontend/src/components/data-collection/ReportSection.vue index 439de3b2..fce9b294 100644 --- a/frontend/src/components/data-collection/ReportSection.vue +++ b/frontend/src/components/data-collection/ReportSection.vue @@ -28,7 +28,7 @@ @@ -49,7 +49,7 @@ - + Date: Thu, 12 Sep 2024 15:53:35 -0700 Subject: [PATCH 2/6] other indy funding report constants --- backend/src/components/ministrySDCReports.js | 6 ++++-- frontend/src/utils/constants.js | 10 +++++++++- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/backend/src/components/ministrySDCReports.js b/backend/src/components/ministrySDCReports.js index b62f90ba..8041bb3f 100644 --- a/backend/src/components/ministrySDCReports.js +++ b/backend/src/components/ministrySDCReports.js @@ -3,7 +3,7 @@ const { logApiError, errorResponse, getData } = require('./utils'); const config = require('../config/index'); const HttpStatus = require('http-status-codes'); let reportTypes = ['indy-inclusive-ed-enrollment-headcounts', 'school-enrollment-headcounts', 'indy-school-enrollment-headcounts', 'school-address-report', 'fsa-registration-report', - 'offshore-enrollment-headcounts', 'offshore-languages-headcounts', 'indy-inclusive-ed-funding-headcounts', 'indy-funding-report']; + 'offshore-enrollment-headcounts', 'offshore-languages-headcounts', 'indy-inclusive-ed-funding-headcounts', 'indy-funding-report', 'online-indy-funding-report', 'non-graduated-adult-indy-funding-report']; async function getMinistrySDCReport(req, res) { try { @@ -50,7 +50,9 @@ function getFileDetails(reportType) { 'offshore-enrollment-headcounts': { filename: 'OffshoreSchoolsHeadcounts.csv', contentType: 'text/csv' }, 'offshore-languages-headcounts': { filename: 'OffshoreSpokenLanguageHeadcounts.csv', contentType: 'text/csv' }, 'indy-inclusive-ed-funding-headcounts': { filename: 'IndependentSchoolsInclusiveEdFundingHeadcounts.csv', contentType: 'text/csv' }, - 'indy-funding-report': { filename: 'IndependentSchoolsFundingReport.csv', contentType: 'text/csv' }, + 'indy-funding-report': { filename: 'IndependentSchoolsFundingReportStandardStudent.csv', contentType: 'text/csv' }, + 'online-indy-funding-report': { filename: 'IndependentSchoolsFundingReportOnlineLearning.csv', contentType: 'text/csv' }, + 'non-graduated-adult-indy-funding-report': { filename: 'IndependentSchoolsFundingReportNonGraduatedAdult.csv', contentType: 'text/csv' }, 'DEFAULT': { filename: 'download.pdf', contentType: 'application/pdf' } }; return mappings[reportType] || mappings['DEFAULT']; diff --git a/frontend/src/utils/constants.js b/frontend/src/utils/constants.js index 6ccc3ded..1518eb96 100644 --- a/frontend/src/utils/constants.js +++ b/frontend/src/utils/constants.js @@ -446,9 +446,17 @@ export const SDC_REPORTS = Object.freeze( reportID: 'INCLUSIVE_EDUCATION_VARIANCE', }, { - label: 'Independent School Funding Report', + label: 'Independent School Funding Report - Standard Student', csvDownloadURL: object.SDC_MINISTRY_REPORTS + '/download/headcount/indy-funding-report/' }, + { + label: 'Independent School Funding Report - Online Learning', + csvDownloadURL: object.SDC_MINISTRY_REPORTS + '/download/headcount/online-indy-funding-report/' + }, + { + label: 'Independent School Funding Report - Non Graduated Adult', + csvDownloadURL: object.SDC_MINISTRY_REPORTS + '/download/headcount/non-graduated-adult-indy-funding-report/' + }, ] } ); From 7d50b037d7f30decef198d1d0b97947d96bcf2d7 Mon Sep 17 00:00:00 2001 From: alexmcdermid Date: Fri, 13 Sep 2024 11:39:55 -0700 Subject: [PATCH 3/6] remove funding filters from all student reports --- frontend/src/utils/sdc/collectionTableConfiguration.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/frontend/src/utils/sdc/collectionTableConfiguration.js b/frontend/src/utils/sdc/collectionTableConfiguration.js index 69511f85..50143614 100644 --- a/frontend/src/utils/sdc/collectionTableConfiguration.js +++ b/frontend/src/utils/sdc/collectionTableConfiguration.js @@ -968,7 +968,6 @@ export const FTE_DISTRICT = Object.freeze( { title: 'Grade Enrolment & FTE per School', endpoint:'grade-enrollment'} ], allowedFilters: { - warnings: WARNING_FILTER, studentType: STUDENT_TYPE_FILTER, fte: FTE_FILTER, grade: GRADE_FILTER, @@ -1064,7 +1063,6 @@ export const FTE_SCHOOL = Object.freeze( { title: 'Grade Enrolment & FTE per School', endpoint:'grade-enrollment'} ], allowedFilters: { - warnings: WARNING_FILTER, studentType: STUDENT_TYPE_FILTER, fte: FTE_FILTER, grade: GRADE_FILTER, From 44f5a47c3ee3d3ab2d1c8cb5b742b4fd5b9cd6b4 Mon Sep 17 00:00:00 2001 From: alexmcdermid Date: Fri, 13 Sep 2024 12:31:14 -0700 Subject: [PATCH 4/6] default filter for all students dis/indy reports to only show students with no warns and not deleted --- backend/src/components/sdc/sdc.js | 6 ++++-- frontend/src/utils/sdc/collectionTableConfiguration.js | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/backend/src/components/sdc/sdc.js b/backend/src/components/sdc/sdc.js index 42f07ce1..d0aec7b6 100644 --- a/backend/src/components/sdc/sdc.js +++ b/backend/src/components/sdc/sdc.js @@ -281,7 +281,7 @@ async function getSDCSchoolCollectionStudentPaginatedSlice(req, res) { if (e?.status === 404) { res.status(HttpStatus.OK).json(null); } else { - await logApiError(e, 'Error getting sdc school collection student paginated list'); + await logApiError(e, 'Error getting sdc school collection student paginated slice list'); return errorResponse(res); } } @@ -310,7 +310,9 @@ function createSchoolOrDistrictCriteria(searchParams) { function createTabFilter(searchParams) { let searchCriteriaList = []; let tableKey = 'sdcStudentEnrolledProgramEntities.enrolledProgramCode'; - + if (searchParams.label === 'NO_WARN') { + searchCriteriaList.push({ key: 'sdcSchoolCollectionStudentStatusCode', operation: FILTER_OPERATION.NONE_IN, value: 'FUNDWARN,INFOWARN,ERROR,DELETED', valueType: VALUE_TYPE.STRING, condition: CONDITION.AND }); + } if (searchParams.label === 'FRENCH_PR') { searchCriteriaList.push({ key: tableKey, operation: FILTER_OPERATION.IN, value: '05,08,11,14', valueType: VALUE_TYPE.STRING, condition: CONDITION.AND }); } diff --git a/frontend/src/utils/sdc/collectionTableConfiguration.js b/frontend/src/utils/sdc/collectionTableConfiguration.js index 50143614..cc763fe8 100644 --- a/frontend/src/utils/sdc/collectionTableConfiguration.js +++ b/frontend/src/utils/sdc/collectionTableConfiguration.js @@ -949,6 +949,7 @@ export const FTE = Object.freeze( export const FTE_DISTRICT = Object.freeze( { + defaultFilter: { label: 'NO_WARN', description: 'Student has no warnings and is not deleted' }, tableHeaders: [ { title: 'District', key: 'districtName' }, { title: 'School', key: 'schoolName' }, @@ -1045,6 +1046,7 @@ export const FTE_DISTRICT = Object.freeze( export const FTE_SCHOOL = Object.freeze( { + defaultFilter: { label: 'NO_WARN', description: 'Student has no warnings and is not deleted' }, tableHeaders: [ { title: 'School', key: 'schoolName' }, { title: 'Assigned PEN', key: 'assignedPen', subHeader: { title: 'Local ID', key: 'localID' } }, From 3f5dc8cea4068872d3c20274d74f8720a2ec9dd0 Mon Sep 17 00:00:00 2001 From: alexmcdermid Date: Fri, 13 Sep 2024 14:08:16 -0700 Subject: [PATCH 5/6] change to only not deleted --- backend/src/components/sdc/sdc.js | 4 ++-- frontend/src/utils/sdc/collectionTableConfiguration.js | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/backend/src/components/sdc/sdc.js b/backend/src/components/sdc/sdc.js index d0aec7b6..c966c0f7 100644 --- a/backend/src/components/sdc/sdc.js +++ b/backend/src/components/sdc/sdc.js @@ -310,8 +310,8 @@ function createSchoolOrDistrictCriteria(searchParams) { function createTabFilter(searchParams) { let searchCriteriaList = []; let tableKey = 'sdcStudentEnrolledProgramEntities.enrolledProgramCode'; - if (searchParams.label === 'NO_WARN') { - searchCriteriaList.push({ key: 'sdcSchoolCollectionStudentStatusCode', operation: FILTER_OPERATION.NONE_IN, value: 'FUNDWARN,INFOWARN,ERROR,DELETED', valueType: VALUE_TYPE.STRING, condition: CONDITION.AND }); + if (searchParams.label === 'NOT_DELETED') { + searchCriteriaList.push({ key: 'sdcSchoolCollectionStudentStatusCode', operation: FILTER_OPERATION.NOT_IN, value: 'DELETED', valueType: VALUE_TYPE.STRING, condition: CONDITION.AND }); } if (searchParams.label === 'FRENCH_PR') { searchCriteriaList.push({ key: tableKey, operation: FILTER_OPERATION.IN, value: '05,08,11,14', valueType: VALUE_TYPE.STRING, condition: CONDITION.AND }); diff --git a/frontend/src/utils/sdc/collectionTableConfiguration.js b/frontend/src/utils/sdc/collectionTableConfiguration.js index cc763fe8..2ef48b9b 100644 --- a/frontend/src/utils/sdc/collectionTableConfiguration.js +++ b/frontend/src/utils/sdc/collectionTableConfiguration.js @@ -949,8 +949,9 @@ export const FTE = Object.freeze( export const FTE_DISTRICT = Object.freeze( { - defaultFilter: { label: 'NO_WARN', description: 'Student has no warnings and is not deleted' }, + defaultFilter: { label: 'NOT_DELETED', description: 'Student is not deleted' }, tableHeaders: [ + { key: 'sdcSchoolCollectionStudentStatusCode' }, { title: 'District', key: 'districtName' }, { title: 'School', key: 'schoolName' }, { title: 'Assigned PEN', key: 'assignedPen', subHeader: { title: 'Local ID', key: 'localID' } }, @@ -1046,8 +1047,9 @@ export const FTE_DISTRICT = Object.freeze( export const FTE_SCHOOL = Object.freeze( { - defaultFilter: { label: 'NO_WARN', description: 'Student has no warnings and is not deleted' }, + defaultFilter: { label: 'NOT_DELETED', description: 'Student is not deleted' }, tableHeaders: [ + { key: 'sdcSchoolCollectionStudentStatusCode' }, { title: 'School', key: 'schoolName' }, { title: 'Assigned PEN', key: 'assignedPen', subHeader: { title: 'Local ID', key: 'localID' } }, { title: 'Legal Surname, Given (Middle)', key: 'legalName', subHeader: { title: 'Usual Surname, Given (Middle)', key: 'usualName' } }, From 0f11fe69b2d1aee22a3441c8a22e00353e76de8e Mon Sep 17 00:00:00 2001 From: alexmcdermid Date: Fri, 13 Sep 2024 14:37:50 -0700 Subject: [PATCH 6/6] allow warn filters for reports --- .../utils/sdc/collectionTableConfiguration.js | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/frontend/src/utils/sdc/collectionTableConfiguration.js b/frontend/src/utils/sdc/collectionTableConfiguration.js index 2ef48b9b..5c4af829 100644 --- a/frontend/src/utils/sdc/collectionTableConfiguration.js +++ b/frontend/src/utils/sdc/collectionTableConfiguration.js @@ -33,6 +33,32 @@ export const WARNING_FILTER = Object.freeze( } ); +export const WARNING_FILTER_REPORTS = Object.freeze( + { + heading: 'Student Status', + id: 'warnings', + multiple: true, + key: 'warnings', + filterOptions: [ + { + title: 'Has Funding Warnings', + id: 'hasFundingWarning', + value: 'FUNDWARN' + }, + { + title: 'Has Info Warnings', + id: 'hasInfoWarning', + value: 'INFOWARN' + }, + { + title: 'Has Errors', + id: 'hasErrors', + value: 'ERROR' + } + ] + } +); + export const STUDENT_TYPE_FILTER = Object.freeze( { heading: 'Student Type', @@ -970,6 +996,7 @@ export const FTE_DISTRICT = Object.freeze( { title: 'Grade Enrolment & FTE per School', endpoint:'grade-enrollment'} ], allowedFilters: { + warnings: WARNING_FILTER_REPORTS, studentType: STUDENT_TYPE_FILTER, fte: FTE_FILTER, grade: GRADE_FILTER, @@ -1067,6 +1094,7 @@ export const FTE_SCHOOL = Object.freeze( { title: 'Grade Enrolment & FTE per School', endpoint:'grade-enrollment'} ], allowedFilters: { + warnings: WARNING_FILTER_REPORTS, studentType: STUDENT_TYPE_FILTER, fte: FTE_FILTER, grade: GRADE_FILTER,