Storefront

The storefront's reads of the catalog, service routes beside the product's queries: a product as a shopper sees it, a category's products in a page, and the price of a basket's lines. Each reads as its caller (RouteCall.queries), so it sees what the caller may; only a published product is on the storefront.

Constructors

Link copied to clipboard
constructor()

Types

Link copied to clipboard
object Companion
Link copied to clipboard
object Refusals

The codes the storefront refuses a call with: full codes of the context, which its routes list.

Functions

Link copied to clipboard
@ServiceRoute(method = RouteMethod.GET, path = "categories/{categoryId}/listings", errors = ["eshop-catalog.limit-out-of-range"])
suspend fun categoryListings(call: RouteCall, categoryId: String, @RouteQuery limit: Int?): List<ProductListing>

The published products of categoryId, cheapest first: limit of them, 20 when it is not given.

Link copied to clipboard
@ServiceRoute(method = RouteMethod.GET, path = "listings/{id}")
suspend fun listing(call: RouteCall, id: String): ProductListing?

The product id as the storefront shows it; none (204 No Content) while it is not published.

Link copied to clipboard
@ServiceRoute(method = RouteMethod.POST, path = "quotes", errors = ["eshop-catalog.not-on-sale", "eshop-catalog.quantity-not-positive"])
suspend fun quote(call: RouteCall, request: QuoteRequest): Quote

The price of request's lines, each at its product's price; refused when one is not on the storefront.