Class: Category

Category(categoryId, name, imageUrl, type, isRecommended, description, availabilityStatus, popularItems, parentCategory)

Represent a category of products in the system.

Constructor

new Category(categoryId, name, imageUrl, type, isRecommended, description, availabilityStatus, popularItems, parentCategory)

Creates a new Category instance.
Parameters:
Name Type Default Description
categoryId string Unique identifier for the category.
name string Name of the category.
imageUrl string URL for the category image.
type string Type of category (e.g., Food , Drink).
isRecommended boolean false Indicates if the category is recommended.
description string description of the category.
availabilityStatus boolean true New availabbility status.
popularItems Array.<string> New List of popular items.
parentCategory Category null New parent category, if applicable.
Source:

Methods

setRecommendation(status)

Sets the recommendation status for the category.
Parameters:
Name Type Description
status boolean = New recommendation status.
Source:

updateDetails(name, imageUrl, type, description)

Updates the category details.
Parameters:
Name Type Description
name string New name for the category.
imageUrl string New image URL for the category.
type string New type for the category.
description string New description for the category.
Source: