Skip to content

Commit

Permalink
PI-2095: Fix db table (#3941)
Browse files Browse the repository at this point in the history
* PI-2095: Fix db table
  • Loading branch information
pmcphee77 authored Jun 25, 2024
1 parent d4af1ff commit 1fc1c16
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 14 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package uk.gov.justice.digital.hmpps.data.generator

import uk.gov.justice.digital.hmpps.integrations.delius.event.sentence.entity.Court
import uk.gov.justice.digital.hmpps.integrations.delius.provider.entity.Organisation
import uk.gov.justice.digital.hmpps.integrations.delius.provider.entity.ProbationAreaEntity
import java.time.LocalDate
import java.time.LocalTime
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,7 @@ object PersonGenerator {
officer = StaffGenerator.OFFICER,
partitionArea = PARTITION_AREA,
staffEmployeeId = StaffGenerator.ALLOCATED.id,
providerEmployee = ProviderEmployeeGenerator.PROVIDER_EMPLOYEE,
officerCode = "OFFCODE"
providerEmployee = ProviderEmployeeGenerator.PROVIDER_EMPLOYEE
)

fun generatePersonAlias(person: Person) =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import java.time.LocalDate

data class CommunityOrPrisonOffenderManager(
@Schema(description = "Staff code", example = "CHSE755")
val staffCode: String,
val staffCode: String?,
@Schema(description = "Staff id", example = "123455")
val staffId: Long?,
@Schema(description = "True if this offender manager is the current responsible officer", example = "true")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,6 @@ class PersonManager(
@Column(name = "trust_provider_flag", columnDefinition = "number")
val trustProviderFlag: Boolean,

@Column(name = "officer_code", columnDefinition = "char(7)")
val officerCode: String,

@ManyToOne
@JoinColumns(
JoinColumn(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class ProviderTeam(
@Column(name = "provider_team_id")
val providerTeamId: Long,

@Column(name = "code")
@Column(name = "code", columnDefinition = "char(6)")
val code: String,

@Column(name = "name")
Expand Down Expand Up @@ -155,11 +155,7 @@ class Borough(
@OneToMany(mappedBy = "borough")
val districts: List<District> = listOf(),

@ManyToOne
@JoinColumn(name = "organisation_id")
val organisation: Organisation? = null

)
)

@Immutable
@Entity
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class OffenderManagerService(
}

fun PersonManager.toOffenderManager(includeProbationAreaTeams: Boolean) = CommunityOrPrisonOffenderManager(
staffCode = officerCode,
staffCode = staff?.code,
staffId = staff?.id,
isUnallocated = isUnallocated(),
staff = staff?.let {
Expand Down

0 comments on commit 1fc1c16

Please sign in to comment.