Skip to content

Commit

Permalink
Bug/pi 2263 convictions api missing data (#3915)
Browse files Browse the repository at this point in the history
* PI-2263 use notional_end_date if entered_notional_end_date is null in response object

Signed-off-by: Amardeep Chimber <[email protected]>

* PI-2263 add offence prefix to distinguish between manin offence and additional offence

Signed-off-by: Amardeep Chimber <[email protected]>

* PI-2263 remove active flag sql restriction

Signed-off-by: Amardeep Chimber <[email protected]>

---------

Signed-off-by: Amardeep Chimber <[email protected]>
  • Loading branch information
achimber-moj authored Jun 18, 2024
1 parent a0848f8 commit f87a9bc
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ internal class ConvictionIntegrationTest {
)
val expectedOffences = listOf(
Offence(
mainOffence.id,
"M${mainOffence.id}",
mainOffence = true,
expectedMainOffenceDetail,
mainOffence.date,
Expand All @@ -107,7 +107,7 @@ internal class ConvictionIntegrationTest {
mainOffence.updated
),
Offence(
additionalOffence.id,
"A${additionalOffence.id}",
mainOffence = false,
expectedAdditionalOffenceDetail,
additionalOffence.date,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ data class Conviction(
)

data class Offence(
val offenceId: Long,
val offenceId: String,
val mainOffence: Boolean,
val detail: OffenceDetail,
val offenceDate: LocalDate?,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ fun EventRepository.getByPersonAndEventNumber(person: Person, eventId: Long) = f

@Entity
@Immutable
@SQLRestriction("soft_deleted = 0 and active_flag = 1")
@SQLRestriction("soft_deleted = 0")
@Table(name = "order_manager")
class OrderManager(

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ class ConvictionService(

fun MainOffence.toOffence(): Offence =
Offence(
id,
"M$id",
mainOffence = true,
detail = offence.toOffenceDetail(),
offenceDate = date,
Expand All @@ -93,7 +93,7 @@ class ConvictionService(

fun AdditionalOffence.toOffence(): Offence =
Offence(
id,
"A$id",
mainOffence = false,
detail = offence.toOffenceDetail(),
offenceDate = date,
Expand Down Expand Up @@ -132,7 +132,7 @@ class ConvictionService(
length,
effectiveLength,
lengthInDays,
enteredSentenceEndDate,
enteredSentenceEndDate ?: endDate?.toLocalDate(),
unpaidWorkDetails?.toUnpaidWork(id),
startDate,
terminationDate,
Expand Down

0 comments on commit f87a9bc

Please sign in to comment.