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

MAN-36 update rar description on overview and compliance pages #303

Merged
merged 2 commits into from
Feb 3, 2025
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
2 changes: 1 addition & 1 deletion integration_tests/e2e/compliance.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ context('Compliance', () => {
page.getRowData('breach1', 'startDate', 'Value').should('contain.text', '2 March 2020')
page.getRowData('breach1', 'status', 'Value').should('contain.text', 'An active breach status')

page.getCardHeader('activity1').should('contain.text', '9 of 10 RAR days completed')
page.getCardHeader('activity1').should('contain.text', '12 of 15 RAR days completed')
page.getRowData('activity1', 'appointments', 'Value').should('contain.text', '1 national standard appointments')
page.getRowData('activity1', 'withoutOutcome', 'Value').should('contain.text', '3 without a recorded outcome')

Expand Down
4 changes: 2 additions & 2 deletions integration_tests/e2e/overview.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@ context('Overview', () => {
'(Having possession a picklock or other implement with intent to break into any premises - 18502)',
)
page.getRowData('sentence2', 'order', 'Value').should('contain.text', 'ORA Community Order')
page.getRowData('sentence2', 'requirements', 'Value').should('contain.text', '9 of 10 RAR days completed')
page.getRowData('sentence2', 'requirements', 'Value').should('contain.text', '10 of 10 RAR days completed')
page.getCardHeader('sentence3').should('contain.text', '12 month Community order')
page
.getRowData('sentence3', 'mainOffence', 'Value')
.should('contain.text', 'Breach of Restraining Order (Protection from Harassment Act 1997) - 00831')
page.getRowData('sentence3', 'order', 'Value').should('contain.text', '12 month Community order')
page.getRowData('sentence3', 'requirements', 'Value').should('contain.text', '14 of 16 RAR days completed')
page.getRowData('sentence3', 'requirements', 'Value').should('contain.text', '16 of 20 RAR days completed')
page
.getRowData('activityAndCompliance', 'previousOrders', 'Value')
.should('contain.text', '1 previous orders (No breaches on previous orders)')
Expand Down
4 changes: 2 additions & 2 deletions server/data/model/compliance.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { PersonSummary } from './common'
import { ActivityCount, Compliance, Offence, Order, PreviousOrders, Rar } from './overview'
import { ActivityCount, Compliance, Offence, Order, PreviousOrders } from './overview'

export interface PersonCompliance {
personSummary: PersonSummary
Expand All @@ -13,7 +13,7 @@ export interface SentenceCompliance {
mainOffence: Offence
order: Order
activeBreach?: Breach
rar?: Rar
rarDescription?: string
}

export interface Breach {
Expand Down
2 changes: 1 addition & 1 deletion server/data/model/overview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export interface Sentence {
additionalOffences: Offence[]
mainOffence: Offence
order?: Order
rar?: Rar
rarDescription?: string
}

export interface Rar {
Expand Down
4 changes: 2 additions & 2 deletions server/views/pages/compliance/_compliance-current-order.njk
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@

{% set complianceStatus = getComplianceStatus(failureToComplyCount, sentence.compliance.breachStarted) %}

{% if sentence.rar and sentence.rarCategory %}
{% if sentence.rarDescription and sentence.rarCategory %}
{% set queryParams = '?requirement=' + sentence.rarCategory | toSlug %}
{% set requirements %}
{{ sentence.rar.completed }} of {{ sentence.rar.totalDays }} RAR days completed
{{ sentence.rarDescription }}
{% endset %}
{% else %}
{% set requirements = false %}
Expand Down
4 changes: 2 additions & 2 deletions server/views/pages/overview.njk
Original file line number Diff line number Diff line change
Expand Up @@ -295,8 +295,8 @@
{% endif %}
{% endset %}
{% set requirements %}
{% if sentence.rar %}
{{ sentence.rar.completed }} of {{ sentence.rar.totalDays }} RAR days completed
{% if sentence.rarDescription %}
{{ sentence.rarDescription }}
{% endif %}
{% endset %}
{% set mainOffence %}
Expand Down
6 changes: 1 addition & 5 deletions wiremock/mappings/X000001-compliance.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,7 @@
"startDate": "2020-03-02",
"status": "An active breach status"
},
"rar": {
"completed": 9,
"scheduled": 1,
"totalDays": 10
},
"rarDescription": "12 of 15 RAR days completed",
"rarCategory": "RAR Category"
},
{
Expand Down
12 changes: 2 additions & 10 deletions wiremock/mappings/X000001-full.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,7 @@
"endDate": "2024-12-01",
"startDate": "2023-12-01"
},
"rar": {
"completed": 14,
"scheduled": 2,
"totalDays": 16
}
"rarDescription": "16 of 20 RAR days completed"
},
{
"additionalOffences": [
Expand All @@ -98,11 +94,7 @@
"endDate": "2024-09-01",
"startDate": "2020-03-02"
},
"rar": {
"completed": 9,
"scheduled": 1,
"totalDays": 10
}
"rarDescription": "10 of 10 RAR days completed"
}
],
"activity": {
Expand Down
Loading