Interface ReceivingService<T extends CaptureRequestVO>

All Known Implementing Classes:
ReceivingServiceImpl

public interface ReceivingService<T extends CaptureRequestVO>
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 Optional<ReceivingOrder> capture(@NotBlank @NotBlank String pKey, @NotNull @Valid @NotNull @Valid List<T> requests)
      Capturing on a ReceivingOrder means:
      • Decrease one of the ReceivingOrderPositions by the received amount of the given Product
      • Create physical PackagingUnit(s) from the received quantity
      Parameters:
      pKey - The persistent key of the ReceivingOrder
      requests - Contains all the capturing information according to the process in use
      Returns:
      The updated ReceivingOrder instance with updated positions
    • captureBlindReceipts

      void captureBlindReceipts(@NotNull @NotNull List<T> requests)
      Capture an unexpected receipt (aka Blind Receipt) that has no reference to a ReceivingOrder.
      • Create physical PackagingUnit(s) from the received quantity
      Parameters:
      requests - Contains all the capturing information according to the process in use
    • cancelOrder

      @NotNull @NotNull ReceivingOrder cancelOrder(@NotBlank @NotBlank 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

      @NotNull @NotNull ReceivingOrder changeState(@NotBlank @NotBlank 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(@NotBlank @NotBlank 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(@NotBlank @NotBlank String orderId)
      Find and return a ReceivingOrder identified by its business key.
      Parameters:
      orderId - The business key
      Returns:
      The order instance
    • update

      @NotNull @NotNull ReceivingOrder update(@NotBlank @NotBlank 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

      @NotNull @NotNull ReceivingOrder complete(@NotBlank @NotBlank 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