Skip to content

hmrc/one-stop-shop-returns-frontend

Repository files navigation

one-stop-shop-returns-frontend

This is the repository for One Stop Shop Returns Frontend

Backend: https://github.com/hmrc/one-stop-shop-returns

Stub: https://github.com/hmrc/one-stop-shop-returns-stub

Requirements

This service is written in Scala and Play, so needs at least a [JRE] to run.

Run the application

To update from Nexus and start all services from the RELEASE version instead of snapshot

sm2 --start ONE_STOP_SHOP_ALL -r

To run the application locally execute the following:

sm2 --stop ONE_STOP_SHOP_RETURNS_FRONTEND

and

sbt 'run 10204'

Running correct version of mongo

We have introduced a transaction to the call to be able to ensure that both the vatreturn and correction get submitted to mongo. Your local mongo is unlikely to be running a latest enough version and probably not in a replica set. To do this, you'll need to stop your current mongo instance (docker ps to get the name of your mongo docker then docker stop to stop) Run at least 4.0 with a replica set:

docker run --restart unless-stopped -d -p 27017-27019:27017-27019 --name mongo4 mongo:4.0 --replSet rs0

Connect to said replica set:

docker exec -it mongo4 mongo

When that console is there:

rs.initiate()

You then should be running 4.0 with a replica set. You may have to re-run the rs.initiate() after you've restarted

Using the application

To log in using the Authority Wizard provide "continue url", "affinity group" and "enrolments" as follows:

image

image

The VRN can be any 9-digit number.

To be able to use the application you need to be registered for the service (instructions to complete a registration can be found here https://github.com/hmrc/one-stop-shop-registration-frontend).

Unit and Integration Tests

To run the unit and integration tests, you will need to open an sbt session on the browser.

Unit Tests

To run all tests, run the following command in your sbt session:

test

To run a single test, run the following command in your sbt session:

testOnly <package>.<SpecName>

An asterisk can be used as a wildcard character without having to enter the package, as per the example below:

testOnly *CheckSalesFromNiControllerSpec

Integration Tests

To run all tests, run the following command in your sbt session:

it:test

To run a single test, run the following command in your sbt session:

it:testOnly <package>.<SpecName>

An asterisk can be used as a wildcard character without having to enter the package, as per the example below:

it:testOnly *RegistrationRepositorySpec

License

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