Giter Club home page Giter Club logo

hmrc.customs-declare-imports-frontend's Introduction

CDS Import Declarations Frontend

Download

This application provides a GOV.UK frontend for the Customs Declarations API that enables users to submit an import declaration online. The project is currently in the early stages of development.

Technical Notes

Dependencies

In order to deliver required functionality, this frontend interacts with a number of other HMRC microservices. These are:

If you are using HMRC's service manager, then you can start all of the above dependencies using a pre-configured profile:

  • sm --start CDS_IMPORTS_ALL -f will start the latest snapshot version of the CDS Import Declarations Frontend and all dependent services, including those required for testing or running in development
  • sm --start CDS_IMPORTS_DEPS -f will start all the dependent services; i.e. excluding this frontend itself
  • sm --start GG_AUTH_SERVICES -f will start only the dependencies required to satisfy authentication, which is often sufficient for the purposes of ongoing development work

When running locally for the purposes of development, you will additionally need to ensure that you have created an API subscription which grants permission for this application to access the Customs Declarations API. To achieve this, execute the following CURL command:

curl -v -X PUT "http://localhost:9650/field/application/customs-declare-imports-frontend/context/customs%2Fdeclarations/version/2.0" -H "Cache-Control: no-cache" -H "Content-Type: application/json" -d '{ "fields" : { "callback-url" : "http://localhost:6789/customs-declare-imports", "token" : "abc59609za2q" } }'

Feature Switching

In order to facilitate continuous integration, A/B testing, and live support, the CDS Import Declarations Frontend supports feature toggles. In the provided implementation, "features" have one of three potential states:

  • enabled - the feature is "on".
  • disabled - the feature is "off".
  • suspended - the feature is "currently unavailable" (should only be used on a temporary basis for the purposes of live support).

Features can be "switched" on a per-endpoint basis using the switch action. Via this mechanism, enabled actions will return as expected, those that are disabled will return a 404 Not Found status, and those that are suspended will return 503 Service Unavailable.

Features can also be "switched" on a more granular basis using conditional checks in code that utilise the feature status check support provided in AppConfig.

In order to determine the status of any given feature, the following locations are checked, in order:

  1. System properties
  2. The packaged application configuration (i.e. application.conf)
  3. The defaultFeatureStatus (which is set to be disabled by default)

Out-of-the-box, all features should be configured to have the default status. They should only be enabled on a per-environment basis using the mechanisms that are provided to achieve this.

The system or configuration property names for features follow a convention in the form microservice.services.customs-declare-imports-frontend.features.{featureName}

When running outside of production or live-like environments, the application provides an endpoint which can be used to update a feature status. Use curl -X GET http://$CDS_IMPORTS_HOST/customs-declare-imports/test-only/feature/{featureName}/{status}. For example, to update the default feature status to enabled, you could do curl -X GET http://$CDS_IMPORTS_HOST/customs-declare-imports/test-only/feature/default/enabled. Alternatively, you could pass the same system property when starting the application; e.g. sbt "run -Dmicroservice.services.customs-declare-imports-frontend.features.default=enabled"

###TestEndpoints

in order to enable the test endpoint we need to specify that we use a different router when starting play. sbt run -Dapplication.router=testOnlyDoNotUseInAppConf.Routes

License

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

hmrc.customs-declare-imports-frontend's People

Contributors

alan-zetland avatar benjaminparker avatar d6fb avatar gorkemunsal avatar hmrc-web-operations avatar iteratoruk avatar kathaitgunjan avatar kurtlogan avatar mattclark-zerogravit avatar raghu1978 avatar russellthorn avatar shahnaazr avatar tomasz-rosiek avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.