top of page

Ministry of Justice

Calculating accurate payments for moves across the criminal justice system

Ministry of Justice 1.webp

Project: Calculating accurate payments for moves across the criminal justice system

We designed and delivered a service that enables data assurance to accurately and automatically calculates payments to suppliers for moves across the criminal system


Since January 2020, Talent Consulting have been working with the Prisoner Escort and Custody Services programme to deliver ‘Book a Secure Move’. This service enables users to request moves from police stations, prisons, custody suites and courts, in order to move people within the criminal justice system between these establishments. 


As part of this project, we developed the ‘Calculate Journey Variable Payments’ service, integrating data from ‘Book a Secure Move’ to automatically price moves monthly. This enables Ministry of Justice Finance, Assurance and Commercial teams to ensure supplier invoices are correct. The Ministry of Justice’s team were facing several issues. The Commercial team were unable to quickly audit and calculate the payment for a supplier for a given period, primarily relying on supplier invoices and spreadsheets to calculate payments and needing to manually add and price new journeys within a ‘Journey Price Catalogue’ (JPC). 


In addition, Assurance and Finance teams need to manually complete checks and assure moves from the previous month (approx. 5,000 moves). From a technical perspective, this project was interesting due to the required integration with third-party suppliers, requiring a RESTful API to interact with the service to book moves to be documented prior to suppliers commencing integration work. Being a Government digital project, it also needed to adhere to the Technology Code of Practice, meet the GDS Service Standard and integrate with in-flight services being delivered in the Digital Prison Service area, including the Prison API and Auth Service. 


Finally, our service needed to be deployed to the Ministry of Justice’s Kubernetes (AWS, EKS) Cloud platform and meet the necessary standards.


Uncovering user needs and business requirements

During initial research, our objectives were to uncover requirements, dependencies, and opportunities for improved data quality and efficiency. We conducted focus groups along with individual user and stakeholder interviews to understand the processes, workflow, user needs and business requirements. We created a service map of the existing process, recording the different users (whether Commercial, Assurance or Finance), the tasks they’d need to perform, and the systems that would need to work together to make those tasks happen. As part of this service map, we logged all the pain points and issues users were having, which became our basis for the MVP and was used to inform what our front-end service should look like.

Picture 3.png
Conducting research with real users in context

Ensuring an easy-to-use service that is consistent

To provide a consistent look and feel for users, we used the same design patterns as the ones we’d created for the ‘Book a Secure Move’ service and conducted usability testing with real users in order to refine our solutions over multiple iterations. During the coronavirus pandemic, we seamlessly switched to remote testing, minimising any disruption to progress.

Picture 4.png
Making data consistent

Aligning the technology stack

To align with HMPPS’s technology stack, we developed the JPC using Spring Boot and Kotlin (a JVM based language). We used Gradle to define our build file and library dependencies, Spring Security for integration with the single sign-on Auth Service (this handled the OAuth2 dance, parsed JWTs and ensure users had authorisation to use the service). We used Apache POI for parsing and creating Excel spreadsheets and provided RESTful web service integration using Spring MVC. We used Spring Data and JPA to store and retrieve data from a Postgres database and used the AWS Java SDK to retrieve reporting data from blob storage (S3). Unit tests (Junit, assert4j, Mockito) ran in the cloud platform’s Circle CI instance (alerting any issues to Slack), and Docker images were built upon success and deployed to the Kubernetes cluster (EKS).


We configured the infrastructure via code (Terraform, Helm Charts, Kubernetes Secretes, gitcrypt). Logging was via Application Insights and we enhanced this with Elastic APM for further monitoring. We used Sentry for alerting and held daily meetings to discuss logs and alerts and prioritise support issues.


From the start we ensured all code was clean and well tested. We made good use of Kotlin’s features including favouring concise, functional programming, preferring immutable objects, preventing reassignment of variables and preventing unexpected null access. This made for a codebase that was easy to reason with and less likely to contain bugs.


We worked closely with developers from HMPPS to ensure all frameworks and libraries adhered to their technology stack and cloud hosting platform, and successfully handed the service over to their developers after the delivery phase.


Talent Consulting were able to deliver the complete service in just 12 weeks – this was achievable due to the small size of our team, which allows us to stay nimble and quickly action any changes. Since then, we have received overwhelmingly positive feedback from senior-level stakeholders. The service removed the need to manually check all standard moves, allowing teams to focus on more complicated moves, while ensuring correct pricing and payments to suppliers on a per move basis, reducing the requirement to manually audit supplier invoices. The Finance team no longer needs to assure pricing and can now focus on forecasting and budgeting.


All sensitive information is now completely secure


of the moves are now automatically costed and do not need to be assured by operational teams


new unique journeys are being added each month – meaning they will automatically be costed in the future


Thank you for the excellent work, perseverance and super-human effort seen across the teams to deliver the significant solutions and services which have been provided on behalf of the PECS Generation 4 Programme so far. The systems, engagement, supporting services and continued improvements that have been delivered to colleagues across the justice estate have proven to be not only well received, but also facilitating significant positive change in this environment.

- Robert Urquhart, Senior Business Change Lead, MOJ

Get in touch

Whether you are just looking to find out more or discus what we can do for your organisation -
say hello and we’ll get back to you! 

bottom of page