@shareandcharge/sharecharge-common
TypeScript icon, indicating that this package has built-in type declarations

1.17.4 • Public • Published

sharecharge-common

Common code, libraries, conf files for the S&C platform solution

npm install @motionwerk/sharecharge-common

Models

Location

Locations can be deserialized to ensure that they conform to OCPI:

const location = Location.deserialize(/* location object */);

OCPI properties can then be accessed along with helper functions:

location.id
// "LOCATION-1"

location.getEvseIds()
/*
  [
    "DE-1234-1",
    "DE-1234-2"
  ]
*/

Tariff

Tariffs can also be deserialized as above:

const tariff = Tariff.deserialize(/* tariff object */);

Likewise, additional helper functions are provided:

tariff.currency
// "EUR"

tariff.calculatePrice("ENERGY", 10000);
// 380

Readme

Keywords

none

Package Sidebar

Install

npm i @shareandcharge/sharecharge-common

Weekly Downloads

0

Version

1.17.4

License

ISC

Unpacked Size

75.9 kB

Total Files

80

Last publish

Collaborators

  • johnhenderson
  • adamstaveley
  • drgorb