fake-restaurant

3.1.10 • Public • Published

fake-restaurant

This is a simple package to manage the orders on a restaurant.

Installation

$ npm install fake-restaurant

API

var fakeRestaurant = require('fake-restaurant')

The fakeRestaurant object exposes various methods to manage the orders of a restaurant.

You can use these methods to manage the array:

fakeRestaurant.getAllOrders();
/*
  Returns all the Orders (used by the admin of the restaurant).
*/
fakeRestaurant.getAllMenuItems();
/*
  Returns all the menu items.
*/
fakeRestaurant.getOrderById(id);
/*
  Returns the order with the specified id or null if not found.
*/
fakeRestaurant.addOrder(newOrder, client);
/*
  Push a new order at the end of the array, newOrder must
  be an object with 2 properties: items (array of menu items) and price (dummy stuff).
  This method returns the new order added, or null if the
  newOrder object does not contain the correct properties.
*/
fakeRestaurant.deleteOrder(id);
/*
  Used by admin.
  Delete the order with the specified id and returns it.
  This method return null if the user to delete is not
  found.
*/
fakeRestaurant.setOrderStatus = (id, newOrderStatus);
/*
  Modify the order status with the specified id and returns the order.
  This method return null if the order to modify is
  not found.
*/
fakeRestaurant.getProfit();
/*
  This method return the profit of the restaurant
*/
fakeRestaurant.reset();
/*
  This method restores the order array at the initial state
  and returns it.
*/

Known issues

. This is only a dummy package

License

MIT

Readme

Keywords

Package Sidebar

Install

npm i fake-restaurant

Weekly Downloads

8

Version

3.1.10

License

MIT

Unpacked Size

13.2 kB

Total Files

8

Last publish

Collaborators

  • xantux