1.1.0 • Published 6 years ago

cir-food v1.1.0

Weekly downloads
-
License
MIT
Repository
-
Last release
6 years ago

CIR-FOOD

Cir-Food reverse API implementation in NodeJS.

Configuration

All API are authenticated, so you must first of all configure your client.

const CirFood = require('cir-food');

const username = process.env.CIRFOOD_USERNAME;
const password = process.env.CIRFOOD_PASSWORD;
const client = new CirFood(username, password);

Start a booking

client.startBooking(new Date('2018-05-11');

Get courses

Once you start a booking, you can get all courses for that day.

const courses = client.booking.courses;

Add a course to current booking

Once you got courses, use that IDs to add a course to current booking

const course_id = courses.data[0].id;
client.addCourseToCurrentBooking(course_id)

Submit booking

client.submitCurrentBooking()