From 2145e580dbd3636a09fec096df24ec2d78c3fb4c Mon Sep 17 00:00:00 2001 From: arybakov Date: Mon, 24 Jun 2024 10:54:36 -0600 Subject: [PATCH 1/8] GRAD2-2799-P3 GRAD Incident: REGALG is creating SCCP certificates for students with future completion dates- edit summary P3 GRAD Incident: REGALG is creating SCCP certificates for students with future completion dates --- .../util/EducGradBatchGraduationApiUtils.java | 7 +++++-- .../batchgraduation/util/GradLocalDateDeserializer.java | 3 ++- .../util/GradLocalDateTimeDeserializer.java | 3 ++- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/api/src/main/java/ca/bc/gov/educ/api/batchgraduation/util/EducGradBatchGraduationApiUtils.java b/api/src/main/java/ca/bc/gov/educ/api/batchgraduation/util/EducGradBatchGraduationApiUtils.java index 6ff88cf3..6ec0f7fb 100644 --- a/api/src/main/java/ca/bc/gov/educ/api/batchgraduation/util/EducGradBatchGraduationApiUtils.java +++ b/api/src/main/java/ca/bc/gov/educ/api/batchgraduation/util/EducGradBatchGraduationApiUtils.java @@ -1,6 +1,5 @@ package ca.bc.gov.educ.api.batchgraduation.util; -import ca.bc.gov.educ.api.batchgraduation.service.GradService; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.http.HttpHeaders; @@ -11,6 +10,7 @@ import java.text.SimpleDateFormat; import java.time.LocalDate; import java.time.Period; +import java.util.Calendar; import java.util.Date; public class EducGradBatchGraduationApiUtils { @@ -67,7 +67,10 @@ public static Date parsingTraxDate(String sessionDate) { } catch (ParseException pe) { logger.error(ERROR_MSG,pe.getMessage()); } - return sDate; + Calendar cal = Calendar.getInstance(); + cal.setTime(sDate); + cal.set(Calendar.DAY_OF_MONTH, cal.getActualMaximum(Calendar.DAY_OF_MONTH)); + return cal.getTime(); } public static int getDifferenceInDays(String date1, String date2) { diff --git a/api/src/main/java/ca/bc/gov/educ/api/batchgraduation/util/GradLocalDateDeserializer.java b/api/src/main/java/ca/bc/gov/educ/api/batchgraduation/util/GradLocalDateDeserializer.java index c31e738d..268a9f80 100644 --- a/api/src/main/java/ca/bc/gov/educ/api/batchgraduation/util/GradLocalDateDeserializer.java +++ b/api/src/main/java/ca/bc/gov/educ/api/batchgraduation/util/GradLocalDateDeserializer.java @@ -11,6 +11,7 @@ import java.time.LocalDate; import java.time.ZoneId; import java.time.format.DateTimeFormatter; +import java.time.temporal.TemporalAdjusters; import static ca.bc.gov.educ.api.batchgraduation.util.EducGradBatchGraduationApiConstants.SECOND_DEFAULT_DATE_FORMAT; @@ -34,7 +35,7 @@ public LocalDate deserialize(JsonParser jsonParser, DeserializationContext deser if(slashCount > 0) { formatter = DateTimeFormatter.ofPattern(SECOND_DEFAULT_DATE_FORMAT); } - return LocalDate.parse(dateAsString, formatter); + return LocalDate.parse(dateAsString, formatter).with(TemporalAdjusters.lastDayOfMonth()); } else if(jsonParser.hasToken(JsonToken.VALUE_NUMBER_INT)) { long timestamp = jsonParser.getValueAsLong(); return LocalDate.ofInstant(Instant.ofEpochMilli(timestamp), ZoneId.systemDefault()); diff --git a/api/src/main/java/ca/bc/gov/educ/api/batchgraduation/util/GradLocalDateTimeDeserializer.java b/api/src/main/java/ca/bc/gov/educ/api/batchgraduation/util/GradLocalDateTimeDeserializer.java index fd569f73..ec3bd6fd 100644 --- a/api/src/main/java/ca/bc/gov/educ/api/batchgraduation/util/GradLocalDateTimeDeserializer.java +++ b/api/src/main/java/ca/bc/gov/educ/api/batchgraduation/util/GradLocalDateTimeDeserializer.java @@ -12,6 +12,7 @@ import java.time.LocalDateTime; import java.time.ZoneId; import java.time.format.DateTimeFormatter; +import java.time.temporal.TemporalAdjusters; import static ca.bc.gov.educ.api.batchgraduation.util.EducGradBatchGraduationApiConstants.*; @@ -35,7 +36,7 @@ public LocalDateTime deserialize(JsonParser jsonParser, DeserializationContext d if(slashCount > 0) { formatter = DateTimeFormatter.ofPattern(SECOND_DEFAULT_DATE_FORMAT); } - return LocalDateTime.parse(dateAsString, formatter); + return LocalDateTime.parse(dateAsString, formatter).with(TemporalAdjusters.lastDayOfMonth()); } else if(jsonParser.hasToken(JsonToken.VALUE_NUMBER_INT)) { long timestamp = jsonParser.getValueAsLong(); return LocalDateTime.ofInstant(Instant.ofEpochMilli(timestamp), ZoneId.systemDefault()); From 432807a90d0f53791a082967b645d69ed02b3e35 Mon Sep 17 00:00:00 2001 From: arybakov Date: Mon, 24 Jun 2024 13:06:35 -0600 Subject: [PATCH 2/8] GRAD2-2799-P3 GRAD Incident: REGALG is creating SCCP certificates for students with future completion dates- edit summary P3 GRAD Incident: REGALG is creating SCCP certificates for students with future completion dates --- .../util/EducGradBatchGraduationApiUtils.java | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/api/src/main/java/ca/bc/gov/educ/api/batchgraduation/util/EducGradBatchGraduationApiUtils.java b/api/src/main/java/ca/bc/gov/educ/api/batchgraduation/util/EducGradBatchGraduationApiUtils.java index 6ec0f7fb..708f45f8 100644 --- a/api/src/main/java/ca/bc/gov/educ/api/batchgraduation/util/EducGradBatchGraduationApiUtils.java +++ b/api/src/main/java/ca/bc/gov/educ/api/batchgraduation/util/EducGradBatchGraduationApiUtils.java @@ -63,14 +63,11 @@ public static Date parsingTraxDate(String sessionDate) { try { temp = EducGradBatchGraduationApiUtils.parseDate(actualSessionDate, EducGradBatchGraduationApiConstants.DATE_FORMAT); String sDates = EducGradBatchGraduationApiUtils.formatDate(temp, EducGradBatchGraduationApiConstants.DEFAULT_DATE_FORMAT); - sDate = EducGradBatchGraduationApiUtils.parseDate(sDates, EducGradBatchGraduationApiConstants.DEFAULT_DATE_FORMAT); + sDate = toLastDayOfMonth(EducGradBatchGraduationApiUtils.parseDate(sDates, EducGradBatchGraduationApiConstants.DEFAULT_DATE_FORMAT)); } catch (ParseException pe) { logger.error(ERROR_MSG,pe.getMessage()); } - Calendar cal = Calendar.getInstance(); - cal.setTime(sDate); - cal.set(Calendar.DAY_OF_MONTH, cal.getActualMaximum(Calendar.DAY_OF_MONTH)); - return cal.getTime(); + return sDate; } public static int getDifferenceInDays(String date1, String date2) { @@ -91,5 +88,12 @@ public static String getProgramCompletionDate(Date pcd) { DateFormat dateFormat = new SimpleDateFormat(EducGradBatchGraduationApiConstants.DEFAULT_DATE_FORMAT); return dateFormat.format(pcd); } + + private static Date toLastDayOfMonth(Date date) { + Calendar cal = Calendar.getInstance(); + cal.setTime(date); + cal.set(Calendar.DAY_OF_MONTH, cal.getActualMaximum(Calendar.DAY_OF_MONTH)); + return cal.getTime(); + } } From e67dd43ab172bc2614bd34d95cecee44e2e1de2c Mon Sep 17 00:00:00 2001 From: "chris.ditcher" Date: Wed, 26 Jun 2024 13:50:17 -0700 Subject: [PATCH 3/8] Updated to Ubuntu 22.04 --- .github/workflows/build.from.developer.branch.deploy.to.dev.yml | 2 +- .github/workflows/build.from.main.branch.deploy.to.dev.yml | 2 +- .github/workflows/build.from.release.branch.deploy.to.dev.yml | 2 +- .github/workflows/create_tag.yml | 2 +- .github/workflows/deploy_prod.yml | 2 +- .github/workflows/on.pr.yml | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.from.developer.branch.deploy.to.dev.yml b/.github/workflows/build.from.developer.branch.deploy.to.dev.yml index 01f7448d..ad579c75 100644 --- a/.github/workflows/build.from.developer.branch.deploy.to.dev.yml +++ b/.github/workflows/build.from.developer.branch.deploy.to.dev.yml @@ -48,7 +48,7 @@ on: jobs: openshift-ci-cd: name: Build and deploy to OpenShift DEV - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 environment: dev #outputs: diff --git a/.github/workflows/build.from.main.branch.deploy.to.dev.yml b/.github/workflows/build.from.main.branch.deploy.to.dev.yml index 266faddd..d192192d 100644 --- a/.github/workflows/build.from.main.branch.deploy.to.dev.yml +++ b/.github/workflows/build.from.main.branch.deploy.to.dev.yml @@ -37,7 +37,7 @@ on: jobs: openshift-ci-cd: name: Build and deploy to OpenShift DEV - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 environment: dev #outputs: diff --git a/.github/workflows/build.from.release.branch.deploy.to.dev.yml b/.github/workflows/build.from.release.branch.deploy.to.dev.yml index f32334d2..0375760b 100644 --- a/.github/workflows/build.from.release.branch.deploy.to.dev.yml +++ b/.github/workflows/build.from.release.branch.deploy.to.dev.yml @@ -43,7 +43,7 @@ on: jobs: openshift-ci-cd: name: Build and deploy to OpenShift DEV from release branch - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 environment: dev #outputs: diff --git a/.github/workflows/create_tag.yml b/.github/workflows/create_tag.yml index cd1293c3..d6d309ae 100644 --- a/.github/workflows/create_tag.yml +++ b/.github/workflows/create_tag.yml @@ -26,7 +26,7 @@ on: jobs: tag_image: name: Tag Image - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 environment: dev outputs: diff --git a/.github/workflows/deploy_prod.yml b/.github/workflows/deploy_prod.yml index a6cb4d19..cb1c31e6 100644 --- a/.github/workflows/deploy_prod.yml +++ b/.github/workflows/deploy_prod.yml @@ -32,7 +32,7 @@ on: jobs: deploy-to-openshift-prod: name: Deploy to OpenShift PROD - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 environment: prod outputs: diff --git a/.github/workflows/on.pr.yml b/.github/workflows/on.pr.yml index 2eae9936..4c1f2c15 100644 --- a/.github/workflows/on.pr.yml +++ b/.github/workflows/on.pr.yml @@ -10,7 +10,7 @@ on: jobs: quality_profile: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 defaults: run: From c02147aec8668dea0e4f85a1a01fe97060bd26c3 Mon Sep 17 00:00:00 2001 From: githubmamatha <106563495+githubmamatha@users.noreply.github.com> Date: Wed, 26 Jun 2024 15:45:54 -0700 Subject: [PATCH 4/8] Grad2-2814 new batch job type code added (#496) --- .../1.0/V1.0.47__DML-INSERT_DATA-BATCH_JOB_TYPE_CODE.sql | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 api/src/main/resources/db/migration/1.0/V1.0.47__DML-INSERT_DATA-BATCH_JOB_TYPE_CODE.sql diff --git a/api/src/main/resources/db/migration/1.0/V1.0.47__DML-INSERT_DATA-BATCH_JOB_TYPE_CODE.sql b/api/src/main/resources/db/migration/1.0/V1.0.47__DML-INSERT_DATA-BATCH_JOB_TYPE_CODE.sql new file mode 100644 index 00000000..952e7a6c --- /dev/null +++ b/api/src/main/resources/db/migration/1.0/V1.0.47__DML-INSERT_DATA-BATCH_JOB_TYPE_CODE.sql @@ -0,0 +1,2 @@ +INSERT INTO BATCH_JOB_TYPE_CODE (BATCH_JOB_TYPE_CODE,LABEL,DESCRIPTION,DISPLAY_ORDER,EFFECTIVE_DATE,EXPIRY_DATE) +VALUES ('TVR_DELETE','Delete Student TVR Process','A year-end process that will delete student TVRs',120,TIMESTAMP'2024-06-24 00:00:00.0',NULL); From 6518f5dad2d08a8e38e449ebc8e9c3e56b92adb9 Mon Sep 17 00:00:00 2001 From: githubmamatha <106563495+githubmamatha@users.noreply.github.com> Date: Wed, 26 Jun 2024 15:49:01 -0700 Subject: [PATCH 5/8] Grad2-2812 Modified ARC students description (#498) --- .../1.0/V1.0.48__DML-UPDATE_DATA-BATCH_JOB_TYPE_CODE.sql | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 api/src/main/resources/db/migration/1.0/V1.0.48__DML-UPDATE_DATA-BATCH_JOB_TYPE_CODE.sql diff --git a/api/src/main/resources/db/migration/1.0/V1.0.48__DML-UPDATE_DATA-BATCH_JOB_TYPE_CODE.sql b/api/src/main/resources/db/migration/1.0/V1.0.48__DML-UPDATE_DATA-BATCH_JOB_TYPE_CODE.sql new file mode 100644 index 00000000..3d151b2b --- /dev/null +++ b/api/src/main/resources/db/migration/1.0/V1.0.48__DML-UPDATE_DATA-BATCH_JOB_TYPE_CODE.sql @@ -0,0 +1,3 @@ +UPDATE BATCH_JOB_TYPE_CODE +SET DESCRIPTION='A year-end process that will set student status of CUR (current) and TER (terminated) to ARC (archived)', UPDATE_USER='API_GRAD_BATCH' , UPDATE_DATE=TIMESTAMP'2024-06-25 00:00:00.0' +WHERE BATCH_JOB_TYPE_CODE='ARC_STUDENTS'; \ No newline at end of file From 8d777e18ded5f31f92778f822769f73c97807446 Mon Sep 17 00:00:00 2001 From: githubmamatha <106563495+githubmamatha@users.noreply.github.com> Date: Wed, 26 Jun 2024 15:51:55 -0700 Subject: [PATCH 6/8] Grad2-2820 New Batch type Code added (#500) * Grad2-2820 new batch job type code added * Grad2-2820 Renamed file. --- .../1.0/V1.0.49__DML-INSERT_DATA-BATCH_JOB_TYPE_CODE.sql | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 api/src/main/resources/db/migration/1.0/V1.0.49__DML-INSERT_DATA-BATCH_JOB_TYPE_CODE.sql diff --git a/api/src/main/resources/db/migration/1.0/V1.0.49__DML-INSERT_DATA-BATCH_JOB_TYPE_CODE.sql b/api/src/main/resources/db/migration/1.0/V1.0.49__DML-INSERT_DATA-BATCH_JOB_TYPE_CODE.sql new file mode 100644 index 00000000..96b5b8cc --- /dev/null +++ b/api/src/main/resources/db/migration/1.0/V1.0.49__DML-INSERT_DATA-BATCH_JOB_TYPE_CODE.sql @@ -0,0 +1,2 @@ +INSERT INTO BATCH_JOB_TYPE_CODE (BATCH_JOB_TYPE_CODE,LABEL,DESCRIPTION,DISPLAY_ORDER,EFFECTIVE_DATE,EXPIRY_DATE) +VALUES ('SCHL_RPT_REGEN','User Request School Report Regeneration','The User regenerate School Reports option allows Users to manually update school reports upon demand.',130,TIMESTAMP'2024-06-26 00:00:00.0',NULL); From c5e6eb928a9afe45f02c61e3ee2787ac7668126b Mon Sep 17 00:00:00 2001 From: arybakov Date: Thu, 27 Jun 2024 09:25:45 -0600 Subject: [PATCH 7/8] GRAD2-2799-P3 GRAD Incident: REGALG is creating SCCP certificates for students with future completion dates- edit summary P3 GRAD Incident: REGALG is creating SCCP certificates for students with future completion dates --- .../util/EducGradBatchGraduationApiUtils.java | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/api/src/main/java/ca/bc/gov/educ/api/batchgraduation/util/EducGradBatchGraduationApiUtils.java b/api/src/main/java/ca/bc/gov/educ/api/batchgraduation/util/EducGradBatchGraduationApiUtils.java index 708f45f8..8ea07499 100644 --- a/api/src/main/java/ca/bc/gov/educ/api/batchgraduation/util/EducGradBatchGraduationApiUtils.java +++ b/api/src/main/java/ca/bc/gov/educ/api/batchgraduation/util/EducGradBatchGraduationApiUtils.java @@ -89,11 +89,14 @@ public static String getProgramCompletionDate(Date pcd) { return dateFormat.format(pcd); } - private static Date toLastDayOfMonth(Date date) { - Calendar cal = Calendar.getInstance(); - cal.setTime(date); - cal.set(Calendar.DAY_OF_MONTH, cal.getActualMaximum(Calendar.DAY_OF_MONTH)); - return cal.getTime(); + static Date toLastDayOfMonth(Date date) { + if(date != null) { + Calendar cal = Calendar.getInstance(); + cal.setTime(date); + cal.set(Calendar.DAY_OF_MONTH, cal.getActualMaximum(Calendar.DAY_OF_MONTH)); + return cal.getTime(); + } + return null; } } From bd47e2706f02da30bb2fcae9d53d8e16b8e3f842 Mon Sep 17 00:00:00 2001 From: githubmamatha <106563495+githubmamatha@users.noreply.github.com> Date: Tue, 9 Jul 2024 10:34:38 -0700 Subject: [PATCH 8/8] Update pom.xml --- api/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/pom.xml b/api/pom.xml index a70f2dd8..266660d3 100644 --- a/api/pom.xml +++ b/api/pom.xml @@ -6,7 +6,7 @@ ca.bc.gov.educ educ-grad-batch-graduation-api - 1.8.65 + 1.8.66 educ-grad-batch-graduation-api Ministry of Education GRAD BATCH GRADUATION API