Skip to content

Commit

Permalink
Merge pull request #214 from hmrc/feature/ITSASU-955
Browse files Browse the repository at this point in the history
[ITSASU-955] Update README, add start script
  • Loading branch information
scullythornton1 authored Mar 23, 2022
2 parents e5ea81b + bf075b4 commit 4d9d86e
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 39 deletions.
65 changes: 26 additions & 39 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,62 +1,49 @@
Income Tax Subscription MicroService
====================================
[![Apache-2.0 license](http://img.shields.io/badge/license-Apache-brightgreen.svg)](http://www.apache.org/licenses/LICENSE-2.0.html)
[![Build Status](https://travis-ci.org/hmrc/income-tax-subscription.svg?branch=master)](https://travis-ci.org/hmrc/income-tax-subscription) [ ![Download](https://api.bintray.com/packages/hmrc/releases/income-tax-subscription/images/download.svg) ](https://bintray.com/hmrc/releases/income-tax-subscription/_latestVersion)

This is the protected backend MicroService for the Sign Up to Report your Income and Expenses Quarterly (MTD ITSA) service.
# Income Tax Subscription MicroService

This service provides the backend interactions with other backend MicroServices
This is a scala/Play protected backend MicroService for the Sign Up to Report your Income and Expenses Quarterly (MTD ITSA) service.

### Running the subscription services locally
This service provides the backend interactions with other backend MicroServices.

You will need [sbt](http://www.scala-sbt.org/)
Local development requires:

1) **[Install Service-Manager](https://github.com/hmrc/service-manager/wiki/Install#install-service-manager)**
* [sbt](http://www.scala-sbt.org/)
* MongoDB available on port 27017
* HMRC Service manager (if using the provided scripts)
* [Install Service-Manager](https://github.com/hmrc/service-manager/wiki/Install#install-service-manager)**
* The services in the ITSA_SUBSC_ALL profile (a subset can be used)

# How to start this service (main section)

2) **Start the ITSA subscription dependencies:**
See `scripts/start`

`sm --start ITSA_SUBSC_DEP -f`
The active port is 9560

# How to use

3) **Clone the frontend service:**
The entry page for this service running locally is

- SSH

`git clone [email protected]:hmrc/income-tax-subscription-frontend.git`

- HTTPS

`git clone https://github.com/hmrc/income-tax-subscription-frontend.git`


4) **Start the frontend service:**
http://localhost:9561/report-quarterly/income-and-expenses/sign-up

`sbt "run 9561" -Dapplication.router=testOnlyDoNotUseInAppConf.Routes`


5) **Clone the protected service:**
The entry page for this service on staging (requires HMRC VPN) is

- SSH

`git clone [email protected]:hmrc/income-tax-subscription.git`

- HTTPS

`git clone https://github.com/hmrc/income-tax-subscription.git`


6) **Start the protected service:**
https://www.staging.tax.service.gov.uk/report-quarterly/income-and-expenses/sign-up

# How to test

`sbt "run 9560" -Dapplication.router=testOnlyDoNotUseInAppConf.Routes`
There are two built in test sets: `test` and `it:test`. See build.sbt for details.

7) **Start the stubbed services:**
# Persistence

`sm --start INCOME_TAX_SUBSCRIPTION_STUBS -f`
Data is stored as key/value in Mongo DB. See json reads/writes implementations (especially tests) for details.

8) **Go to the homepage:**
To connect to the mongo db provided by docker (recommended) please use

http://localhost:9561/report-quarterly/income-and-expenses/sign-up
```
docker exec -it mongo-db mongosh
```

### License

Expand Down
25 changes: 25 additions & 0 deletions scripts/start
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/bash

cd $(dirname $0)/..

function die() {
echo "$1"
exit 1
}

MONGO_PORT=27017
which nc &>/dev/null && nc -vz localhost $MONGO_PORT 2>/dev/null || die "Can't find MongoDB on port $MONGO_PORT (using: nc -vz localhost $MONGO_PORT)"

which sm &>/dev/null || die "Can't find Service Manager"

sm --start ITSA_SUBSC_DEP
sm --start AGENTS_TAX_ENROLMENTS
sm --start INCOME_TAX_SUBSCRIPTION_SELF_EMPLOYED_FRONTEND
sm --start INCOME_TAX_SUBSCRIPTION_STUBS
sm --start INCOME_TAX_SUBSCRIPTION_ELIGIBILITY
sm --start INCOME_TAX_SUBSCRIPTION_ELIGIBILITY_FRONTEND
sm --start INCOME_TAX_SUBSCRIPTION_FRONTEND
sm --start TAX_ENROLMENTS

sleep 5
sbt "run 9560 -Dapplication.router=testOnlyDoNotUseInAppConf.Routes"

0 comments on commit 4d9d86e

Please sign in to comment.