Package com.skava.oms.util
Class TaxUtil
java.lang.Object
com.skava.oms.util.TaxUtil
Contains Utility functions for Order Tax Process
- Since:
- May 2024
- Author:
- Infosys Equinox
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
addTransactionInTaxItem
(Order order, TaxTransaction taxTransaction) This method is used to add transaction in taxitemstatic BigDecimal
calculateTotalTaxValue
(List<OrderItem> mapReturns) This method is used to calculate total tax valuestatic void
constructFailureTransaction
(Order order, String createdBy, TransactionResponse taxTransaction) This method is used to construct failure transactionstatic void
constructProperties
(Order order, List<Property> properties, TaxTransaction.TransactionType type) This method is used to construct propertiesstatic Tax
constructTaxDetails
(Order order, List<OrderItem> mapReturns, String taxCollectionId) This method is used to construct tax detailsstatic 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 payloadstatic void
constructTaxTransactions
(Order order, String createdBy, TaxServiceTransaction transaction) This method is used to construct transactions in tax itemstatic String
getTaxCollectionId
(Order order) This method return tax collection id form orderparseItemDetails
(List<OrderItem> mapReturns, String taxCollectionId, Address shippingAddress) This method is used to parse item detailsstatic TaxAddress
parseTaxAddress
(Address shippingAddress) This method is used to convert the shipping address to tax addressparseTaxItemSkus
(OrderItem orderItem) This method is used to construct item skusstatic 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 servicestatic void
updateTaxItemInOrder
(org.camunda.bpm.engine.delegate.DelegateExecution execution, Order order, String createdBy)
-
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 detailsmapReturns
- - holds the order items which are cancelledtaxCollectionId
- - 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 cancelledtotalTaxValue
- - refers to the total tax valuetaxCollectionId
- - holds the tax collection idtax
- - holds the tax objectshippingAddress
- - holds the shipping address- Returns:
- list of items
-
parseTaxItemSkus
This method is used to construct item skus- Parameters:
orderItem
- - holds the item details- Returns:
- - list of skus
-
parseTaxAddress
This method is used to convert the shipping address to tax address- Parameters:
shippingAddress
- - holds the order shipping address- Returns:
- tax address
-
getTaxCollectionId
This method return tax collection id form order- Parameters:
order
- - To get collection id- Returns:
- tax collection id
-
calculateTotalTaxValue
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 orderproperties
- - holds the propertiestype
- - 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 objecttotalTaxValue
- - refers the total tax valuetaxPayload
- - holds the tax transaction payloadproperties
- - holds the tax item propertiestax
- - holds the tax objecttransactionType
- - 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 dataorder
- - holds the order object dataorderService
- - refers to the order process flow objecttaxPayload
- - holds the tax transaction payloadheader
- - holds the header infomessageType
- - holds the message typetaxQueueName
- - 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 detailsorder
- - holds the order objectcreatedBy
- - 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 objectcreatedBy
- - holds the created by valuetaxTransaction
- - 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
- ordercreatedBy
- createdBytransaction
- transaction
-
addTransactionInTaxItem
This method is used to add transaction in taxitem- Parameters:
order
-taxTransaction
-
-