Class ProductCommandService

java.lang.Object
com.dmasone.identity.catalog.application.ProductCommandService
All Implemented Interfaces:
StockReservationService

@Service public class ProductCommandService extends Object implements StockReservationService
Write-side catalog service. It is intentionally narrow: other modules can reserve stock, but cannot update catalog rows or bypass the domain rule.
  • Constructor Details

  • Method Details

    • reserveStock

      @Transactional @CacheEvict(cacheNames={"catalogProducts","catalogProduct"}, allEntries=true) public void reserveStock(Long productId, int quantity)
      Description copied from interface: StockReservationService
      Reserve catalog stock for a product.
      Specified by:
      reserveStock in interface StockReservationService
      Parameters:
      productId - catalog product id
      quantity - positive quantity to reserve