Giter Club home page Giter Club logo

ministryofjustice.whereabouts-api's Introduction

whereabouts-api

CircleCI

A Spring Boot app to manage the location (whereabouts) of prisoners for the Digital Prison Services. Backend services for https://github.com/ministryofjustice/prisonstaffhub/.

Swagger API documentation is available (here)[https://whereabouts-api-dev.service.justice.gov.uk/swagger-ui/index.html]

To build:

./gradlew build

Code style & formatting

./gradlew ktlintApplyToIdea addKtlintFormatGitPreCommitHook

will apply ktlint styles to intellij and also add a pre-commit hook to format all changed kotlin files.

To run:

This service requires oauth, prison-api and the offender-case-notes to work. Bootstrap these services by running.

docker-compose up

Health

  • /health/ping: will respond {"status":"UP"} to all requests. This should be used by dependent systems to check connectivity to whereabouts, rather than calling the /health endpoint.
  • /health: provides information about the application health and its dependencies. This should only be used by whereabouts health monitoring (e.g. pager duty) and not other systems who wish to find out the state of whereabouts.
  • /info: provides information about the version of deployed application.

Pre Release Testing

Whereabouts api is best tested by the front end (https://digital-preprod.prison.service.justice.gov.uk). To manually smoke test / regression test whereabouts api prior to release:

  1. Choose a residential wing and click continue
    1. Check sub locations are shown - selecting one should limit listed prisoners to that location
    2. Click attended - select yes reason and enter case note
    3. Click attended - select no reason and choose unacceptable so that IEP functionality triggered
  2. Choose activity / appointment and click continue
    1. Click not attended - select yes reason and enter case note
  3. Click View all appointments and check page loads with data
  4. Click View prisoners unaccounted for and check page loads with data
  5. Click View attendance reason statistics and check page loads with data (generated from yes / no above)

Running against localstack

Localstack has been introduced for some integration tests and it is also possible to run the application against localstack.

  • In the root of the localstack project, run command
rm -rf /tmp/localstack && docker-compose -f docker-compose-localstack.yaml down && TMPDIR=/private$TMPDIR docker-compose -f docker-compose-localstack.yaml up

to clear down and then bring up localstack

  • Start the Spring Boot app with profiles of 'localstack,local,dev'
  • You can now use the aws CLI to send messages to the queue
  • The queue's health status should appear at the local healthcheck: http://localhost:8082/health
  • Note that you will also need local copies of Oauth server, Case notes API and Delius API running to do anything useful

Running the tests

With localstack now up and running (see previous section), run

./gradlew test

ministryofjustice.whereabouts-api's People

Contributors

andrewrlee avatar bell-pa avatar ed209uk avatar gurnankcheema avatar jamiedraperuk avatar jsrobertson avatar lbennett-moj avatar louisenorris avatar matt-crowson-moj avatar mattops avatar mikehalmamoj avatar mjwillis avatar petergphillips avatar robc24 avatar simonmitchellmoj avatar sp-watson avatar steverendell avatar timharrison-moj avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.