Skip to content

Commit

Permalink
PI-1998 - display event number for sentence (#30)
Browse files Browse the repository at this point in the history
  • Loading branch information
achimber-moj authored Mar 26, 2024
1 parent fb91ca3 commit aafc7d5
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
9 changes: 7 additions & 2 deletions server/data/model/sentenceDetails.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ export interface Sentence {
conviction: Conviction
}
export interface OffenceDetails {
mainOffence: string
mainOffence: Offence
offenceDate: string
notes: string
additionalOffences: []
additionalOffences: Offence[]
}

export interface Conviction {
Expand All @@ -23,3 +23,8 @@ export interface Conviction {
convictionDate: string
additionalSentences: string
}

export interface Offence {
code: string
description: string
}
2 changes: 1 addition & 1 deletion server/views/pages/sentence.njk
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

{% block pageContent %}
{% for sentence in sentenceDetails.sentences %}
<h1 class="govuk-heading-l govuk-!-margin-bottom-7" data-qa="pageHeading">Sentence: {{ sentence.eventNumber }}</h1>
<h1 class="govuk-heading-l govuk-!-margin-bottom-7" data-qa="pageHeading">Sentence: {{ sentence.offenceDetails.eventNumber }}</h1>

{% set hasAdditionalOffences = sentence.offenceDetails.additionalOffences and sentence.offenceDetails.additionalOffences.length > 0 %}
{% set additionalOffences %}
Expand Down
4 changes: 2 additions & 2 deletions wiremock/mappings/X000001-sentence.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
},
"sentences": [
{
"eventNumber": 3,
"offenceDetails": {
"eventNumber": 3,
"offence": {
"description": "Murder",
"count": 3
Expand Down Expand Up @@ -47,8 +47,8 @@
}
},
{
"eventNumber": 1,
"offenceDetails": {
"eventNumber": 1,
"offence": {
"description": "Another Murder",
"count": 1
Expand Down

0 comments on commit aafc7d5

Please sign in to comment.