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

PI-2095: Fix db table #3941

Merged
merged 3 commits into from
Jun 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
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
Loading