Coder Social home page Coder Social logo

mlfunston / node-red-contrib-iata-bcbp Goto Github PK

View Code? Open in Web Editor NEW
4.0 1.0 0.0 77 KB

Node Red nodes to decode and encode IATA Resolution 792 Compliant Boarding Pass Barcodes

License: GNU General Public License v3.0

HTML 73.23% JavaScript 26.77%
node-red bcbp iata boardingpass

node-red-contrib-iata-bcbp's Introduction

node-red-contrib-iata-bcbp

GitHub version GitHub issues GitHub license Twitter

A set of Node-Red nodes to decode and encode IATA Resolution 792 Compliant Boarding Pass Barcode Data.

This is a Node-Red wrapper for the work by georgesmith46's bcbp NPM node https://github.com/georgesmith46/bcbp.

Installing and Setting up

Add the IATA BCBP node to node-red through the manage palette tab or command line.

Usage

Here's an example of basic usage:

example

Example Flow

User guide

Encode Node

Converts a JSON object to a BCBP string. Any of the following parameters can be skipped (except legs).

Object Structure

Name Description Example values
passengerName Passenger Name
  • DESMARAIS/LUC
  • DOE/JOHN
passengerDescription Passenger Description
  • 0 - Adult
  • 1 - Male
  • 2 - Female
  • 3 - Child
  • 4 - Infant
  • 5 - No passenger (cabin baggage)
  • 6 - Adult travelling with infant
  • 7 - Unaccompanied minor
checkInSource Source of check-in
  • W - Web
  • K - Airport Kiosk
  • R - Remote or Off Site Kiosk
  • M - Mobile Device
  • O - Airport Agent
  • T - Town Agent
  • V - Third Party Vendor
boardingPassIssuanceSource Source of Boarding Pass Issuance
  • W - Web
  • K - Airport Kiosk
  • X - Transfer Kiosk
  • R - Remote or Off Site Kiosk
  • M - Mobile Device
  • O - Airport Agent
  • T - Town Agent
  • V - Third Party Vendor
issuanceDate Date of Issue of Boarding Pass
  • 6225
  • ISO 8601 formatted string
  • Moment.js object
  • JavaScript date object
documentType Document Type
  • B - Boarding Pass
  • I - Itinery Receipt
boardingPassIssuerDesignator Airline Designator of boarding pass issuer
  • AC
baggageTagNumber Baggage Tag Licence Plate Number(s)
  • 0014123456003
firstBaggageTagNumber 1st Non-Consecutive Baggage Tag Licence Plate Number
  • 0014123456003
secondBaggageTagNumber 2nd Non-Consecutive Baggage Tag Licence Plate Number
  • 0014123456003
securityDataType Type of Security Data
  • 1
securityData Security Data
  • GIWVC5EH7JNT...
legs Repeatable legs data
  • Array - See table below

Legs Structure

Any of the following parameters can be skipped.

Name Description Example values
operatingCarrierPNR Operating carrier PNR Code
  • ABC123
departureAirport From City Airport Code
  • YUL
arrivalAirport To City Airport Code
  • FRA
operatingCarrierDesignator Operating carrier Designator
  • AC
flightNumber Flight Number
  • 0834
flightDate Date of Flight
  • 226
  • ISO 8601 formatted string
  • Moment.js object
  • JavaScript date object
compartmentCode Compartment Code
  • F
seatNumber Seat Number
  • 001A
checkInSequenceNumber Check-in Sequence Number
  • 0025
passengerStatus Passenger Status
  • 0 - Ticket issuance/passenger not checked in
  • 1 - Ticket issuance/passenger checked in
  • 2 - Bag checked/passenger not checked in
  • 3 - Bag checked/passenger checked in
  • 4 - Passenger passed security check
  • 5 - Passenger passed security gate exit (coupon used)
  • 6 - Transit
  • 7 - Standby
  • 8 - Boarding data revalidation done
  • 9 - Original boarding line used at time of ticket issuance
  • A - Up- or down-grading required at close out
airlineNumericCode Airline Numeric Code
  • 014
serialNumber Document Form/Serial Number
  • 1234567890
selecteeIndicator Selectee indicator
  • 0
internationalDocumentationVerification International Documentation Verification
  • 0 - Travel document verification not required
  • 1 - Travel document verification required
  • 2 - Travel document verification performed
marketingCarrierDesignator Marketing carrier designator
  • AC
frequentFlyerAirlineDesignator Frequent Flyer Airline Designator
  • AC
frequentFlyerNumber Frequent Flyer Number
  • 1234567890123
idIndicator ID/AD Indicator
  • 0
freeBaggageAllowance Free Baggage Allowance
  • 20K
fastTrack Fast Track
  • Y
  • N
  • true
  • false
airlineInfo For individual airline use
  • LX58Z

Example JSON Object

{
    "legs": [
        {
            "operatingCarrierPNR": "ABC123",
            "departureAirport": "YUL",
            "arrivalAirport": "FRA",
            "operatingCarrierDesignator": "AC",
            "flightNumber": "0834",
            "flightDate": "2018-08-14T00:00:00.000Z",
            "compartmentCode": "F",
            "seatNumber": "001A",
            "checkInSequenceNumber": "0025",
            "passengerStatus": "1"
        }
    ],
    "passengerName": "DESMARAIS/LUC"
}

Outputs:

M1DESMARAIS/LUC       EABC123 YULFRAAC 0834 226F001A0025 106>60000

Decode Node

Converts a BCBP string to a JSON object. The returned object uses the same data structure as the Encode node above.

Example String

M1DESMARAIS/LUC       EABC123 YULFRAAC 0834 226F001A0025 106>60000

Outputs:

{
    "legs": [
        {
            "operatingCarrierPNR": "ABC123",
            "departureAirport": "YUL",
            "arrivalAirport": "FRA",
            "operatingCarrierDesignator": "AC",
            "flightNumber": "0834",
            "flightDate": "2018-08-14T00:00:00.000Z",
            "compartmentCode": "F",
            "seatNumber": "001A",
            "checkInSequenceNumber": "0025",
            "passengerStatus": "1"
        }
    ],
    "passengerName": "DESMARAIS/LUC"
}
*/

To Do

  1. Add further error handling / data checks
  2. Add data capture / export
  3. Add boarding pass validation node against airline DCS host using IATA BCBP XML format
  4. Add basic validation rules engine
  5. Add Barcode Image Decode
  6. Add Boarding Pass template generation

Authors & Contributors

Contributions welcome! Feel free to fork this and provide updates and new features. Don't forget to submit a pull request!

License

This project is licensed under the GPL3.0 License - see the LICENSE file for details

Acknowledgments

This Node-RED module is based on the great work of georgesmith46 - georgesmith46, using his bcbp libraries.

Changelog

v1.0.0 (latest)

  • Initial Release
  • IATA BCBP Decode Function
  • IATA BCBP Encode Function

node-red-contrib-iata-bcbp's People

Contributors

mlfunston avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 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.