Skip to content

Commit

Permalink
Merge pull request #593 from bcgov/GRAD2-2821
Browse files Browse the repository at this point in the history
Grad2 2821
  • Loading branch information
suzalflueck authored Sep 12, 2024
2 parents dedca75 + 45b2380 commit eecc43e
Show file tree
Hide file tree
Showing 5 changed files with 133 additions and 25 deletions.
72 changes: 52 additions & 20 deletions frontend/src/components/Batch/Batch.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
<template>
<div>
<b-alert :show="batchTypeDesc != ''" variant="info">
{{ batchTypeDesc }}
</b-alert>
<b-alert :show="batchTypeDesc != ''" variant="info"> </b-alert>
<b-overlay :show="processingBatch">
<div class="row">
<div class="col-12 col-md-3 border-right">
Expand All @@ -20,20 +18,29 @@
>
</b-form-select>
</div>

<div class="mt-2" v-if="batch.details['what'] == 'ARC_SCH_REPORTS'">
<div class="mt-2" v-if="batch.details['what'] == 'SCHL_RPT_REGEN'">
<label class="font-weight-bold">Report Type</label>
<b-form-select
id="inline-form-select-audience"
class="mb-2 mr-sm-2 mb-sm-0 col-12"
:options="reportTypes"
:options="SCHL_RPT_REGEN_reportTypes"
value-field="code"
text-field="label"
:value="batch.details['reportType']"
@change="editBatchJob('reportType', $event)"
></b-form-select>
</div>
<div class="mt-2" v-if="batch.details['what'] == 'ARC_SCH_REPORTS'">
<b-form-select
id="inline-form-select-audience"
class="mb-2 mr-sm-2 mb-sm-0 col-12"
:options="ARC_SCH_REPORTS_reportTypes"
value-field="code"
text-field="label"
:value="batch.details['reportType']"
@change="editBatchJob('reportType', $event)"
></b-form-select>
</div>

