Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cas2bail/main #2641

Draft
wants to merge 40 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 9 commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
c8de685
feat: added open api scaffold for cas2 to cas2bail routes and delegates
Nov 28, 2024
45474a5
first round of cas2bail application
garethCAS2 Nov 28, 2024
0402efd
feat: application controller and linked services in cas2bail
Nov 28, 2024
4291eef
feat: added migrations
Nov 28, 2024
387da56
started working through the tests
garethCAS2 Nov 29, 2024
6166492
initial unit tests working - for cas2bail application
garethCAS2 Nov 29, 2024
0b40d88
unit tests for Cas2BailAssessments and Cas2UserAccessService
garethCAS2 Nov 29, 2024
f16a186
wip tests and CasResult
garethCAS2 Dec 2, 2024
162c90d
More tests
garethCAS2 Dec 2, 2024
3a2baaa
WIP around tests
garethCAS2 Dec 3, 2024
3ddd76b
feat: adds the view for live summary
Dec 3, 2024
a6964b1
fix: merged new bail migrations
Dec 3, 2024
c8d6247
chore: more test debug
Dec 3, 2024
e7c5f01
chore: added Cas2BailAssessmentEntityFactory
garethCAS2 Dec 3, 2024
dc1abef
chore: more test changes and some renaming
garethCAS2 Dec 3, 2024
86ab963
chore: debug code for why the JPA isn't writing to some objects
Dec 4, 2024
4c784be
feat: Cas2BailApplication tests running
garethCAS2 Dec 4, 2024
adacbf8
feat: Cas2BailApplicationAbandonTest added
garethCAS2 Dec 4, 2024
790d541
feat: Cas2BailAssessmentTest
garethCAS2 Dec 4, 2024
c11e561
feat: Cas2BailAssessmentTest renamed the tests
garethCAS2 Dec 4, 2024
c1afc7b
feat: Cas2BailPeopleController and tests
garethCAS2 Dec 4, 2024
2048331
chore: wip
Dec 4, 2024
134b3a0
first round of cas2bail application
garethCAS2 Nov 28, 2024
5f74c57
feat: added migrations
Nov 28, 2024
947158b
started working through the tests
garethCAS2 Nov 29, 2024
b1001e2
feat: adds the view for live summary
Dec 3, 2024
12d980c
chore: more test debug
Dec 3, 2024
06d1429
feat: Cas2BailApplication tests running
garethCAS2 Dec 4, 2024
c5a64b0
feat: Cas2BailApplicationAbandonTest added
garethCAS2 Dec 4, 2024
459044e
feat: Cas2BailAssessmentTest
garethCAS2 Dec 4, 2024
4390bcf
feat: cas2Reports and tests and cas2StatusUpdate and tests
garethCAS2 Dec 4, 2024
d0691ea
fix: removed .keep
Dec 5, 2024
dd232ae
Merge branch 'cas2bail/main' into cas2bail/submissions
Dec 5, 2024
cfc809a
chore: exploding more imports
Dec 5, 2024
50be8e3
fixes: for linter and detekt
garethCAS2 Dec 5, 2024
b6b1b46
fix: wildcard imports
garethCAS2 Dec 5, 2024
ee33a8e
Merge branch 'cas2bail/main' into cas2bail/statusUpdate
garethCAS2 Dec 5, 2024
64704fc
fixes for linter and detekt
garethCAS2 Dec 5, 2024
2c6b359
fix: added import to Cas2BailApplicationEntity
garethCAS2 Dec 5, 2024
13e4eed
Added comment where we think code will start to change after Xmas
garethCAS2 Dec 20, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 23 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,14 @@ tasks.bootRun {
}

