Skip to content

Commit

Permalink
auto-approve action plans on submission from 2nd September 2024 (#1999)
Browse files Browse the repository at this point in the history
* auto-approve action plans on submission from 2nd September 2024

* ktlintFormat
  • Loading branch information
rgforsyth authored Aug 13, 2024
1 parent 8fdc37d commit 0246d37
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import uk.gov.justice.digital.hmpps.hmppsinterventionsservice.jpa.repository.Act
import uk.gov.justice.digital.hmpps.hmppsinterventionsservice.jpa.repository.AuthUserRepository
import uk.gov.justice.digital.hmpps.hmppsinterventionsservice.jpa.repository.DeliverySessionRepository
import uk.gov.justice.digital.hmpps.hmppsinterventionsservice.jpa.repository.ReferralRepository
import java.time.LocalDate
import java.time.OffsetDateTime
import java.util.UUID
import java.util.UUID.randomUUID
Expand Down Expand Up @@ -86,6 +87,11 @@ class ActionPlanService(
val savedSubmittedActionPlan = actionPlanRepository.save(submittedActionPlan)
actionPlanEventPublisher.actionPlanSubmitEvent(savedSubmittedActionPlan)

// if after 2nd september, auto-approve
if (LocalDate.now().isAfter(LocalDate.of(2024, 9, 1))) {
approveActionPlan(id, AuthUser.interventionsServiceUser)
}

return savedSubmittedActionPlan
}

Expand Down

0 comments on commit 0246d37

Please sign in to comment.