Class TaxUtil

java.lang.Object
com.skava.oms.util.TaxUtil

public final class TaxUtil extends Object
Contains Utility functions for Order Tax Process
Since:
May 2024
Author:
Infosys Equinox
  • Method Details

    • constructTaxDetails

      public static Tax constructTaxDetails(Order order, List<OrderItem> mapReturns, String taxCollectionId)
      This method is used to construct tax details
      Parameters:
      order - - holds the order details
      mapReturns - - holds the order items which are cancelled
      taxCollectionId - - holds the tax collection id
      Returns:
      tax
    • parseItemDetails

      public static List<Items> parseItemDetails(List<OrderItem> mapReturns, String taxCollectionId, Address shippingAddress)
      This method is used to parse item details
      Parameters:
      mapReturns - - holds the items which are cancelled
      totalTaxValue - - refers to the total tax value
      taxCollectionId - - holds the tax collection id
      tax - - holds the tax object
      shippingAddress - - holds the shipping address
      Returns:
      list of items
    • parseTaxItemSkus

      public static List<ItemsSKU> parseTaxItemSkus(OrderItem orderItem)
      This method is used to construct item skus
      Parameters:
      orderItem - - holds the item details
      Returns:
      - list of skus
    • parseTaxAddress

      public static TaxAddress parseTaxAddress(Address shippingAddress)
      This method is used to convert the shipping address to tax address
      Parameters:
      shippingAddress - - holds the order shipping address
      Returns:
      tax address
    • getTaxCollectionId

      public static String getTaxCollectionId(Order order)
      This method return tax collection id form order
      Parameters:
      order - - To get collection id
      Returns:
      tax collection id
    • calculateTotalTaxValue

      public static BigDecimal calculateTotalTaxValue(List<OrderItem> mapReturns)
      This method is used to calculate total tax value
      Parameters:
      mapReturns - - holds the order items that are cancelled
      Returns:
      total tax value
    • constructProperties

      public static void constructProperties(Order order, List<Property> properties, TaxTransaction.TransactionType type)
      This method is used to construct properties
      Parameters:
      order - - holds the order
      properties - - holds the properties
      type - - holds the reference transaction type
    • constructTaxTransactionPayload

      public static void constructTaxTransactionPayload(Order order, BigDecimal totalTaxValue, PreProcessTaxPayload taxPayload, List<Property> properties, Tax tax, TaxTransaction.TransactionType transactionType)
      This method is used to construct the tax transaction payload
      Parameters:
      order - - holds the order object
      totalTaxValue - - refers the total tax value
      taxPayload - - holds the tax transaction payload
      properties - - holds the tax item properties
      tax - - holds the tax object
      transactionType - - refers to the type of transaction
    • triggerEvent

      public static void triggerEvent(OrderProcessData orderProcessData, Order order, OrderProcessFlowService orderService, PreProcessTaxPayload taxPayload, Map<String,Object> header, String messageType, String taxQueueName)
      This method is used to trigger event to the tax service
      Parameters:
      orderProcessData - - holds the order process data
      order - - holds the order object data
      orderService - - refers to the order process flow object
      taxPayload - - holds the tax transaction payload
      header - - holds the header info
      messageType - - holds the message type
      taxQueueName - - holds the tax queue name
    • updateTaxItemInOrder

      public static void updateTaxItemInOrder(org.camunda.bpm.engine.delegate.DelegateExecution execution, Order order, String createdBy)
      Parameters:
      execution - holds the order execution details
      order - - holds the order object
      createdBy - - holds the created by class value
    • constructFailureTransaction

      public static void constructFailureTransaction(Order order, String createdBy, TransactionResponse taxTransaction)
      This method is used to construct failure transaction
      Parameters:
      order - - holds the order object
      createdBy - - holds the created by value
      taxTransaction - - holds the tax transaction object
    • constructTaxTransactions

      public static void constructTaxTransactions(Order order, String createdBy, TaxServiceTransaction transaction)
      This method is used to construct transactions in tax item
      Parameters:
      order - order
      createdBy - createdBy
      transaction - transaction
    • addTransactionInTaxItem

      public static void addTransactionInTaxItem(Order order, TaxTransaction taxTransaction)
      This method is used to add transaction in taxitem
      Parameters:
      order -
      taxTransaction -