Skip to content

hmrc/universal-credit-liability-api

Repository files navigation

universal-credit-liability-api

Overview

This API provides the capability for DWP to send Universal Credit Liability notifications for a given individual on NPS (National Insurance & PAYE Service).

Endpoint

Insert/Terminate Universal Credit Liability Details

Endpoint: POST /misc/universal-credit/liability/notification

Description: Provides the capability to insert and terminate Universal Credit Liability details for a given individual.

Running Locally

Compile the project with:

sbt clean compile update

Run the project locally with:

sbt run

By default, the service runs on port 16107.

Running with Service Manager

Use Service Manager to start all the services required to run and test Universal Credit Liability service locally.

Start the UNIVERSAL_CREDIT_LIABILITY_ALL profile, responsible for starting up all the services required, with:

sm2 --start UNIVERSAL_CREDIT_LIABILITY_ALL

Testing

Run unit tests with:

sbt test

Run integration tests with:

sbt it/test

Check code coverage with:

sbt clean coverage test it/test coverageReport

Previewing the OpenAPI Specification

To preview the OpenAPI Specification (OAS) locally, start the DEVHUB_PREVIEW_OPENAPI service with Service Manager:

sm2 --start DEVHUB_PREVIEW_OPENAPI

If the service is running on the Service Manager, stop it:

sm2 --stop UNIVERSAL_CREDIT_LIABILITY_API

and run the service locally:

sbt run

Go to the local preview page at http://localhost:9680/api-documentation/docs/openapi/preview

In the URL field enter the URL of the OpenAPI Specification (OAS) file:

http://localhost:16107/api/conf/1.0/application.yaml

and click "Submit".

sbt Aliases

These aliases let you run multiple sbt tasks with a single command.

Checks against the Scalafmt and Scalafix rules. This command is part of the PR Builder Jenkins job and fails the PR if the code is not formatted:

sbt prePrChecks

Checks code coverage (includes both unit and integration tests):

sbt checkCodeCoverage

Formats all project code. Applies Scalafix and Scalafmt rules:

sbt lintCode

Scalafmt

Check all project files are formatted as expected as follows:

sbt scalafmtCheckAll scalafmtCheck

Format *.sbt and project/*.scala files as follows:

sbt scalafmtSbt

Format all project files as follows:

sbt scalafmtAll

License

This code is open source software licensed under the Apache 2.0 License.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages