The Tag class represents a marker in pizza or ingredients which indicates a property or type, such as meat, fish, cheese, etc. The class has 2 main properties: Name and Color. Name represents the name of the Tag and also serves as the tag's unique identifier instead of Id. Tags are compared using the NormalizedName property, which represents a case-insensitiveName.
Endpoints
All Tag endpoints have the path domain.com/api/tags and differ only in the HTTP Methods. Closes #24
Updates an existing Tag. Requires CurrentName as an identifier, and nullableNewName and nullableColor.
If Color in the request is null, the Color in the tag will be set to null. Color must be in ARGB number format.
If NewName is not null, the tag's Name will change if a Tag with this name doesn't exist.
Deletes the Tag with the Name provided in the query parameter.
Request example
Path - DELETE domain.com/api/tags?name=meat
Responses
204 No Content if successful
404 Not Found if the Tag with the provided Name is not found
Allergen
Class description
The Allergen class represents a marker for allergens in pizza or ingredients, such as peanut, gluten, dairy, etc. The class has 2 main properties: Name and Description. Name represents the name of the Allergen and serves as the allergen's unique identifier. Description provides detailed information about the allergen and its presence in various foods. Allergens are compared using the NormalizedName property, which represents a case-insensitiveName.
Endpoints
All Allergen endpoints have the path domain.com/api/tags and differ only in the HTTP Methods. Closes #23
Response example
Path - GET domain.com/api/allergens
[
{
"name": "Peanut",
"description": "Contains peanuts which are found in many processed foods such as peanut butter, candies, cookies, and some sauces"
},
{
"name": "Gluten",
"description": null
}
]
Updates an existing Allergen. Requires CurrentName as an identifier, and nullableNewName and nullableDescription.
If Description in the request is null, the Description in the allergen will be set to null.
If NewName is not null, the allergen's Name will change if a Allergen with this name doesn't exist.
Request examples
Path - PUT domain.com/api/tags
Peanut's allergenDescription will change:
{
"currentName": "Peanut",
"description": null
}
Peanut's allergen will be renamed to fruit and Description will be null:
Endpoints
Allergens
GET
domain.com/api/allergensPOST
domain.com/api/allergensPUT
domain.com/api/allergensDELETE
domain.com/api/allergensTags
GET
domain.com/api/tagsPOST
domain.com/api/tagsPUT
domain.com/api/tagsDELETE
domain.com/api/tagsTag
Class description
The
Tag
class represents a marker in pizza or ingredients which indicates a property or type, such as meat, fish, cheese, etc. The class has 2 main properties:Name
andColor
.Name
represents the name of theTag
and also serves as the tag's unique identifier instead ofId
. Tags are compared using theNormalizedName
property, which represents a case-insensitiveName
.Endpoints
All
Tag
endpoints have the pathdomain.com/api/tags
and differ only in the HTTP Methods. Closes #24GET Method
Returns all existing
Tags
.Response example Path -
GET
domain.com/api/tagsPOST Method
Creates a new
Tag
. RequiresName
andColor
in the body.Color
must be in ARGB number format.Color
is nullable.Request examples Path -
POST
domain.com/api/tagsResponses
201 Created
ifTag
is created successfully409 Conflict
if aTag
with the provided name already existsPUT Method
Updates an existing
Tag
. RequiresCurrentName
as an identifier, and nullableNewName
and nullableColor
. IfColor
in the request isnull
, theColor
in the tag will be set tonull
.Color
must be in ARGB number format. IfNewName
is notnull
, the tag'sName
will change if aTag
with this name doesn't exist.Request examples Path -
PUT
domain.com/api/tagsVegetarian's tag
Color
will change:Vegetarian's tag will be renamed to fruit:
Responses
204 No Content
if successful404 Not Found
if theTag
withCurrentName
is not found409 Conflict
if aTag
withNewName
already existsDELETE Method
Deletes the
Tag
with theName
provided in the query parameter.Request example Path -
DELETE
domain.com/api/tags?name=meatResponses
204 No Content
if successful404 Not Found
if theTag
with the providedName
is not foundAllergen
Class description
The
Allergen
class represents a marker for allergens in pizza or ingredients, such as peanut, gluten, dairy, etc. The class has 2 main properties:Name
andDescription
.Name
represents the name of theAllergen
and serves as the allergen's unique identifier.Description
provides detailed information about the allergen and its presence in various foods. Allergens are compared using theNormalizedName
property, which represents a case-insensitiveName
.Endpoints
All
Allergen
endpoints have the pathdomain.com/api/tags
and differ only in the HTTP Methods. Closes #23GET Method
Returns all existing
Allergens
.Response example Path -
GET
domain.com/api/allergensPOST Method
Creates a new
Allergen
. RequiresName
andDescription
in the body.Description
is nullable.Request examples Path -
POST
domain.com/api/allergensResponses
201 Created
ifAllergen
is created successfully409 Conflict
if aAllergen
with the provided name already existsPUT Method
Updates an existing
Allergen
. RequiresCurrentName
as an identifier, and nullableNewName
and nullableDescription
. IfDescription
in the request isnull
, theDescription
in the allergen will be set tonull
. IfNewName
is notnull
, the allergen'sName
will change if aAllergen
with this name doesn't exist.Request examples Path -
PUT
domain.com/api/tagsPeanut's allergen
Description
will change:Peanut's allergen will be renamed to fruit and
Description
will benull
:Responses
204 No Content
if successful404 Not Found
if theAllergen
withCurrentName
is not found409 Conflict
if aAllergen
withNewName
already existsDELETE Method
Deletes the
Allergen
with theName
provided in the query parameter.Request example Path -
DELETE
domain.com/api/allergens?name=meatResponses
204 No Content
if successful404 Not Found
if theAllergen
with the providedName
is not found