<div class="mt-2" v-if="batch.details['what'] == 'DISTRUNUSER'">
<label class="font-weight-bold">Credential Type</label>
<b-form-select
Expand Down Expand Up @@ -224,6 +231,7 @@
batch.details['what'] != 'DISTRUN_YE' &&
batch.details['what'] != 'DISTRUN_SUPP' &&
batch.details['what'] != 'ARC_STUDENTS' &&
batch.details['what'] != 'SCHL_RPT_REGEN' &&
batch.details['what'] != 'TVR_DELETE' &&
batch.details['what'] != 'ARC_SCH_REPORTS' &&
batch.details['what'] != 'CERT_REGEN'
Expand Down Expand Up @@ -1265,7 +1273,8 @@ export default {
ARC_STUDENTS_confirm: [],
ARC_SCHOOL_REPORTS_confirm: [],
runType: "",
reportTypes: [],
ARC_SCH_REPORTS_reportTypes: [],
SCHL_RPT_REGEN_reportTypes: [],
reportType: "",
batchIsValid: false,
batchTypes: [],
Expand Down Expand Up @@ -1384,27 +1393,36 @@ export default {
value: "All Schools",
},
],
copies: true,
where: true,
},
TVR_DELETE: {
SCHL_RPT_REGEN: {
group: [
{
text: "School",
value: "School",
},
{ text: "School Category", value: "District" },
{
text: "All",
value: "All Schools",
},
],
},
TVR_DELETE: {
group: [
{
text: "Student",
value: "Student",
},
{
text: "School",
value: "School",
},
{
text: "All Students",
value: "All Students",
},
],
copies: true,
where: true,
},
},
};
Expand All @@ -1417,7 +1435,8 @@ export default {
this.transcriptTypes = this.getTranscriptTypes();
this.certificateTypes = this.getCertificateTypes();
this.batchTypes = this.getBatchJobTypes();
this.reportTypes = [
this.ARC_SCH_REPORTS_reportTypes = [
{
code: "NONGRADPRJ",
label:
Expand All @@ -1439,6 +1458,21 @@ export default {
"A daily, cumulative list of student in the current cycle who have not-yet graduated, based on the latest information submitted by the school. Produced as part of the Batch Graduation Algorithm Run.",
},
];
this.SCHL_RPT_REGEN_reportTypes = [
{
code: "NONGRADPRJ",
label: "Projected Non-Graduates - Summary Report (MM YYYY to MM YYYY)",
description:
"A list of all current students reported on a graduation program, in grade 12 or AD, who are not projected to graduate based on missing course registrations or assessment registrations. Produced as part of TVR Batch Run.",
},
{
code: "GRADREG and NONGRADREG",
label:
"Graduated Students (MM YYYY to MM YYYY) Report and Not-Yet Graduated Students (MM YYYY to MM YYYY) Report",
description:
"A daily, cumulative list of student in the current cycle who have graduated, based on the latest information submitted by the school. Produced as part of the Batch Graduation Algorithm Run.",
},
];
},
methods: {
Expand Down Expand Up @@ -1513,7 +1547,8 @@ export default {
}
}
if (
this.batch.details["what"] == "ARC_SCH_REPORTS" &&
(this.batch.details["what"] == "ARC_SCH_REPORTS" ||
this.batch.details["what"] == "SCHL_RPT_REGEN") &&
this.batch.details["reportType"] == ""
) {
this.batchIsValid = false;
Expand Down Expand Up @@ -1589,10 +1624,7 @@ export default {
);
}
this.batchTypes = this.batchTypes.map((type) => {
if (
type.code === "SCHL_RPT_REGEN" ||
type.code === "EDW_SNAPSHOT"
) {
if (type.code === "EDW_SNAPSHOT") {
type.disabled = true;
}
return type;
Expand Down
4 changes: 3 additions & 1 deletion frontend/src/components/Batch/BatchConfimInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
details.who != 'PSI' &&
details.who != 'Student' &&
details.who != 'District' &&
details.what != 'SCHL_RPT_REGEN' &&
details.what == 'ARC_STUDENTS'
"
>
Expand Down Expand Up @@ -107,7 +108,7 @@
<strong>Grad End Date: </strong>{{ details.gradDateTo }}
</li>
</ul>
<li v-if="details.categoryCode">
<li v-if="details.categoryCode && details.what != 'SCHL_RPT_REGEN'">
<strong>School Category: </strong>{{ details.categoryCode }}
</li>
<li v-if="details.psiTransmissionMode">
Expand All @@ -123,6 +124,7 @@
details.what != 'REGALG' &&
details.what != 'TVRRUN' &&
details.what != 'CERT_REGEN' &&
details.what != 'SCHL_RPT_REGEN' &&
details.what != 'ARC_STUDENTS' &&
details.what != 'TVR_DELETE' &&
details.what != 'ARC_SCH_REPORTS'
Expand Down
3 changes: 3 additions & 0 deletions frontend/src/services/BatchProcessingService.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ export default {
runDISTRUN_MONTHLY() {
return ApiService.apiAxios.get("/api/v1/batch/executedisrunbatchjob");
},
runSCHL_RPT_REGEN(request, cronTime=""){
return ApiService.apiAxios.post(`/api/v1/batch/regenerate/school-report`,request);
},
runDISTRUN_SUPP() {
return ApiService.apiAxios.get("/api/v1/batch/executesuppdisrunbatchjob");
},
Expand Down
1 change: 0 additions & 1 deletion frontend/src/store/modules/batchprocessing.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,6 @@ export const useBatchProcessingStore = defineStore("batchProcessing", {
getBatchDetailsTypeById: (state) =>{
return function(args){
return state.batchDetails[args].details['what']

}
},
getbatchDetailsGroupById: (state) =>{
Expand Down
78 changes: 75 additions & 3 deletions frontend/src/views/BatchProcessing.vue
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,9 @@
v-if="
row.item.jobType != 'TVR_DELETE' &&
row.item.jobType != 'ARC_STUDENTS' &&
row.item.jobType != 'ARC_SCH_REPORTS'
row.item.jobType !=
'ARC_SCH_REPORTS' &&
row.item.jobType != 'SCHL_RPT_REGEN'
"
>
<div class="col-12">
Expand Down Expand Up @@ -163,6 +165,8 @@
row.item.jobType != 'ARC_STUDENTS' &&
row.item.jobType !=
'ARC_SCH_REPORTS' &&
row.item.jobType !=
'SCHL_RPT_REGEN' &&
row.item.jobType != 'PSIRUN'
"
>
Expand Down Expand Up @@ -220,6 +224,8 @@
row.item.jobType != 'ARC_STUDENTS' &&
row.item.jobType !=
'ARC_SCH_REPORTS' &&
row.item.jobType !=
'SCHL_RPT_REGEN' &&
row.item.failedStudentsProcessed != 0
"
>
Expand Down Expand Up @@ -275,7 +281,8 @@
row.item.jobType != 'TVR_DELETE' &&
row.item.jobType !=
'ARC_SCH_REPORTS' &&
row.item.jobType != 'ARC_STUDENTS'
row.item.jobType != 'ARC_STUDENTS' &&
row.item.jobType != 'SCHL_RPT_REGEN'
"
>
<div class="col-9 p-2">
Expand Down Expand Up @@ -1136,6 +1143,44 @@ export default {
}
});
},
runSCHL_RPT_REGEN(request, id) {
let requestId = id.replace("job-", "");
this.$set(this.spinners, id, true);
let index = id.replace("job-", "") - 1;
let value = true;
this.setTabLoading({ index, value });
BatchProcessingService.runSCHL_RPT_REGEN(request)
.then((response) => {
this.getAdminDashboardData();
this.cancelBatchJob(id);
this.selectedTab = 0;
if (response.data) {
this.$bvToast.toast(
"Batch run " +
response.data.batchId +
" has started for request " +
requestId,
{
title: "BATCH PROCESSING STARTED",
variant: "success",
noAutoHide: true,
}
);
}
})
.catch((error) => {
if (error) {
this.getAdminDashboardData();
this.cancelBatchJob(id);
this.selectedTab = 0;
this.$bvToast.toast("This request is running in the background", {
title: "BATCH PROCESSING UPDATE",
variant: "success",
noAutoHide: true,
});
}
});
},
runCERTREGEN(request, id) {
let requestId = id.replace("job-", "");
this.$set(this.spinners, id, true);
Expand Down Expand Up @@ -1846,7 +1891,7 @@ export default {
delete request.gradDateTo;
delete request.quantity;
delete request.localDownload;
delete request.reportType;
delete request.activityCode;
if (cronTime) {
let scheduledRequest = {};
Expand All @@ -1862,6 +1907,33 @@ export default {
this.runCERTREGEN(request, id);
}
}
} else if (this.tabContent[id].details["what"] == "SCHL_RPT_REGEN") {
delete request.credentialTypeCode;
request.reportTypes = [this.tabContent[id].details["reportType"]];
if (this.tabContent[id].details["who"] == "All Schools") {
request.activityCode = "ALL";
}
if (cronTime) {
let scheduledRequest = {};
scheduledRequest.cronExpression = cronTime;
scheduledRequest.jobName = "??";
scheduledRequest.blankPayLoad = null;
scheduledRequest.payload = request;
this.addScheduledJob(scheduledRequest, id);
} else {
this.runSCHL_RPT_REGEN(request, id);
}
} else if (this.tabContent[id].details["what"] == "ARC_STUDENTS") {
if (cronTime) {
let scheduledRequest = {};
scheduledRequest.cronExpression = cronTime;
scheduledRequest.jobName = "ARCS";
scheduledRequest.blankPayLoad = null;
scheduledRequest.payload = request;
this.addScheduledJob(scheduledRequest, id);
} else {
this.runArchiveStudents(request, id);
}
} else if (this.tabContent[id].details["what"] == "ARC_STUDENTS") {
delete request.credentialTypeCode;
Expand Down

0 comments on commit eecc43e

Please sign in to comment.