This package has been deprecated

Author message:

Package no longer supported. Contact support@npmjs.com for more info.

gb-rail-validation
TypeScript icon, indicating that this package has built-in type declarations

1.6.1 • Public • Published

British Rail Fare Validation

Travis npm npm David

This library will validate journeys against British Rail fares using the restrictions data from DTD.

The rules around journey/fare validity are very specific to British rail and are not useful for other data sets.

The main outputs from this library are the repositories for loading restrictions and the filters that can be applied. The following filters are available:

  • FareLocationFilter checks the journey origin/destination is valid for the fare
  • OperatorFilter checks the journey has the necessary operators for the fare (TOC specific tickets)
  • RouterFilter checks the journey follows a path that is valid for the route code
  • RestrictionFilter checks the journey against the time and train restrictions
  • CrossLondonFilter checks fares for cross London journeys have the cross London marker set or go to a zonal location
  • FareClassFilter ensures first class fares are only available on trains with first class
  • GeographicalRailcardRestrictionFilter applies additional restriction codes for certain railcards (e.g. SRN, FAM) in certian areas.

The JourneyFareValidator provides an interface to validate outward and return journeys.

Testing

npm test

Contributing

Issues and PRs are very welcome.

License

This software is licensed under GNU GPLv3.

Copyright 2018 Linus Norton.

Readme

Keywords

Package Sidebar

Install

npm i gb-rail-validation

Weekly Downloads

1

Version

1.6.1

License

GPL-3.0

Unpacked Size

125 kB

Total Files

94

Last publish

Collaborators

  • npm