Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents

Overview

 

It is sometimes important to the business to communicate stock levels to their customers when they are browsing the shop. 

...

  • Encourage sales ("Buy this item now, it's almost gone")
  • Warn of longer delivery times ("Stock is low, next delivery time is X")

API

 

YC provides ProductAvailabilityModel interface in order to distill information relevant to specific Product or ProductSku. This model is available in runtime for both domain objects and search index objects.

This model provides information whether the product is available (both in stock and on preorder), in stock (i.e. has available inventory) and type of its availability.

Wicket App

 

Wicket web app already uses ProductAvailabilityModel in order to switch between "Preorder" and "Add to Cart" buttons.

...

Similar approach can be applied on product details page and in any other components that renders product or SKU information.

REST API

 

REST API exposes ProductAvailabilityModelRO object which has all the information which is available in ProductAvailabilityModel. Consumers of API response can apply similar concepts in order to provide messaging to customers or alter application behaviour.

Groovy

...

App
Label
BodyYCE
Colourinfo

 

Groovy App relies on the same concepts as already mentioned in previous sections. Additional MO (model) abstraction level exposes ProductAvailabilityModelMO object. 

...