TechForPR / chefsForPR

Platform to manage the distribution of meals created by World Kitchen
http://chefs4pr.com
MIT License
3 stars 2 forks source link

Solves #3 - model for Requests #11

Closed dvidsilva closed 7 years ago

dvidsilva commented 7 years ago

Solves issue Number: 3

Description:

Creates a model for Food Requests with its validator, basic tests and endpoints.

Todos

It should use a different database to run the tests, to avoid corrupt data, or delete the documents that are successfully created. As mentioned in #10

Deploy Notes

We added the following packages or dependencies:

Steps to Test or Reproduce

To create a new food request, run the application and make a POST request to /api/request with the following body:

{"data": {"name":"David Silva","agency":"Tech For PR","email":"techforpr@example.com","phone":"xxx-xxx-xxxx","address":"123 fake st, apt 2","zipcode":"11001","questions":{"amountOfPeople":10},"needs":{"breakfast":10,"lunch":10,"dinner":10}}}

It should successfully create a request and return the doc, you can remove some data to try and create an invalid one and see the error.

Use the shortId from the previous doc and make a GET request to localhost:3000/api/request/:shortId to verify that the other endpoint works.

Impacted Areas in Application

It allows to create new food requests so the client can use them later.