Giter Site home page Giter Site logo

shubhm13 / transparent-supply-examples Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ibm/transparent-supply-examples

0.0 0.0 0.0 427 KB

Examples showing how to use APIs to integrate with IBM Blockchain Transparent Supply

License: Apache License 2.0

TypeScript 100.00%

transparent-supply-examples's Introduction

Welcome to the IBM Blockchain Transparent Supply™ Examples!

Trace API examples

The code in this repository is intended to be a collection of code examples that exemplify the capabilities of the IBM Blockchain Transparent Supply API. Currently this is focused only on the Trace APIs, defined here: http://developer.transparentsupply.ibm.com/ift/api/outbound/api-docs/ *. These examples show how to access your entitled data in Blockchain Transparent Supply to solve real world problems.

* All references to URLs containing developer.transparentsupply.ibm.com require signing up for a trial to the Transparent Supply Developer Playground to get access, but can be replaced with the base domain for any existing IBM Food Trust or Blockchain Transparent Supply customers (e.g. food.ibm.com)

harvested-epcs

This returns a list of EPCs that were harvested from a particular location within a particular timeframe, for a set of GTINs (product IDs). This leverages the 'events' endpoint.

impacted-epcs

This returns a list of EPCs that contain ingredients harvested from a particular location within a particular timeframe, for a set of GTINs. This leverages the 'events' endpoint and assumes that the harvested EPCs were transformed directly into other EPCs (or were never transformed), and does not attempt to handle multiple layers of transformation, or aggregations into transformations.

impacted-transactions

This returns a list of transaction identifiers (purchase order IDs and despatch advice IDs) that contain ingredients that were harvested from a particular location within a particular timeframe, for a set of GTINs. This again uses the 'events' endpoint and assumes that the harvested EPCs were transformed directly into other EPCs (or were never transformed), and does not attempt to handle multiple layers of transformation, or aggregations into transformations. It also assumes that the impacted EPCs are shipped to a partner as a child of an aggregation event and that the transaction IDs are referenced on that event.

ingredient-sources

This returns a list of products with their final locations alongside their ingredients and the source locations for each of the ingredients. This will make assumptions about the overall flow of products (it will assume a STORE is a more likely final location than a FARM, and the reverse for source locations). In CSV format, it will also limit the final/source locations to a single location each, sorted by timestamp and by the assumption described previously. This uses a variety of endpoints including the 'trace' endpoint.

product-destinations

This endpoint will provide a list of ingredients and the source locations alongside the most downstream product they produce (same formatting as /ingredient-sources). This will make assumptions about the overall flow of products (it will assume a STORE is a more likely final location than a FARM, and the reverse for source locations). In CSV format, it will also limit the final/source locations to a single location each, sorted by timestamp and by the assumption described previously.

Usage

  1. Clone the code locally
  2. Nagigate to the top level, and execute:
    • npm install
    • npm run build
    • npm run start
  3. From your browser, open http://localhost:5474/api-samples/recall-assistant/v1/swagger/

There is also the option to use our command line interface

  1. Clone the code locally
  2. Nagigate to the top level, and execute:
    • npm install
    • npm run build
  3. Run either of the following commands to see the parameters available parameters
    • npm run cli -- -h
    • node bin/assistant-cli.js -h

Product and facility IDs

This application requires entering product and facility identifiers as inputs. The products page and facilities page shows the products available if you choose "All" from the Organization selector. Please note that products and facility identifiers will show in a truncated format if they leverage an IBM solution identifier, so urn:ibm:ift:product:class: may need to be prepended to a product ID or urn:ibm:ift:location:loc: to a facility ID if values are copied from those pages.

transparent-supply-examples's People

Contributors

nrbarry avatar maxzuo avatar p-marinha avatar dependabot[bot] avatar joshhus avatar btarant avatar stevemar avatar d-soroker 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.