Clone the project:
git clone https://github.com/maxasker/Beavercoffee
Open the folder:
cd Beavercoffee
Install dependencies:
npm install
Start the preloaded server:
gulp serve
- Stores
- Employees
- Customers
- Products
- Menu
- Orders
- Reports
Create a new store
-
URL params
None
-
Data params
Required: name
Request body:
{ "name": String, "location": { "street": String, "city": String, "country": String, "zipcode": Number } }
Return all stores
-
URL params
None
-
Data params
None
Return one store
-
URL params
- storeid - ID of store
-
Data params
None
Adds a new employee
-
URL params
storeId - ID of store
-
Data params
Required: current_role
Request body:
{ "current_role": String, "name": String, "social_security": Number, "address": { "street_name": String, "city": String, "country": String, "zipcode": Number }, "perc_fulltime": Number }
Returs all employees
-
URL params
None
-
Data params
None
Returns a single employee
-
URL params
employeeId - ID of employee
-
Data params
None
Updates an employee
-
URL params
employeeId - ID of employee
-
Data params
Body:
{ "current_role": String, "name": String, "social_security": Number, "address": { "street_name": String, "city": String, "country": String, "zipcode": Number }, "perc_fulltime": Number } ```
Post a comment about an employee
-
URL params
employeeId - ID of employee
-
Data params
Required: text
Body:
{ "date": Date, "text": String, "author": String (employeeId) }
Returns all comments about an employee
-
URL params
employeeId - ID of employee
-
Data params
None
Creates a new customer
-
URL params
None
-
Data params
Required: None
Body:
{ "barcode": Number, "name": String, "social_security": Number, "occupation": String, "is_employee": Boolean, "country": String, "beverages": Number, "address": { "street_name": String, "city": String, "country": String, "zipcode": Number }, "member_since": Date }
Returns all customers
-
URL params
None
-
Data params
None
Returns a single customer
-
URL params
customerId - ID of customer
-
Data params
None
Updates a customer
-
URL params
customerId - ID of customer
-
Data params
Required: None
Body:
{ "barcode": Number, "name": String, "social_security": Number, "occupation": String, "is_employee": Boolean, "country": String, "beverages": Number, "address": { "street_name": String, "city": String, "country": String, "zipcode": Number }, "member_since": Date }
Add beverages to customer
-
URL params
customerId - ID of customer
-
Data params
Required: beverages
Body:
{ "beverages": Number }
Creates a new product
-
URL params
storeId - ID of store
-
Data params
Required: None
Body:
{ "name": String, "quantity": { "metric": String, "total_amount": Number, "pkg_amount": Number } }
Returns all products
-
URL params
None
-
Data params
None
Returns a single product
-
URL params
productId - ID of product
-
Data params
None
Updates a product
-
URL params
productId - ID of product
-
Data params
Required: None
Body:
{ "name": String, "quantity": { "metric": String, "total_amount": Number, "pkg_amount": Number } }
Creates a new menu item
-
URL params
storeId - ID of store
-
Data params
Required: None
Body:
{ "name": String, "price": Number, "ingredients": [{ "product": String, (productId) "amount": Number, "metric": String }] }
Returns all menu items in a store
-
URL params
storeId - ID of store
-
Data params
None
Creates a new order
-
URL params
storeId - ID of store
-
Data params
Required: None
Body:
{ "employeeId": String, "customer_id": String, "date": Date, "items": [{ "_id": String, (menuItemId) "quantity": Number }] }
Returns a single order
-
URL params
orderId - ID of order
-
Data params
None
Returns a list of all employees who've worked between the provided dates
-
URL params
None
-
Data params
Required: start_year, start_month, start_day, end_year, end_month, end_day
Body:
{ "start_year": Number, "start_month": Number, "start_day": Number, "end_year": Number, "end_month": Number, "end_day": Number }
Returns a list of all orders made between the provided dates. If an employee is provided in the request body only orders handled by that employee are returned. If one or more menu_items are provided only orders containing one or more of those items are returned. The request can not contain both menu_items and employee.
-
URL params
None
-
Data params
Required: start_year, start_month, start_day, end_year, end_month, end_day
Body:
{ "start_year": Number, "start_month": Number, "start_day": Number, "end_year": Number, "end_month": Number, "end_day": Number, "employee": String (employeeId), "menu_items": [ String (menuItemId) ] }