Restaurant Registration - MarcoLagalla/marette_backend GitHub Wiki
Name | Restaurant Registration |
---|---|
Description | Allow registering a new Restaurant |
URL | api/v1/webapp/restaurant/new |
Allowed methods | POST |
Authorizations | IsBusiness |
POST
Allows registering a new business user.
Field | Type | Required | Unique | Comments |
---|---|---|---|---|
image |
File | no | no | If null returns a placeholder |
activity_name |
string | yes | no | |
activity_description |
string | yes | no | |
city |
string | yes | no | |
address |
string | yes | no | |
n_civ |
string | yes | yes | |
cap |
numeric | yes | no | valid cap number |
restaurant_number |
numeric | yes | no | valid phone number |
p_iva |
numeric | yes | yes | valid P_iva number |
restaurant_category |
pk | yes | no | pk-category |
{
"image": <FormData File>,
"data": {
"activity_name": "Pizza Mania",
"activity_description": "Pizzeria da asporto storica",
"city": "Panini e Piadine",
"address": "5",
"n_civ": "22/B",
"cap": 15057,
"restaurant_number" : 0131868685,
"restaurant_category": [1, 2],
"p_iva": 0398493808 <-- must be valid (this is not)
}
}
If all parameters are valid, returns --> HTTP_201_CREATED
or otherwise --> HTTP_400_BAD_REQUEST
If not authorized, returns --> HTTP_403_FORBIDDEN
{
"response": "successfully registered a new restaurant",
"id_restaurant": 2,
"slug": "bella-napoli",
"url": "8/bella-napoli",
"image": "media/restaurant/place.png"
}