Class SalesOrderService

java.lang.Object
org.exoplatform.timetracker.service.SalesOrderService

public class SalesOrderService extends Object
A Service to access and store Activities
Version:
$Id: $Id
Author:
medamine
  • Constructor Details

    • SalesOrderService

      public SalesOrderService(SalesOrderStorage salesOrderStorage)

      Constructor for SalesOrderService.

      Parameters:
      salesOrderStorage - a SalesOrderStorage object.
  • Method Details

    • createSalesOrder

      public SalesOrder createSalesOrder(SalesOrder salesOrder) throws Exception
      Create new SalesOrder that will be available for all users. If the SalesOrder already exits an EntityExistsException will be thrown.
      Parameters:
      salesOrder - SalesOrder to create
      Returns:
      stored SalesOrder in datasource
      Throws:
      Exception - when SalesOrder already exists or an error occurs while creating SalesOrder or its attached image
    • updateSalesOrder

      public SalesOrder updateSalesOrder(SalesOrder SalesOrder, String username) throws Exception
      Update an existing SalesOrder on datasource. If the SalesOrder doesn't exit an EntityNotFoundException will be thrown.
      Parameters:
      SalesOrder - dto to update on store
      username - username storing SalesOrder
      Returns:
      stored SalesOrder in datasource
      Throws:
      Exception - when Exception is thrown or an error occurs while saving SalesOrder
    • deleteSalesOrder

      public void deleteSalesOrder(Long salesOrderId, String username) throws javax.persistence.EntityNotFoundException, IllegalAccessException
      Delete SalesOrder identified by its id and check if username has permission to delete it.
      Parameters:
      salesOrderId - technical identifier of SalesOrder
      username - user currently deleting SalesOrder
      Throws:
      javax.persistence.EntityNotFoundException - if SalesOrder wasn't found
      IllegalAccessException - if user is not allowed to delete SalesOrder
    • getSalesOrdersList

      public List<SalesOrder> getSalesOrdersList()
      Retrieves the list of Activities with offset, limit and a keyword that can be empty
      Returns:
      List of SalesOrder that contains the list of Activities
    • getSalesOrderByClienId

      public List<SalesOrder> getSalesOrderByClienId(Long clientId)
      Retrieves the list of Activities with offset, limit and a keyword that can be empty
      Parameters:
      clientId - technical identifier of client
      Returns:
      List of SalesOrder that contains the list of sos