Skip to content

Commit

Permalink
Merge pull request #2134 from bcgov/feature/postedDupes
Browse files Browse the repository at this point in the history
Added duplicates report
  • Loading branch information
SodhiA1 authored Nov 29, 2024
2 parents 0a36cb7 + 2aa9378 commit cc26afa
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 2 deletions.
3 changes: 2 additions & 1 deletion backend/src/components/ministrySDCReports.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ 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', 'online-indy-funding-report', 'non-graduated-adult-indy-funding-report',
'inclusive-education-variance-headcounts','enrolled-fte-headcounts', 'enrolment-fte-headcounts-for-ce-ol-schools', 'refugee-enrolment-fte-headcounts'];
'inclusive-education-variance-headcounts','enrolled-fte-headcounts', 'enrolment-fte-headcounts-for-ce-ol-schools', 'refugee-enrolment-fte-headcounts','posted-duplicates'];

async function getMinistrySDCReport(req, res) {
try {
Expand Down Expand Up @@ -57,6 +57,7 @@ function getFileDetails(reportType) {
'enrolled-fte-headcounts': { filename: 'EnroledHeadcountsAndFteReport.csv', contentType: 'text/csv' },
'enrolment-fte-headcounts-for-ce-ol-schools': { filename: 'EnroledHeadcountsAndFteReportForCEOLSchools.csv', contentType: 'text/csv' },
'refugee-enrolment-fte-headcounts': { filename: 'RefugeeEnroledHeadcountsAndFteReport.csv', contentType: 'text/csv' },
'posted-duplicates': { filename: 'PostedDuplicatesReport.csv', contentType: 'text/csv' },
'DEFAULT': { filename: 'download.pdf', contentType: 'application/pdf' }
};
return mappings[reportType] || mappings['DEFAULT'];
Expand Down
2 changes: 1 addition & 1 deletion backend/src/routes/ministrySDCReports.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ router.get('/public/:reportType/:collectionID', passport.authenticate('jwt', {se
router.get('/independent/:reportType/:collectionID', passport.authenticate('jwt', {session: false}, undefined), permUtils.checkUserHasPermission(PERMISSION.REPORTS_SDC_INDEPENDENT_SCHOOLS_PERMISSION), permUtils.isValidUUIDParam('collectionID'), extendSession, getMinistrySDCReport);
router.get('/headcount/:reportType/:collectionID', passport.authenticate('jwt', {session: false}, undefined), permUtils.checkUserHasPermission(PERMISSION.REPORTS_SDC_HEADCOUNTS_PERMISSION), permUtils.isValidUUIDParam('collectionID'), extendSession, getMinistrySDCReport);

router.get('/download/headcount/:reportType/:collectionID', auth.refreshJWT, permUtils.checkUserHasPermission(PERMISSION.REPORTS_SDC_HEADCOUNTS_PERMISSION), permUtils.isValidUUIDParam('collectionID'), extendSession, downloadMinistrySDCReport);
router.get('/download/headcount/:reportType/:collectionID', auth.refreshJWT, permUtils.checkUserHasPermission(PERMISSION.STUDENT_DATA_COLLECTION), permUtils.isValidUUIDParam('collectionID'), extendSession, downloadMinistrySDCReport);

module.exports = router;
15 changes: 15 additions & 0 deletions frontend/src/components/data-collection/DuplicatesPosting.vue
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,20 @@
@click="resolveRemainingDuplicates"
/>
</v-row>
<v-row>
<v-col
v-if="isPostProvincialDuplicatesButtonDisabled"
>
<router-link
id="downloadReport"
:to="{ path: postedDupesReport + collectionID}"
target="_blank"
>
<v-icon>mdi-tray-arrow-down</v-icon>
Download Posted Duplicates CSV
</router-link>
</v-col>
</v-row>
</v-col>
</v-row>

Expand Down Expand Up @@ -202,6 +216,7 @@ export default {
duplicationResolutionDueDate: null,
signoffDueDate: null
},
postedDupesReport: Routes.POSTED_DUPES_REPORT,
monitorSdcDistrictCollectionsResponse: [],
monitorSdcSchoolCollectionsResponse: [],
isPostProvincialDuplicatesButtonDisabled: false,
Expand Down
1 change: 1 addition & 0 deletions frontend/src/utils/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ let object = {
SESSION_REMAINING_TIME: authRoot + '/user-session-remaining-time',
CONFIG: baseRoot + '/config',
SDC_MINISTRY_REPORTS: ministrySDCReportsRoot,
POSTED_DUPES_REPORT: ministrySDCReportsRoot + '/download/headcount/posted-duplicates/',

digitalIdentity: {
ROOT_ENDPOINT: digitalIDRoot,
Expand Down

0 comments on commit cc26afa

Please sign in to comment.