# Customer REST Web Service

This REST API offers the following endpoints:
Note: all requests require a HTTP Header parameter of:
Bearer: abcdefghijklmnopqrst...uvwxyz where this string is a valid JWT token.

- GET http://172.16.0.51:8080/customerrest/api/customer/findAll
  this will return a JSON array of Customer objects, (see below)
  this request requires an Employee level JWT token
- GET http://172.16.0.51:8080/customerrest/api/customer/findById/{id}
  this will return the requested Customer object in a JSON format,
  or nothing if the Customer is not found
  this request requires an Employee level JWT token
- POST http://172.16.0.51:8080/customerrest/api/customer/create
  this requires a JSON formated Customer object sent as part of the POST request,
  Note: Do NOT include an id field, as the database will generate on upon insert
  this request will return an message with the new Customer Id
  this request requires an Manager level JWT token
- PUT http://172.16.0.51:8080/customerrest/api/customer/update
  this requires a JSON formated Customer object sent as part of the POST request,
  Note: The Customer Id field is required to be included for this request
  this request requires an Manager level JWT token
- DELETE http://172.16.0.51:8080/customerrest/api/customer/delete/{id}
  this will return a message upon success, or a message if the Customer cannot be deleted
  for example, a Customer with outstanding Orders cannot be deleted
  this request requires an Manager level JWT token

#### JSON formatted Customer object

    		{
    		   "location":       {
    		      "city": "London",
    		      "country": "UK"
    		   },
    		   "firstName": "Thomas",
    		   "lastName": "Hardy",
    		   "phone": {"number": "(171) 555-7788"},
    		   "id": 4
    		}