Giter Club home page Giter Club logo

hmrc.customs-inventory-linking-imports's Introduction

customs-inventory-linking-imports

This service offers an interface for submitting custom inventory linking import declarations.

The objective of the Customs Inventory Linking Imports API is as below:

  1. Receive a post request containing the import inventory linking declaration
  2. Pass the request on to a backend service
  3. Respond to the declarant indicating the success of previous steps.

It is assumed that the underlying backend process is asynchronous, and that the only response to the declarant from this API is to indicate the success (or otherwise) of the validation and submission to the backend service for onward processing.

Seeding Data in api-subscription-fields for local end to end testing

Make sure the api-subscription-fields service is running on port 9650. Then run the below curl command.

  • Note that the UUID 6372609a-f550-11e7-8c3f-9a214cf093aa is the application clientId.
curl -v -X PUT "http://localhost:9650/field/application/6372609a-f550-11e7-8c3f-9a214cf093aa/context/customs%2Finventory-linking-imports/version/1.0" -H "Cache-Control: no-cache" -H "Content-Type: application/json" -d '{ "fields" : { "callbackUrl" : "https://postman-echo.com/post", "securityToken" : "securityToken", "authenticatedEori": "SOMEAUTHEORI" } }'

Seeding data for the customs-notifications-receiver-stub dummy callback endpoint

This endpoint can be used for the callbackUrl field above. For more information on how it can be used and seeded please see the README

Switching service endpoints

Dynamic switching of service endpoints has been implemented for inventory linking imports connector. To configure dynamic switching of the endpoint there must be a corresponding section in the application config file (see example below). This should contain the endpoint config details.

Example

The service customs-inventory-linking-imports has a default configuration and a stub configuration. Note that default configuration is declared directly inside the customs-inventory-linking-imports section.

  services {
    ...

    validatemovement {
      host = some.host
      port = 80
      bearer-token = "some_token"
      context = "/imports-sample-context"

      stub {
        host = localhost
        port = 9479
        bearer-token = "some_stub_token"
         context = "/imports-sample-context"
      }
    }
  }

Useful CURL commands for local testing

link to curl commands

Switch service configuration for an endpoint

REQUEST

default:
curl -X "POST" http://customs-inventory-linking-imports-host/test-only/service/validatemovement/configuration -H 'content-type: application/json' -d '{ "environment": "stub" }'

RESPONSE

The service customs-inventory-linking-imports is now configured to use the stub environment

Switch service configuration to default for an endpoint

REQUEST

curl -X "POST" http://customs-inventory-linking-imports-host/test-only/service/validatemovement/configuration -H 'content-type: application/json' -d '{ "environment": "default" }'

RESPONSE

The service customs-inventory-linking-imports is now configured to use the default environment

Get the current configuration for a service

REQUEST

curl -X "GET" http://customs-inventory-linking-imports-host/test-only/service/validatemovement/configuration

RESPONSE

{
  "service": "validatemovement",
  "environment": "stub",
  "url": "http://currenturl/customs-inventory-linking-imports"
  "bearerToken": "current token"
}

License

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

hmrc.customs-inventory-linking-imports's People

Contributors

cichockimc avatar glidester avatar googley42 avatar hmrc-web-operations avatar joemg avatar mattclark-zerogravit avatar one-off-account avatar paulblakehmrc avatar phil-hargreaves avatar rashadmughal avatar stewabel avatar tomasz-rosiek avatar usmanshabbir 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.