diff --git a/projects/workforce-allocations-to-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/api/model/AllocationDemandStaffResponse.kt b/projects/workforce-allocations-to-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/api/model/AllocationDemandStaffResponse.kt index 1b3adf8ed6..dc025b6802 100644 --- a/projects/workforce-allocations-to-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/api/model/AllocationDemandStaffResponse.kt +++ b/projects/workforce-allocations-to-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/api/model/AllocationDemandStaffResponse.kt @@ -18,7 +18,7 @@ data class AllocationDemandStaffResponse( data class Requirement( val mainCategory: String, - val subCategory: String, + val subCategory: String?, val length: String, val id: Long ) diff --git a/projects/workforce-allocations-to-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/api/model/CaseView.kt b/projects/workforce-allocations-to-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/api/model/CaseView.kt index fe708e58a7..96738d8782 100644 --- a/projects/workforce-allocations-to-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/api/model/CaseView.kt +++ b/projects/workforce-allocations-to-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/api/model/CaseView.kt @@ -44,7 +44,7 @@ data class CvSentence( data class CvRequirement( val mainCategory: String, - val subCategory: String, + val subCategory: String?, val length: String ) diff --git a/projects/workforce-allocations-to-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/integrations/delius/caseview/CaseViewRequirement.kt b/projects/workforce-allocations-to-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/integrations/delius/caseview/CaseViewRequirement.kt index d707ccd4d5..d2525f512f 100644 --- a/projects/workforce-allocations-to-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/integrations/delius/caseview/CaseViewRequirement.kt +++ b/projects/workforce-allocations-to-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/integrations/delius/caseview/CaseViewRequirement.kt @@ -34,7 +34,7 @@ class CaseViewRequirement( @ManyToOne @JoinColumn(name = "rqmnt_type_sub_category_id") - val subCategory: ReferenceData, + val subCategory: ReferenceData?, val length: Long?, diff --git a/projects/workforce-allocations-to-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/service/AllocationDemandService.kt b/projects/workforce-allocations-to-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/service/AllocationDemandService.kt index 5ab1ebabac..092ff1e7bd 100644 --- a/projects/workforce-allocations-to-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/service/AllocationDemandService.kt +++ b/projects/workforce-allocations-to-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/service/AllocationDemandService.kt @@ -189,7 +189,7 @@ class AllocationDemandService( private fun CaseViewRequirement.toRequirement() = Requirement( mainCategory.description, - subCategory.description, + subCategory?.description, length?.let { "$length ${mainCategory.units?.description ?: ""}" } ?: "", id ) diff --git a/projects/workforce-allocations-to-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/service/CaseViewService.kt b/projects/workforce-allocations-to-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/service/CaseViewService.kt index c926be046c..c7f9e0abc1 100644 --- a/projects/workforce-allocations-to-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/service/CaseViewService.kt +++ b/projects/workforce-allocations-to-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/service/CaseViewService.kt @@ -77,7 +77,7 @@ class CaseViewService( private fun CaseViewRequirement.toCvRequirement() = CvRequirement( mainCategory.description, - subCategory.description, + subCategory?.description, length?.let { "$length ${mainCategory.units?.description ?: ""}" } ?: "" )