Skip to content

hmcts/ccfr-fees-register-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Fees Register for HMCTS online services

Quality Gate Status Build Status Codacy Badge codecov

This project provides REST based web services for exposing fees related information for hearing fee and award fees.

Getting Started

This is SpringBoot based java application. Please see the Jenkinsfile in root folder to see the build and deployment pipeline.

Prerequisites

You will need jdk installed on your machine, and the fees_register database running, for which you can run:

docker-compose -f ./docker-compose.yml up fees-database

Installing

  1. Clone the repo to your machine using git clone [email protected]:hmcts/ccfr-fees-register-app.git
  2. Run $ ./gradlew build

Running the tests and other gradle tasks

To test locally all the tasks that run on the Jenkins master branch build, run:

./gradlew test # for unit tests
./gradlew smoke
./gradlew functional # but you will need some environment variables (see next section)
./gradlew fortifyScan
./gradlew pitest # for mutation testing
./gradlew runProviderPactVerification # to verify the provider contracts

Environment variables for functional tests

export OAUTH2_CLIENT_SECRET=ask someone for this
export TEST_URL=http://fees-register-api-aat.service.core-compute-aat.internal       
export IDAM_API_URL=https://idam-api.aat.platform.hmcts.net
export OAUTH2_REDIRECT_URI=https://fees-register-frontend-aat.service.core-compute-aat.internal/oauth2

Deployment

See Jenkinsfile for the deployment details

DB migration task

To run the DB migration task locally, run

./gradlew --no-daemon '-Pdburl=localhost:5432/fees_register' -Pflyway.user=fees_register -Pflyway.password=fees_register migratePostgresDatabase

Run the application

To run the application at local developer machine use following command

./gradlew bootRun

Once application server is started use swagger ui to find the endpoints and test these. http://localhost:8080/swagger-ui.html

or in dev/test environment you can use this link https://dev-proxy.fees-register.reform.hmcts.net/swagger-ui.html or https://test-proxy.fees-register.reform.hmcts.net/swagger-ui.html

Run the application using docker-compose

Please add the below environmental variables in .env in ccfr-fees-register-app/.env

FEE_REGISTER_PASS = fees_register
OPENID_SPRING_DATASOURCE_PASSWORD = openidm
IDAM_SPI_FORGEROCK_AM_PASSWORD = Pa55word11
IDAM_SPI_FORGEROCK_IDM_PASSWORD = openidm-admin
IDAM_SPI_FORGEROCK_IDM_PIN_DEFAULTPASSWORD = BlaBlaBlackSh33p
SECURITY_OAUTH2_CLIENT_CLIENTSECRET = password

Then

docker-compose up 

Service Endpoints

Some of the end points are as below. These might be out of date. Please look at the swagger-ui to be sure.

  • GET /fees-register/cmc
  • GET /fees-register/cmc/categories
  • GET /fees-register/cmc/categories/{id}/ranges/{amount}/fees
  • GET /fees-register/cmc/flat
  • GET /fees-register/cmc/flat/{id}

Service Versioning

We use SemVer for versioning.