Class SalesOrderService


  • public class SalesOrderService
    extends java.lang.Object
    A Service to access and store Activities
    Version:
    $Id: $Id
    Author:
    medamine
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      SalesOrder createSalesOrder​(SalesOrder salesOrder)
      Create new SalesOrder that will be available for all users.
      void deleteSalesOrder​(java.lang.Long salesOrderId, java.lang.String username)
      Delete SalesOrder identified by its id and check if username has permission to delete it.
      java.util.List<SalesOrder> getSalesOrderByClienId​(java.lang.Long clientId)
      Retrieves the list of Activities with offset, limit and a keyword that can be empty
      java.util.List<SalesOrder> getSalesOrdersList()
      Retrieves the list of Activities with offset, limit and a keyword that can be empty
      SalesOrder updateSalesOrder​(SalesOrder SalesOrder, java.lang.String username)
      Update an existing SalesOrder on datasource.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SalesOrderService

        public SalesOrderService​(SalesOrderStorage salesOrderStorage)

        Constructor for SalesOrderService.

        Parameters:
        salesOrderStorage - a SalesOrderStorage object.
    • Method Detail

      • createSalesOrder

        public SalesOrder createSalesOrder​(SalesOrder salesOrder)
                                    throws java.lang.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:
        java.lang.Exception - when SalesOrder already exists or an error occurs while creating SalesOrder or its attached image
      • updateSalesOrder

        public SalesOrder updateSalesOrder​(SalesOrder SalesOrder,
                                           java.lang.String username)
                                    throws java.lang.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:
        java.lang.Exception - when Exception is thrown or an error occurs while saving SalesOrder
      • deleteSalesOrder

        public void deleteSalesOrder​(java.lang.Long salesOrderId,
                                     java.lang.String username)
                              throws javax.persistence.EntityNotFoundException,
                                     java.lang.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
        java.lang.IllegalAccessException - if user is not allowed to delete SalesOrder
      • getSalesOrdersList

        public java.util.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 java.util.List<SalesOrder> getSalesOrderByClienId​(java.lang.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