tasks.withType<Test> {
jvmArgs("--add-opens", "java.base/java.lang=ALL-UNNAMED", "--add-opens", "java.base/java.lang.reflect=ALL-UNNAMED", "--add-opens", "java.base/java.time=ALL-UNNAMED")
jvmArgs(
"--add-opens",
"java.base/java.lang=ALL-UNNAMED",
"--add-opens",
"java.base/java.lang.reflect=ALL-UNNAMED",
"--add-opens",
"java.base/java.time=ALL-UNNAMED"
)

afterEvaluate {
if (environment["CI"] != null) {
Expand Down Expand Up @@ -248,6 +255,14 @@ registerAdditionalOpenApiGenerateTask(
useTags = true,
)

registerAdditionalOpenApiGenerateTask(
name = "openApiGenerateCas2bailNamespace",
ymlPath = "$rootDir/src/main/resources/static/codegen/built-cas2bail-api-spec.yml",
apiPackageName = "uk.gov.justice.digital.hmpps.approvedpremisesapi.api.cas2bail",
modelPackageName = "uk.gov.justice.digital.hmpps.approvedpremisesapi.api.model",
apiSuffix = "Cas2bail",
)

registerAdditionalOpenApiGenerateTask(
name = "openApiGenerateCas2Namespace",
ymlPath = "$rootDir/src/main/resources/static/codegen/built-cas2-api-spec.yml",
Expand Down Expand Up @@ -327,6 +342,7 @@ tasks.register("openApiPreCompilation") {
.readFileToString(file, "UTF-8")
.replace("_shared.yml#/components", "#/components")
.replace("cas1-schemas.yml#/components", "#/components")
.replace("cas2bail-schemas.yml#/components", "#/components")
FileUtils.writeStringToFile(file, updatedContents, "UTF-8")
}

Expand Down Expand Up @@ -379,6 +395,11 @@ tasks.register("openApiPreCompilation") {
outputFileName = "built-cas2-api-spec.yml",
inputSpec = "cas2-api.yml",
)
buildSpecWithSharedComponentsAppended(
outputFileName = "built-cas2bail-api-spec.yml",
inputSpec = "cas2bail-api.yml",
inputSchemas = "cas2bail-schemas.yml",
)
buildSpecWithSharedComponentsAppended(
outputFileName = "built-cas3-api-spec.yml",
inputSpec = "cas3-api.yml",
Expand All @@ -392,6 +413,7 @@ tasks.get("openApiGenerate").dependsOn(
"openApiPreCompilation",
"openApiGenerateCas1Namespace",
"openApiGenerateCas2Namespace",
"openApiGenerateCas2bailNamespace",
"openApiGenerateCas3Namespace",
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,17 @@ class OAuth2ResourceServerSecurityConfiguration {
authorize(HttpMethod.GET, "/cas2/reference-data/**", hasAnyRole("CAS2_ASSESSOR", "POM"))
authorize(HttpMethod.GET, "/cas2/reports/**", hasRole("CAS2_MI"))
authorize("/cas2/**", hasAnyAuthority("ROLE_POM", "ROLE_LICENCE_CA"))

authorize(HttpMethod.PUT, "/cas2bail/assessments/**", hasRole("CAS2_ASSESSOR"))
authorize(HttpMethod.GET, "/cas2bail/assessments/**", hasAnyRole("CAS2_ASSESSOR", "CAS2_ADMIN"))
authorize(HttpMethod.POST, "/cas2bail/assessments/*/status-updates", hasRole("CAS2_ASSESSOR"))
authorize(HttpMethod.POST, "/cas2bail/assessments/*/notes", hasAnyRole("LICENCE_CA", "POM", "CAS2_ASSESSOR"))
authorize(HttpMethod.GET, "/cas2bail/submissions/**", hasAnyRole("CAS2_ASSESSOR", "CAS2_ADMIN"))
authorize(HttpMethod.POST, "/cas2bail/submissions/*/status-updates", hasRole("CAS2_ASSESSOR"))
authorize(HttpMethod.GET, "/cas2bail/reference-data/**", hasAnyRole("CAS2_ASSESSOR", "POM"))
authorize(HttpMethod.GET, "/cas2bail/reports/**", hasRole("CAS2_MI"))
authorize("/cas2bail/**", hasAnyAuthority("ROLE_POM", "ROLE_LICENCE_CA"))

authorize(HttpMethod.GET, "/cas3-api.yml", permitAll)
authorize(HttpMethod.GET, "/subject-access-request", hasAnyRole("SAR_DATA_ACCESS"))
authorize(anyRequest, hasAuthority("ROLE_PROBATION"))
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,175 @@
package uk.gov.justice.digital.hmpps.approvedpremisesapi.controller.cas2bail

import com.fasterxml.jackson.databind.ObjectMapper
import jakarta.transaction.Transactional
import org.springframework.http.ResponseEntity
import org.springframework.stereotype.Service
import uk.gov.justice.digital.hmpps.approvedpremisesapi.api.cas2bail.ApplicationsCas2bailDelegate
import uk.gov.justice.digital.hmpps.approvedpremisesapi.api.model.*
import uk.gov.justice.digital.hmpps.approvedpremisesapi.jpa.entity.cas2bail.Cas2BailApplicationEntity
import uk.gov.justice.digital.hmpps.approvedpremisesapi.jpa.entity.cas2bail.Cas2BailApplicationSummaryEntity
import uk.gov.justice.digital.hmpps.approvedpremisesapi.problem.BadRequestProblem
import uk.gov.justice.digital.hmpps.approvedpremisesapi.problem.ConflictProblem
import uk.gov.justice.digital.hmpps.approvedpremisesapi.problem.ForbiddenProblem
import uk.gov.justice.digital.hmpps.approvedpremisesapi.problem.NotFoundProblem
import uk.gov.justice.digital.hmpps.approvedpremisesapi.results.AuthorisableActionResult
import uk.gov.justice.digital.hmpps.approvedpremisesapi.results.ValidatableActionResult
import uk.gov.justice.digital.hmpps.approvedpremisesapi.service.HttpAuthService
import uk.gov.justice.digital.hmpps.approvedpremisesapi.service.NomisUserService
import uk.gov.justice.digital.hmpps.approvedpremisesapi.service.cas2.OffenderService
import uk.gov.justice.digital.hmpps.approvedpremisesapi.service.cas2bail.Cas2BailApplicationService
import uk.gov.justice.digital.hmpps.approvedpremisesapi.transformer.cas2bail.Cas2BailApplicationsTransformer
import uk.gov.justice.digital.hmpps.approvedpremisesapi.util.PageCriteria
import java.net.URI
import java.util.*

import uk.gov.justice.digital.hmpps.approvedpremisesapi.api.model.Cas2ApplicationSummary as ModelCas2ApplicationSummary

@Service(
"uk.gov.justice.digital.hmpps.approvedpremisesapi.controller.cas2bail" +
".Cas2BailApplicationsController",
)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

because the class name is unique within the project, you shouldn't need to specify a value in the @service annotation

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed done.

class Cas2BailApplicationController(
private val httpAuthService: HttpAuthService,
private val cas2BailApplicationService: Cas2BailApplicationService,
private val cas2BailApplicationsTransformer: Cas2BailApplicationsTransformer,
private val objectMapper: ObjectMapper,
private val offenderService: OffenderService,
private val userService: NomisUserService,
) : ApplicationsCas2bailDelegate {

override fun applicationsGet(
isSubmitted: Boolean?,
page: Int?,
prisonCode: String?,
): ResponseEntity<List<ModelCas2ApplicationSummary>> {
val user = userService.getUserForRequest()

prisonCode?.let { if (prisonCode != user.activeCaseloadId) throw ForbiddenProblem() }

val pageCriteria = PageCriteria("createdAt", SortDirection.desc, page)

val (applications, metadata) = cas2BailApplicationService.getCas2BailApplications(prisonCode, isSubmitted, user, pageCriteria)

return ResponseEntity.ok().headers(
metadata?.toHeaders(),
).body(getPersonNamesAndTransformToSummaries(applications))
}

override fun applicationsApplicationIdGet(applicationId: UUID): ResponseEntity<Application> {
val user = userService.getUserForRequest()

val application = when (
val applicationResult = cas2BailApplicationService
.getCas2BailApplicationForUser(
applicationId,
user
)

) {
is AuthorisableActionResult.NotFound -> null
Copy link
Contributor

@davidatkinsuk davidatkinsuk Dec 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there's an open question as to whether we should be adding more use of deprecated code (in this case using AuthorisableActionResult instead of CasResult). I'm not sure what the answer is, i'll get back to you.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

my position is we shouldn't use deprecated code, and use the latest pattern we have. please can we do this?

is AuthorisableActionResult.Unauthorised -> throw ForbiddenProblem()
is AuthorisableActionResult.Success -> applicationResult.entity
}

if (application != null) {
return ResponseEntity.ok(getPersonDetailAndTransform(application))
}
throw NotFoundProblem(applicationId, "Application")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I appreciate that you've copied this code, but this NotFoundProblem can be moved into line 70

}

@Transactional
override fun applicationsPost(body: NewApplication): ResponseEntity<Application> {
val nomisPrincipal = httpAuthService.getNomisPrincipalOrThrow()
val user = userService.getUserForRequest()

val personInfo = offenderService.getFullInfoForPersonOrThrow(body.crn)

val applicationResult = cas2BailApplicationService.createCas2BailApplication(
body.crn,
user,
nomisPrincipal.token.tokenValue,
)

val application = when (applicationResult) {
is ValidatableActionResult.GeneralValidationError -> throw BadRequestProblem(errorDetail = applicationResult.message)
is ValidatableActionResult.FieldValidationError -> throw BadRequestProblem(invalidParams = applicationResult.validationMessages)
is ValidatableActionResult.ConflictError -> throw ConflictProblem(id = applicationResult.conflictingEntityId, conflictReason = applicationResult.message)
is ValidatableActionResult.Success -> applicationResult.entity
}

return ResponseEntity
.created(URI.create("/cas2/applications/${application.id}"))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this be /cas2bail?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed done

.body(cas2BailApplicationsTransformer.transformJpaToApi(application, personInfo))
}

@Transactional
override fun applicationsApplicationIdPut(
applicationId: UUID,
body: UpdateApplication,
): ResponseEntity<Application> {
val user = userService.getUserForRequest()

val serializedData = objectMapper.writeValueAsString(body.data)

val applicationResult = cas2BailApplicationService.updateCas2BailApplication(
applicationId =
applicationId,
data = serializedData,
user,
)

val validationResult = when (applicationResult) {
is AuthorisableActionResult.NotFound -> throw NotFoundProblem(applicationId, "Application")
is AuthorisableActionResult.Unauthorised -> throw ForbiddenProblem()
is AuthorisableActionResult.Success -> applicationResult.entity
}

val updatedApplication = when (validationResult) {
is ValidatableActionResult.GeneralValidationError -> throw BadRequestProblem(errorDetail = validationResult.message)
is ValidatableActionResult.FieldValidationError -> throw BadRequestProblem(invalidParams = validationResult.validationMessages)
is ValidatableActionResult.ConflictError -> throw ConflictProblem(id = validationResult.conflictingEntityId, conflictReason = validationResult.message)
is ValidatableActionResult.Success -> validationResult.entity
}

return ResponseEntity.ok(getPersonDetailAndTransform(updatedApplication))
}

@Transactional
override fun applicationsApplicationIdAbandonPut(applicationId: UUID): ResponseEntity<Unit> {
val user = userService.getUserForRequest()

val validationResult = when (val applicationResult = cas2BailApplicationService.abandonCas2BailApplication(applicationId, user)) {
is AuthorisableActionResult.NotFound -> throw NotFoundProblem(applicationId, "Application")
is AuthorisableActionResult.Unauthorised -> throw ForbiddenProblem()
is AuthorisableActionResult.Success -> applicationResult.entity
}

when (validationResult) {
is ValidatableActionResult.GeneralValidationError -> throw BadRequestProblem(errorDetail = validationResult.message)
is ValidatableActionResult.FieldValidationError -> throw BadRequestProblem(invalidParams = validationResult.validationMessages)
is ValidatableActionResult.ConflictError -> throw ConflictProblem(id = validationResult.conflictingEntityId, conflictReason = validationResult.message)
is ValidatableActionResult.Success -> validationResult.entity
}

return ResponseEntity.ok(Unit)
}

private fun getPersonNamesAndTransformToSummaries(applicationSummaries: List<Cas2BailApplicationSummaryEntity>): List<uk.gov.justice.digital.hmpps.approvedpremisesapi.api.model.Cas2ApplicationSummary> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no need for full path on Cas2ApplicationSummary, can import it

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes done.

val crns = applicationSummaries.map { it.crn }

val personNamesMap = offenderService.getMapOfPersonNamesAndCrns(crns)

return applicationSummaries.map { application ->
cas2BailApplicationsTransformer.transformJpaSummaryToSummary(application, personNamesMap[application.crn]!!)
}
}

private fun getPersonDetailAndTransform(
application: Cas2BailApplicationEntity,
): Application {
val personInfo = offenderService.getFullInfoForPersonOrThrow(application.crn)

return cas2BailApplicationsTransformer.transformJpaToApi(application, personInfo)
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
package uk.gov.justice.digital.hmpps.approvedpremisesapi.controller.cas2bail

import org.springframework.http.HttpStatus
import org.springframework.http.ResponseEntity
import org.springframework.stereotype.Service
import org.zalando.problem.AbstractThrowableProblem
import uk.gov.justice.digital.hmpps.approvedpremisesapi.api.cas2bail.AssessmentsCas2bailDelegate
import uk.gov.justice.digital.hmpps.approvedpremisesapi.api.model.*
import uk.gov.justice.digital.hmpps.approvedpremisesapi.jpa.entity.Cas2ApplicationNoteEntity
import uk.gov.justice.digital.hmpps.approvedpremisesapi.problem.ConflictProblem
import uk.gov.justice.digital.hmpps.approvedpremisesapi.problem.ForbiddenProblem
import uk.gov.justice.digital.hmpps.approvedpremisesapi.problem.NotFoundProblem
import uk.gov.justice.digital.hmpps.approvedpremisesapi.results.CasResult
import uk.gov.justice.digital.hmpps.approvedpremisesapi.service.ExternalUserService
import uk.gov.justice.digital.hmpps.approvedpremisesapi.service.cas2bail.Cas2BailApplicationNoteService
import uk.gov.justice.digital.hmpps.approvedpremisesapi.service.cas2bail.Cas2BailAssessmentService
import uk.gov.justice.digital.hmpps.approvedpremisesapi.service.cas2bail.Cas2BailStatusUpdateService
import uk.gov.justice.digital.hmpps.approvedpremisesapi.transformer.cas2.ApplicationNotesTransformer
import uk.gov.justice.digital.hmpps.approvedpremisesapi.transformer.cas2bail.Cas2BailAssessmentsTransformer
import uk.gov.justice.digital.hmpps.approvedpremisesapi.util.extractEntityFromCasResult
import java.net.URI
import java.util.*

@Service("Cas2BailAssessmentsController")
class Cas2BailAssessmentsController (
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

because the class name is unique within the project, you shouldn't need to specify a value in the @service annotation. Same goes for all other controllers

private val cas2BailAssessmentService: Cas2BailAssessmentService,
private val cas2BailApplicationNoteService: Cas2BailApplicationNoteService,
private val cas2BailAssessmentsTransformer: Cas2BailAssessmentsTransformer,
private val applicationNotesTransformer: ApplicationNotesTransformer,
private val cas2BailStatusUpdateService: Cas2BailStatusUpdateService,
private val externalUserService: ExternalUserService,
) : AssessmentsCas2bailDelegate {

override fun assessmentsAssessmentIdGet(assessmentId: UUID): ResponseEntity<Cas2Assessment> {
val assessment = when (
val assessmentResult = cas2BailAssessmentService.getAssessment(assessmentId)
) {
is CasResult.NotFound -> throw NotFoundProblem(assessmentId, "Cas2BailAssessment")
is CasResult.Unauthorised -> throw ForbiddenProblem()
is CasResult.Success -> assessmentResult
is CasResult.ConflictError<*> -> throw ConflictProblem(assessmentId, "Cas2BailAssessment conflict by assessmentId")
is CasResult.FieldValidationError<*> -> CasResult.FieldValidationError(mapOf("$.reason" to "doesNotExist"))
is CasResult.GeneralValidationError<*> -> CasResult.GeneralValidationError("General Validation Error")
}

val cas2BailAssessmentEntity = extractEntityFromCasResult(assessment)
return ResponseEntity.ok(cas2BailAssessmentsTransformer.transformJpaToApiRepresentation(cas2BailAssessmentEntity))
}

override fun assessmentsAssessmentIdPut(
assessmentId: UUID,
updateCas2Assessment: UpdateCas2Assessment,
): ResponseEntity<Cas2Assessment> {
val assessmentResult = cas2BailAssessmentService.updateAssessment(assessmentId, updateCas2Assessment)
when (assessmentResult) {
is CasResult.NotFound -> throw NotFoundProblem(assessmentId, "Assessment")
is CasResult.Unauthorised -> throw ForbiddenProblem()
is CasResult.Success -> assessmentResult
is CasResult.ConflictError<*> -> throw ConflictProblem(assessmentId, "Cas2BailAssessment conflict by assessmentId")
is CasResult.FieldValidationError<*> -> CasResult.FieldValidationError(mapOf("$.reason" to "doesNotExist"))
is CasResult.GeneralValidationError<*> -> CasResult.GeneralValidationError("General Validation Error")
}

val cas2BailAssessmentEntity = extractEntityFromCasResult(assessmentResult)
return ResponseEntity.ok(
cas2BailAssessmentsTransformer.transformJpaToApiRepresentation(cas2BailAssessmentEntity),
)
}

override fun assessmentsAssessmentIdStatusUpdatesPost(
assessmentId: UUID,
cas2AssessmentStatusUpdate: Cas2AssessmentStatusUpdate,
): ResponseEntity<Unit> {
val result = cas2BailStatusUpdateService.createForAssessment(
assessmentId = assessmentId,
statusUpdate = cas2AssessmentStatusUpdate,
assessor = externalUserService.getUserForRequest(),
)

processAuthorisationFor(result)
.run { processValidation(result) }

return ResponseEntity(HttpStatus.CREATED)
}

override fun assessmentsAssessmentIdNotesPost(
assessmentId: UUID,
body: NewCas2ApplicationNote,
): ResponseEntity<Cas2ApplicationNote> {
val noteResult = cas2BailApplicationNoteService.createAssessmentNote(assessmentId, body)

val validationResult = processAuthorisationFor( noteResult) as CasResult<Cas2ApplicationNote>

val note = processValidation(validationResult) as Cas2ApplicationNoteEntity

return ResponseEntity
.created(URI.create("/cas2/assessments/$assessmentId/notes/${note.id}"))
.body(
applicationNotesTransformer.transformJpaToApi(note),
)
}

private fun <EntityType> processAuthorisationFor(
result: CasResult<EntityType>
): Any? {

return extractEntityFromCasResult(result)

}


private fun <EntityType : Any> processValidation(casResult: CasResult<EntityType>): Any {
return extractEntityFromCasResult(casResult)
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,16 @@ class Cas2ApplicationJsonSchemaEntity(
schema: String,
) : JsonSchemaEntity(id, addedAt, schema)

@Entity
@DiscriminatorValue("CAS_2_BAIL_APPLICATION")
@Table(name = "cas_2_bail_application_json_schemas")
@PrimaryKeyJoinColumn(name = "json_schema_id")
class Cas2BailApplicationJsonSchemaEntity(
id: UUID,
addedAt: OffsetDateTime,
schema: String,
) : JsonSchemaEntity(id, addedAt, schema)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'm not sure if you want to do this now, but we've decided to remove all the Json Schema/Json Validation code and tables. See https://dsdmoj.atlassian.net/browse/APS-1570 for what we think can be removed.


@Entity
@DiscriminatorValue("TEMPORARY_ACCOMMODATION_APPLICATION")
@Table(name = "temporary_accommodation_application_json_schemas")
Expand Down
Loading
Loading