ProductDiscount edit - MarcoLagalla/marette_backend GitHub Wiki

Name Edit ProductDiscounts
Description Edit the given discount
URL webapp/restaurant/<int:id>/products/discounts/<int:d_id>/edit
Allowed methods POST
Authorizations GET (IsBusiness, IsOwner)

Params

Parameter Type Description
id int valid restaurant id
d_id int valid discount id

POST

Edit and update info as for Add ProductDiscount

Field Type Required Unique Comments
title string yes no name to display
type DISCOUNT_TYPES_CHOICES yes no Fisso or Percentuale
value decimal yes no if type=Percentuale must be in range [0-100]

Return codes

Status Description
HTTP_200_OK ok - updated
HTTP_404_NOT_FOUND Restaurant/Token/Discount not found
HTTP_401_UNAUTHORIZED Wrong Token for this restaruant
HTTP_400_BAD_REQUEST Error in parameters
⚠️ **GitHub.com Fallback** ⚠️