Package-level declarations

Types

Link copied to clipboard
@Summary(value = "Change a product's price")
data class ChangeProductPrice(val price: BigDecimal)

Changes the product's price.

Link copied to clipboard
@Summary(value = "Create a product")
data class CreateProduct(val name: String, val price: BigDecimal, val description: String = "", val brandId: String? = null, val categoryId: String? = null)

Adds a draft product named name at price to the catalog. The brandId and categoryId name a brand and a category of this context; a product can be created without them, but is published only with both.

Link copied to clipboard
@Summary(value = "Delist a product")
data class DelistProduct(val reason: String = "")

Takes a published product off the storefront.

Link copied to clipboard
@Summary(value = "Discontinue a product")
data class DiscontinueProduct(val reason: String)

Discontinues the product for good, with the reason: it leaves the catalog, deleted as DeleteAggregate deletes it, the reason kept in its history.

Link copied to clipboard
@Summary(value = "A product was added to the catalog")
data class ProductCreated(val name: String, val price: BigDecimal, val description: String = "", val brandId: String? = null, val categoryId: String? = null)

The skeleton's event (E.0) with the fields E.1 adds; optional fields with defaults are not a new revision.

Link copied to clipboard
@Summary(value = "A product was taken off the storefront")
data class ProductDelisted(val reason: String)
Link copied to clipboard
@Summary(value = "A product was discontinued for good")
data class ProductDiscontinued(val reason: String)
Link copied to clipboard
data class ProductListing(val id: String, val name: String, val description: String, val price: BigDecimal, val brandId: String?, val categoryId: String?)

A published product as the storefront shows it to a shopper: what it is and what it costs.

Link copied to clipboard
@Summary(value = "A product's price changed")
data class ProductPriceChanged(val price: BigDecimal, val previous: BigDecimal)
Link copied to clipboard
@Summary(value = "A product was published on the storefront")
data object ProductPublished
Link copied to clipboard

Where a product is in its life on the storefront.

Link copied to clipboard
@Summary(value = "A product's name, description, brand or category changed")
data class ProductUpdated(val name: String, val description: String, val brandId: String?, val categoryId: String?)
Link copied to clipboard
@Summary(value = "Publish a product")
data object PublishProduct

Puts the product on the storefront; a delisted product can be published again.

Link copied to clipboard
data class Quote(val lines: List<QuotedLine>, val total: BigDecimal)

The storefront's price of a QuoteRequest: each line at its product's price, and their total.

Link copied to clipboard
data class QuotedLine(val productId: String, val quantity: Int, val unitPrice: BigDecimal, val amount: BigDecimal)

A line of a Quote: quantity of productId at unitPrice, amount in all.

Link copied to clipboard
data class QuoteLine(val productId: String, val quantity: Int)

quantity of the product productId.

Link copied to clipboard
data class QuoteRequest(val lines: List<QuoteLine>)

The lines a shopper asks the storefront to price.

Link copied to clipboard
@Summary(value = "Update a product")
data class UpdateProduct(val name: String, val description: String = "", val brandId: String? = null, val categoryId: String? = null)

Replaces the product's name, description, brand and category.