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.
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
In order to run the application you need to have SBT installed. Then, it is enough to start the service with:
sbt run
This repository contains unit tests for the service. In order to run them, simply execute:
sbt test
You may want to point to a non-local frontend Assets server. If so then simply set an environment variable ASSETS_URL
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.
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
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.
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.
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:
- Country codes Last updated 17 March 2023
- Authorisation codes (3/39 in tariff) Last updated 1 July 2022
- UK Office of Exit codes (5/12 in tariff) Last updated 17 April 2023
- Document type codes (previous document page) (2/1 in tariff) Last published: 1 August 2018
- Package Type codes (6/9 in tariff) Last published: 1 August 2018
- Customs supervising office codes (5/27 in tariff) Last updated 13 March 2023
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>
This code is open source software licensed under the Apache 2.0 License