Category

@Description(value = "A category of the catalog's products")
class Category(state: CategoryState)

A category of the catalog's products (the classic eShop's catalog type). Its name is unique among the categories, ignoring case and surrounding blanks: the category reserves it (DecideScope.reserve) as it takes it. A rename releases the old name (DecideScope.release) once it commits, so another category may take it then.

Like a product, a category belongs to its tenant (Ownership.TENANT): every shopper reads it.

Constructors

Link copied to clipboard
constructor(state: CategoryState)

Types

Link copied to clipboard
object Rejections

The codes the aggregate rejects a command with, by their local names: the compiler and the kernel name them <context>.category.<code>, as its peers read them from the api's generated contract.

Functions

Link copied to clipboard
suspend fun onCommand(command: CreateCategory, scope: DecideScope): CategoryCreated
suspend fun onCommand(command: RenameCategory, scope: DecideScope): CategoryRenamed?