Giter Club home page Giter Club logo

hmrc.customs-data-store's Introduction

customs-data-store

This repository contains the code for a persistent cache holding customs related data.

Path Description
GET /customs-data-store/eori/:eori/verified-email Retrieve the verified email address for a given EORI either from the cache or SUB09
GET /customs-data-store/eori/:eori/eori-history Retrieves the historic eori's for a given EORI either from the cache or SUB21
POST /customs-data-store/update-email Populates a new verified email address in the cache
POST /customs-data-store/update-eori-history Updates the eori history for a given EORI in the cache

GET /eori/:eori/verified-email

An endpoint to retrieve a verified email address for a given EORI

Response body

{
  "address" : "[email protected]",
  "timestamp" : "2020-03-20T01:02:03Z"
}

Response codes

Status Description
200 A verified email has been found for the specified eori
404 No verified email has been found for the specified eori
500 An unexpected failure happened in the service

POST /update-email

An endpoint to update the verified email address for a given EORI

Example request

{
  "eori" : "GB333186811511",
  "address" : "[email protected]",
  "timestamp" : "2020-03-20T01:02:03Z"
}

Fields

Field Required Description
eori Mandatory The eori used to provide a verified email address to
address Mandatory The verified email address for the specified eori
timestamp Mandatory The timestamp when the email was verified

GET /eori/:eori/eori-history

An endpoint that provides a list of all historic EORI's associated with a given EORI

Response body

{
"eoriHistory": [
  {
    "eori": "GB333186811511", 
    "validFrom": "2001-01-20T00:00:00Z", 
    "validTo": "2001-01-20T00:00:00Z"
  },
  {
    "eori": "GB333186811531",
    "validFrom": "2001-01-20T00:00:00Z",
    "validTo": "2001-01-20T00:00:00Z"
  }
]
}

Response codes

Status Description
200 A sequence of historic eori's returned
500 An unexpected failure happened in the service

POST /update-eori-history

An endpoint to populate the historic EORI's for a given EORI

Example request

{
  "eori" : "GB333186811511"
}

Response codes

Status Description
204 Successfully updated the historic EORI's in the cache
500 An unexpected failure happened in the service

Running and testing on localhost:

If you want to run customs-data-store locally then you also have to run customs-financials-hods-stub so that it can retrieve historic Eoris from there.
To start the service from sbt: sbt "run 9893" or from service manager: sm --start CUSTOMS_DATA_STORE CUSTOMS_FINANCIALS_HODS_STUB -f
In Postman

  1. Send in any of above requests to http://localhost:9893/customs-data-store/
  2. Add and Authorization header and set it's value to whatever is in application.conf under the key server-token

License

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

hmrc.customs-data-store's People

Contributors

damienbutterworth avatar derekspalmer avatar ellamdav avatar gabor-dorcsinecz avatar harshare avatar hmrc-web-operations avatar kiranprakashdigital avatar kjainsc avatar marjanmubarok avatar nandanaraghu avatar peter-gyorgyan-cg avatar tarkabab avatar wp94 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.