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

sm2 --start CDS_EXPORTS_DECLARATION_ALL

Running the application

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

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 = [true/false] - When enabled, all pages in the service have BETA banner.

GDS Components

The service's user interface is always built using the components provided by the play-frontend-hmrc library except for two of them due to the service's business requirements.

  • The "Summary" Card Twirl template was required as the Card component provided by play-frontend-hmrc can only contain a single SummaryList, via GovukSummaryList, whereas the service instead requires Card(s) potentially containing more than one of them.
    What's more, each SummaryList might be prefixed, meaning outside the Html of the SummaryList, with specific heading tags (H3).
    However, when used with a single SummaryList, our "Summary" Card template generates the same Html, with the same CSS classes, as generated by directly passing a Card to a GovukSummaryList.

  • The dashboard/pagination and the drafts/pagination Twirl templates were required to support loading a single "page" of documents on demand, as the service, for each of its users, might store an indefinite number of declarations, potentially ten of thousands.
    However, they generate the same Html, with the same CSS classes, as the Html component sampled at GDS pagination.

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:

License

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

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors