Interface ReceivingService

All Known Implementing Classes:
ReceivingServiceImpl

public interface ReceivingService
A ReceivingService manages ReceivingOrders.
Author:
Heiko Scherrer
  • Method Details

    • createOrder

      @NotNull @NotNull ReceivingOrder createOrder(@NotNull @NotNull ReceivingOrder order)
      Create a ReceivingOrder with containing ReceivingOrderPosition.
      Parameters:
      order - The ReceivingOrder instance to create
      Returns:
      The saved instance
    • capture

      @NotNull @NotNull ReceivingOrderVO capture(@NotEmpty @NotEmpty String pKey, @NotEmpty @NotEmpty String loadUnitType, @NotNull @Valid @NotNull @Valid List<CaptureRequestVO> requests)
      Decrease one of the ReceivingOrderPositions by the received amount of the given Product and book the received article to the TransportUnit identified by the transportUnitId.
      Parameters:
      pKey - The persistent key of the ReceivingOrder
      loadUnitType - In case the LoadUnit is created this is type for the LoadUnit
      requests - all captures to process
      Returns:
      The updated ReceivingOrder instance with updated positions
    • cancelOrder

      ReceivingOrder cancelOrder(@NotEmpty @NotEmpty String pKey)
      Cancel a ReceivingOrder.
      Parameters:
      pKey - The synthetic persistent key
      Returns:
      The cancelled instance
      Throws:
      CancellationDeniedException - in case the cancellation is not allowed
    • changeState

      ReceivingOrder changeState(@NotEmpty @NotEmpty String pKey, @NotNull @NotNull OrderState state)
      Change the state of a ReceivingOrder.
      Parameters:
      pKey - The synthetic persistent key
      state - The new state
      Returns:
      The updated instance
      Throws:
      CancellationDeniedException - in case the state change is not allowed
    • findAll

      @NotNull @NotNull List<ReceivingOrder> findAll()
      Find and return all existing ReceivingOrders.
      Returns:
      A list of ReceivingOrders, never null
    • findByPKey

      @NotNull @NotNull ReceivingOrder findByPKey(@NotEmpty @NotEmpty String pKey)
      Find and return a ReceivingOrder identified by its synthetic persistent key.
      Parameters:
      pKey - The synthetic persistent key
      Returns:
      The instance
      Throws:
      org.ameba.exception.NotFoundException - if not found
    • findByOrderId

      Optional<ReceivingOrder> findByOrderId(@NotEmpty @NotEmpty String orderId)
      Find and return a ReceivingOrder identified by its business key.
      Parameters:
      orderId - The business key
      Returns:
      The order instance
    • update

      ReceivingOrder update(@NotEmpty @NotEmpty String pKey, @NotNull @NotNull ReceivingOrder receivingOrder)
      Update an existing ReceivingOrder with the given data.
      Parameters:
      pKey - The synthetic persistent key
      receivingOrder - The representation to update
      Returns:
      The updated instance
      Throws:
      org.ameba.exception.NotFoundException - if not found
    • complete

      ReceivingOrderVO complete(@NotEmpty @NotEmpty String pKey)
      Complete a ReceivingOrder and all positions. Satisfy quantities and set the state to COMPLETED.
      Parameters:
      pKey - The synthetic persistent key
      Returns:
      The updated instance