Skip to content

Commit

Permalink
Ensure NOMIS agency IDs are output in CSV
Browse files Browse the repository at this point in the history
This the CSV presenter to use the NOMIS
agency ID property.

It also updates the mock CSV to ensure if the value is present it
will be output to the CSV.
  • Loading branch information
teneightfive committed Jul 24, 2019
1 parent a534b75 commit d4aec12
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 29 deletions.
4 changes: 2 additions & 2 deletions common/presenters/moves-to-csv.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,15 @@ const move = [
},
{
label: 'From location code',
value: 'from_location.location_code',
value: 'from_location.nomis_agency_id',
},
{
label: 'To location name',
value: 'to_location.title',
},
{
label: 'To location code',
value: 'to_location.location_code',
value: 'to_location.nomis_agency_id',
},
{
label: 'Move date',
Expand Down
4 changes: 2 additions & 2 deletions test/fixtures/api-client/move.get.deserialized.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,14 @@
"type": "locations",
"title": "HMP Leeds",
"location_type": "prison",
"nomis_agency_id": null
"nomis_agency_id": "LDS"
},
"to_location": {
"id": "c4814e3f-ee9f-4f08-a515-94fc0afe6eb2",
"type": "locations",
"title": "Barrow in Furness County Court",
"location_type": "court",
"nomis_agency_id": null
"nomis_agency_id": "BFCC"
}
}
}
4 changes: 2 additions & 2 deletions test/fixtures/api-client/move.get.serialized.json
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@
"attributes": {
"title": "HMP Leeds",
"location_type": "prison",
"nomis_agency_id": null
"nomis_agency_id": "LDS"
}
},
{
Expand All @@ -139,7 +139,7 @@
"attributes": {
"title": "Barrow in Furness County Court",
"location_type": "court",
"nomis_agency_id": null
"nomis_agency_id": "BFCC"
}
}
]
Expand Down
22 changes: 11 additions & 11 deletions test/fixtures/api-client/moves.get.deserialized.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,15 @@
"key": "hmp_dartmoor",
"title": "HMP Dartmoor",
"location_type": "prison",
"nomis_agency_id": null
"nomis_agency_id": "DTM"
},
"to_location": {
"id": "54714961-3b18-4a01-b65e-93c3991de37a",
"type": "locations",
"key": "axminster_crown_court",
"title": "Axminster Crown Court",
"location_type": "court",
"nomis_agency_id": null
"nomis_agency_id": "ACC"
}
}, {
"id": "271c95bc-359d-4413-ac63-364c4521a67f",
Expand Down Expand Up @@ -154,7 +154,7 @@
"key": "axminster_crown_court",
"title": "Axminster Crown Court",
"location_type": "court",
"nomis_agency_id": null
"nomis_agency_id": "ACC"
}
}, {
"id": "2f1ab125-6d5a-4621-affe-c5f1e96e53d6",
Expand Down Expand Up @@ -231,7 +231,7 @@
"key": "axminster_crown_court",
"title": "Axminster Crown Court",
"location_type": "court",
"nomis_agency_id": null
"nomis_agency_id": "ACC"
}
}, {
"id": "17a7c1cf-e3dd-4d28-8162-d2f54ce477f5",
Expand Down Expand Up @@ -308,7 +308,7 @@
"key": "axminster_crown_court",
"title": "Axminster Crown Court",
"location_type": "court",
"nomis_agency_id": null
"nomis_agency_id": "ACC"
}
}, {
"id": "417449a3-8ef2-48e4-9379-7fbbf74ceed4",
Expand Down Expand Up @@ -385,7 +385,7 @@
"key": "axminster_crown_court",
"title": "Axminster Crown Court",
"location_type": "court",
"nomis_agency_id": null
"nomis_agency_id": "ACC"
}
}, {
"id": "20e2495b-e86c-40f1-a066-9fdb79d884e2",
Expand Down Expand Up @@ -462,7 +462,7 @@
"key": "axminster_crown_court",
"title": "Axminster Crown Court",
"location_type": "court",
"nomis_agency_id": null
"nomis_agency_id": "ACC"
}
}, {
"id": "8fe0a416-4aa9-4b82-ada5-810cec881e42",
Expand Down Expand Up @@ -539,7 +539,7 @@
"key": "axminster_crown_court",
"title": "Axminster Crown Court",
"location_type": "court",
"nomis_agency_id": null
"nomis_agency_id": "ACC"
}
}, {
"id": "81a4d40d-a007-4d3a-beb8-c5334ea42b36",
Expand Down Expand Up @@ -616,7 +616,7 @@
"key": "axminster_crown_court",
"title": "Axminster Crown Court",
"location_type": "court",
"nomis_agency_id": null
"nomis_agency_id": "ACC"
}
}, {
"id": "d02a534f-96e7-4fae-8818-3b71cb596f21",
Expand Down Expand Up @@ -693,7 +693,7 @@
"key": "axminster_crown_court",
"title": "Axminster Crown Court",
"location_type": "court",
"nomis_agency_id": null
"nomis_agency_id": "ACC"
}
}, {
"id": "eddc9f3a-4c2f-4853-88ea-b7fa0872fc16",
Expand Down Expand Up @@ -770,7 +770,7 @@
"key": "axminster_crown_court",
"title": "Axminster Crown Court",
"location_type": "court",
"nomis_agency_id": null
"nomis_agency_id": "ACC"
}
}, {
"id": "3959d016-451b-4acd-8698-e84fcbdd6acb",
Expand Down
4 changes: 2 additions & 2 deletions test/fixtures/api-client/moves.get.serialized.json
Original file line number Diff line number Diff line change
Expand Up @@ -708,7 +708,7 @@
"key": "hmp_dartmoor",
"title": "HMP Dartmoor",
"location_type": "prison",
"nomis_agency_id": null
"nomis_agency_id": "DTM"
}
},
{
Expand All @@ -718,7 +718,7 @@
"key": "axminster_crown_court",
"title": "Axminster Crown Court",
"location_type": "court",
"nomis_agency_id": null
"nomis_agency_id": "ACC"
}
},
{
Expand Down
20 changes: 10 additions & 10 deletions test/fixtures/moves.csv
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
"Request reference","From location name","From location code","To location name","To location code","Move date","PNC number","Last name","First name(s)","Date of birth","Gender","Ethnicity","Ethnicity code","Violent","Violent details","Escape","Escape details","Self harm","Self harm details","Sign or other language interpreter","Sign or other language interpreter details","Medication","Medication details","Health issue","Health issue details"
"XRW6A5HP","HMP Dartmoor",,"Axminster Crown Court",,"2019-07-13","11223344","Ondricka","Raymond","1959-08-13","Transexual","Mixed (White and Asian)","M3",false,,false,,false,,false,,true,"Anti-biotics taken three-times daily",true,"Broken arm"
"F5XUHAE2","HMP/YOI Bronzefield",,"Axminster Crown Court",,"2019-07-04",,"O'Connell","Virgina","1967-02-25","Male","Mixed (White and Black Caribbean)","M1",false,,true,"Climber",false,,false,,false,,false,
"FA3RC7JT","HMP/YOI Hewell",,"Axminster Crown Court",,"2019-07-04",,"Schowalter","Enedina","1993-10-13","Transexual","Mixed (White and Black Caribbean)","M1",false,,false,,false,,false,,false,,true,"Keeps complaining of headaches"
"CE68R53U","HMP/YOI Portland",,"Axminster Crown Court",,"2019-07-22",,"Kilback","Antonia","1964-04-27","Transexual","Any other ethnic group","O9",false,,false,,false,,false,,true,"Anti-biotics taken three-times daily",false,
"8JH1NP2K","HMIRC The Verne",,"Axminster Crown Court",,"2019-06-29",,"Runolfsdottir","Eliseo","1992-11-01","Transexual","Mixed (White and Asian)","M3",false,,false,,false,,false,,false,,false,
"JTAE83RM","HMP Lindholme",,"Axminster Crown Court",,"2019-07-16",,"Bartell","Hilda","1939-07-26","Transexual","Mixed (White and Asian)","M3",false,,true,"Climber",false,,false,,false,,true,"Broken arm"
"M6XPC51T","HMP/YOI Warren Hill",,"Axminster Crown Court",,"2019-07-20",,"Sipes","Aubrey","1970-05-26","Female","Any other ethnic group","O9",false,,false,,true,"Attempted suicide",false,,false,,false,
"KN1CHMX7","HMP/YOI Sudbury",,"Axminster Crown Court",,"2019-07-10",,"Kozey","Carson","1957-03-05","Female","Mixed (White and Black Caribbean)","M1",false,,false,,false,,true,"Only speaks Welsh",false,,false,
"XJCAR28E","HMP/YOI Altcourse",,"Axminster Crown Court",,"2019-07-12",,"Ratke","Dane","1939-08-25","Male","Asian or Asian British (Other)","A9",false,,false,,false,,false,,false,,false,
"58MF76N2","HMP Long Lartin",,"Axminster Crown Court",,"2019-07-07",,"Schultz","Kati","1944-12-31","Female","Black (Other)","B9",false,,false,,false,,false,,false,,false,
"XRW6A5HP","HMP Dartmoor","DTM","Axminster Crown Court","ACC","2019-07-13","11223344","Ondricka","Raymond","1959-08-13","Transexual","Mixed (White and Asian)","M3",false,,false,,false,,false,,true,"Anti-biotics taken three-times daily",true,"Broken arm"
"F5XUHAE2","HMP/YOI Bronzefield",,"Axminster Crown Court","ACC","2019-07-04",,"O'Connell","Virgina","1967-02-25","Male","Mixed (White and Black Caribbean)","M1",false,,true,"Climber",false,,false,,false,,false,
"FA3RC7JT","HMP/YOI Hewell",,"Axminster Crown Court","ACC","2019-07-04",,"Schowalter","Enedina","1993-10-13","Transexual","Mixed (White and Black Caribbean)","M1",false,,false,,false,,false,,false,,true,"Keeps complaining of headaches"
"CE68R53U","HMP/YOI Portland",,"Axminster Crown Court","ACC","2019-07-22",,"Kilback","Antonia","1964-04-27","Transexual","Any other ethnic group","O9",false,,false,,false,,false,,true,"Anti-biotics taken three-times daily",false,
"8JH1NP2K","HMIRC The Verne",,"Axminster Crown Court","ACC","2019-06-29",,"Runolfsdottir","Eliseo","1992-11-01","Transexual","Mixed (White and Asian)","M3",false,,false,,false,,false,,false,,false,
"JTAE83RM","HMP Lindholme",,"Axminster Crown Court","ACC","2019-07-16",,"Bartell","Hilda","1939-07-26","Transexual","Mixed (White and Asian)","M3",false,,true,"Climber",false,,false,,false,,true,"Broken arm"
"M6XPC51T","HMP/YOI Warren Hill",,"Axminster Crown Court","ACC","2019-07-20",,"Sipes","Aubrey","1970-05-26","Female","Any other ethnic group","O9",false,,false,,true,"Attempted suicide",false,,false,,false,
"KN1CHMX7","HMP/YOI Sudbury",,"Axminster Crown Court","ACC","2019-07-10",,"Kozey","Carson","1957-03-05","Female","Mixed (White and Black Caribbean)","M1",false,,false,,false,,true,"Only speaks Welsh",false,,false,
"XJCAR28E","HMP/YOI Altcourse",,"Axminster Crown Court","ACC","2019-07-12",,"Ratke","Dane","1939-08-25","Male","Asian or Asian British (Other)","A9",false,,false,,false,,false,,false,,false,
"58MF76N2","HMP Long Lartin",,"Axminster Crown Court","ACC","2019-07-07",,"Schultz","Kati","1944-12-31","Female","Black (Other)","B9",false,,false,,false,,false,,false,,false,
"M48TYU2R","HMP Coldingley",,"Barnstaple Magistrates Court",,"2019-07-17",,"Bergnaum","Alex","1962-08-15","Transexual","White (Irish)","W2",false,,true,"Former miner",false,,false,,false,,true,"Heart condition"
"4CAFTK2R","HMP/YOI Belmarsh",,"Barnstaple Magistrates Court",,"2019-07-17",,"Mante","Fernando","1989-11-28","Transexual","Asian or Asian British (Bangladeshi)","A3",false,,false,,false,,true,"Only speaks Welsh",false,,true,"Heart condition"
"KYRFHN8C","HMP/YOI Eastwood Park",,"Barnstaple Magistrates Court",,"2019-07-12",,"Sipes","Aubrey","1970-05-26","Female","Any other ethnic group","O9",false,,false,,true,"Attempted suicide",false,,false,,false,
Expand Down

0 comments on commit d4aec12

Please sign in to comment.