From b9b7397c36987386da3f397f0314c0f1b1274e0a Mon Sep 17 00:00:00 2001 From: Shaun Lum Date: Mon, 27 May 2024 11:22:53 -0700 Subject: [PATCH 1/3] validation for cert regen --- frontend/src/components/Batch/Batch.vue | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/frontend/src/components/Batch/Batch.vue b/frontend/src/components/Batch/Batch.vue index 432c4c21..e7ac3518 100644 --- a/frontend/src/components/Batch/Batch.vue +++ b/frontend/src/components/Batch/Batch.vue @@ -1756,6 +1756,13 @@ export default { } else if (student.data[0].studentStatus == "MER") { this.validationMessage = value + " is a merged student and not permitted"; + } else if ( + !student.data[0].programCompletionDate && + this.batch.details["what"] == "CERT_REGEN" + ) { + this.validationMessage = + value + + " does not have a program completion date and has not graduated"; } else { //check if student has a gradStatus let studentGradStatus = await StudentService.getGraduationStatus( From 7630192916d979b0c98584d2bacc5853c1063190 Mon Sep 17 00:00:00 2001 From: Shaun Lum Date: Mon, 27 May 2024 11:51:08 -0700 Subject: [PATCH 2/3] fixed message --- frontend/src/components/Batch/Batch.vue | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/frontend/src/components/Batch/Batch.vue b/frontend/src/components/Batch/Batch.vue index e7ac3518..529cce63 100644 --- a/frontend/src/components/Batch/Batch.vue +++ b/frontend/src/components/Batch/Batch.vue @@ -1761,8 +1761,7 @@ export default { this.batch.details["what"] == "CERT_REGEN" ) { this.validationMessage = - value + - " does not have a program completion date and has not graduated"; + "Cannot regenerate a certificate for this student - this student has not completed their program"; } else { //check if student has a gradStatus let studentGradStatus = await StudentService.getGraduationStatus( From 0f83d212be97df359ae1e3cfbd6dfdf3faa95ce3 Mon Sep 17 00:00:00 2001 From: Shaun Lum Date: Mon, 27 May 2024 13:06:08 -0700 Subject: [PATCH 3/3] fixed --- frontend/src/components/Batch/Batch.vue | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/frontend/src/components/Batch/Batch.vue b/frontend/src/components/Batch/Batch.vue index 529cce63..7d909511 100644 --- a/frontend/src/components/Batch/Batch.vue +++ b/frontend/src/components/Batch/Batch.vue @@ -1746,7 +1746,6 @@ export default { this.validating = false; } if (type == "students") { - //remove duplicates this.validating = true; if (value) { let student = await StudentService.getStudentByPen(value); @@ -1756,12 +1755,6 @@ export default { } else if (student.data[0].studentStatus == "MER") { this.validationMessage = value + " is a merged student and not permitted"; - } else if ( - !student.data[0].programCompletionDate && - this.batch.details["what"] == "CERT_REGEN" - ) { - this.validationMessage = - "Cannot regenerate a certificate for this student - this student has not completed their program"; } else { //check if student has a gradStatus let studentGradStatus = await StudentService.getGraduationStatus( @@ -1814,6 +1807,17 @@ export default { return; } } + // Students must have a program completion date if regenerating their certificate + if ( + !studentGradStatus.data.programCompletionDate && + this.batch.details["what"] == "CERT_REGEN" + ) { + this.validationMessage = + "Cannot regenerate a certificate for this student - this student has not completed their program"; + this.validating = false; + return; + } + this.addValueToTypeInBatchId({ id, type,