Skip to content

hmrc/customs-declare-exports-frontend

Repository files navigation

customs-declare-exports-frontend

Summary

This public-facing microservice is part of Customs Exports Declaration Service (CEDS). It is designed to work in tandem with customs-declare-exports service.

It provides functionality to submit and manage exports declarations.

Prerequisites

This service is written in Scala and Play, so needs at a JRE to run and a JDK for development.

This service does not use MongoDB.

This service depends on other services. The easiest way to set up required microservices is to use Service Manager and profiles from service-manager-config repository:

  • CDS_EXPORTS_DECLARATION_DEPS - all services EXCEPT both declarations services
  • CDS_EXPORTS_DECLARATION_ALL - all services together with both declarations services

Running the application

In order to run the application you need to have SBT installed. Then, it is enough to start the service with:

sbt run

Testing the application

This repository contains unit tests for the service. In order to run them, simply execute:

sbt test

Developer notes

You may want to point to a non-local frontend Assets server. If so then simply set an environment variable ASSETS_URL

Feature flags

This service uses feature flags to enable/disable some of its features. These can be changed/overridden in config under microservice.services.features.<featureName> key.

The list of feature flags and what they are responsible for:

betaBanner = [enabled/disabled] - When enabled, all pages in the service have BETA banner.

ead = [enabled/disabled] - When enabled, page under url /submissions/[ID]/information may contain link to generate Exports Accompanying Document.

sfus = [enabled/disabled] - When enabled, page under url /submissions/[ID]/information may contain link to Secure File Upload Service.

use-improved-error-messages = [true/false] - When enabled, DMS errors have descriptions made by Exports team designers. Otherwise, they have default CDS descriptions.

Scalastyle

Project contains scalafmt plugin.

Commands for code formatting:

scalafmt        # format compile sources
test:scalafmt   # format test sources
sbt:scalafmt    # format .sbt source

To ensure everything is formatted you can check project using commands below

scalafmt::test      # check compile sources
test:scalafmt::test # check test sources
sbt:scalafmt::test  # check .sbt sources

Pre-merge check

There is a script called precheck.sh that runs all tests, examine their coverage and check if all the files are properly formatted. It is a good practise to run it just before pushing to GitHub.

Auto Complete

This project has a TamperMonkey (Google Chrome) or GreaseMonkey (Firefox) Auto Complete Script to help speed through the form journey.

These scripts can be found in the docs directory.

Tariff Code lists

As per Exports Product Manager and CDS Stakeholders instructions, the CDS Tariff is our source of truth for any CDS codes going forward, until further instructions or until we connect with a service that provides this data for us.

We use the following codes:

Generating TDRSecret values for a given EORI

As this service deployed in ExternalTest as part of the CDS Trader Dress Rehearsal, an additional enrolment value of 'TDRSecret' is required for a user to successfully authenticate in this environment.

To generate a valid 'TDRSecret' value for a user you can call the following program replacing the two <???> parameters with the appropriate values:

sbt "runMain utils.GenerateTdrSecret <tdrHashSalt> <eori>"

Note the <eori> parameter can be a comma delimited list of EORIs (if you want to generate multiple 'TDRSecret' values at any one time).

The output of the program is: <eori>,<newGeneratedTdrSecret>

License

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