Interface OrderService
-
- All Known Implementing Classes:
OrderServiceImpl
public interface OrderService
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.StringactiveLogisticsProvider()java.lang.StringactivePaymentProvider()booleanaddAttachment(java.lang.String orderId, Attachment attachment)Adds attachment to the last timeline.booleanaddAttachment(java.lang.String orderId, java.lang.String orderTimelineStep, Attachment attachment)Adds attachment to the last timeline.booleanapprove(java.lang.String orderId)Approves order.java.math.BigDecimalcalculateDelivery(java.lang.String orderId)Calculates the delivery cost for a specified order.booleancanAddAttachment(java.lang.String orderId)Checks if current user can add an Attachment.booleancanCancel(java.lang.String orderId)Checks if order is cancelable.booleancancel(java.lang.String orderId)Cancels an order.booleancanChangeStatus(java.lang.String orderId)Checks if current user can change the status of given order.booleanchangeAddress(java.lang.String orderId, java.util.LinkedHashMap<java.lang.String,java.lang.Object> params)Changes shipping address of the order.booleanchangePaymentMethod(java.lang.String orderId, java.util.LinkedHashMap<java.lang.String,java.lang.Object> paymentMethod)Changes payment method for the order's payment intent.OrderclearPaymentInfo(java.lang.String orderId)Removes payment information from orderbooleancomplete(java.lang.String orderId)Complete order.AttachmentcreateInvoiceBuyerToVendor(java.lang.String orderId)This method make an invoice from buyer to vendorjava.util.Optional<Order>createOrder(Order order)This method creates a database entity.java.util.Optional<Order>createOrder(java.util.LinkedHashMap<java.lang.String,java.lang.Object> orderAsMap)This method creates a database entity.booleandeliver(java.lang.String orderId)Deliver order.CommerceItemRepositorygetCommerceItemRepository()java.lang.StringgetInvoiceTemplate(java.lang.String orderId)This method makes the process of compiling the invoice templateOrderTimeLineBeangetLastOrderTimelineBean(java.lang.String orderId)This method returns bean.OrderDTOgetOrder(java.lang.String orderId)Gets order by id.java.util.LinkedHashSet<OrderDTO>getOrders(java.lang.String requestJson)This method does search requests and returns data as list.java.util.List<OrderDTO>getOrdersFromLoggedUser()Retrieves orders of current user.java.util.LinkedHashSet<OrderDTO>getOrdersFromLoggedUserByIds(java.util.ArrayList<java.lang.String> orderIds)Retrieves orders of current user.org.springframework.data.domain.Page<Order>getOrdersPaged(java.lang.String requestJson)This method does search requests and returns data as pages.java.util.List<OrderTimeLineBean>getOrderTimeLine(java.lang.String orderId)This method returns beans as list.java.util.Deque<java.util.Map<java.lang.String,java.lang.Object>>getPaginationFilter(java.lang.String requestJson)This method does calculation for a pages based on the request.OrderRepositorygetRepository()java.util.Set<Address>getShippingAddresses()Get saved shipping addresses.voidhandleNotify()booleanisUserParticipatesInOrder(java.lang.String orderId, boolean asVendor)This method checks is database entity belong to other database entity.booleanmustAddAttachments(java.lang.String orderId)Checks if attachments must be added on the current step but currently absent.java.lang.Stringobtain3DSecureLink(java.lang.String orderId)Obtains a payment authorization link;java.util.List<OrderDTO>orderCheckout()Checkout the orders for the given shopping cart id.PaymentStatuspay(java.lang.String orderId)Commits payment for the order.java.lang.Stringpayout(java.lang.String orderId)Commits payout.booleanprepareItemsToShipment(java.util.List<CommerceItem> items)This method does reserve for the items which are paid already.booleanremoveAttachment(java.lang.String orderId, java.lang.String attachmentName)Removes attachment from the last timeline.booleanremoveAttachment(java.lang.String orderId, java.lang.String orderTimelineStep, java.lang.String attachmentName)Removes attachment from the last timeline.booleanremoveCommerceItemFromOrder(java.lang.String orderId, java.lang.String commerceItemId)This method removes relationship between database entities.voidremoveOrder(java.lang.String orderId)This method removes database entities.voidremoveOrdersByIds(java.util.ArrayList<java.lang.String> orderIds)This method removes a list of database entities.OrdersaveOrder(Order order)This method saves a database entity.OrdersaveOrder(java.util.LinkedHashMap<java.lang.String,java.lang.Object> orderAsMap)This method save an updates of database entity.voidsendOrderConfirmationEmail(java.util.LinkedHashMap<java.lang.String,java.lang.Object> emailData)Sends a success email for the order.booleanship(java.lang.String orderId)Ships order.CommerceItemupdateCommerceItemMetaInfo(java.lang.String commerceItemId, java.util.LinkedHashMap<java.lang.String,java.lang.Object> metaInfo)Updates the meta information associated with a specific commerce item.
-
-
-
Method Detail
-
handleNotify
void handleNotify()
-
getRepository
OrderRepository getRepository()
-
activeLogisticsProvider
java.lang.String activeLogisticsProvider()
-
activePaymentProvider
java.lang.String activePaymentProvider()
-
getCommerceItemRepository
CommerceItemRepository getCommerceItemRepository()
-
getPaginationFilter
java.util.Deque<java.util.Map<java.lang.String,java.lang.Object>> getPaginationFilter(java.lang.String requestJson)
This method does calculation for a pages based on the request.- Parameters:
requestJson- JSON-object of request contains an instructions for search queries- Returns:
- map-representation of data
-
getOrders
java.util.LinkedHashSet<OrderDTO> getOrders(java.lang.String requestJson)
This method does search requests and returns data as list.- Parameters:
requestJson- search request- Returns:
- data transport entities as list
-
getOrdersPaged
org.springframework.data.domain.Page<Order> getOrdersPaged(java.lang.String requestJson)
This method does search requests and returns data as pages.- Parameters:
requestJson- JSON-object of request contains an instructions for search queries- Returns:
- database entities separated to pages
-
createOrder
java.util.Optional<Order> createOrder(java.util.LinkedHashMap<java.lang.String,java.lang.Object> orderAsMap)
This method creates a database entity.- Parameters:
orderAsMap- map-representation of database entity- Returns:
- database entity
-
createOrder
java.util.Optional<Order> createOrder(Order order)
This method creates a database entity.- Parameters:
order- map-representation of database entity- Returns:
- database entity
-
saveOrder
Order saveOrder(java.util.LinkedHashMap<java.lang.String,java.lang.Object> orderAsMap)
This method save an updates of database entity.- Parameters:
orderAsMap- map-representation of database entity- Returns:
- saved instance of database entity
-
saveOrder
Order saveOrder(Order order)
This method saves a database entity.- Parameters:
order- database entity- Returns:
- saved instance of database entity
-
getOrdersFromLoggedUser
java.util.List<OrderDTO> getOrdersFromLoggedUser()
Retrieves orders of current user.- Returns:
- order
-
getOrdersFromLoggedUserByIds
java.util.LinkedHashSet<OrderDTO> getOrdersFromLoggedUserByIds(java.util.ArrayList<java.lang.String> orderIds)
Retrieves orders of current user.- Parameters:
orderIds- the list of database entities which will be removed- Returns:
- order
-
getOrder
OrderDTO getOrder(java.lang.String orderId)
Gets order by id.- Parameters:
orderId- identification for filter and return data- Returns:
- order DTO
-
getOrderTimeLine
java.util.List<OrderTimeLineBean> getOrderTimeLine(java.lang.String orderId)
This method returns beans as list.- Parameters:
orderId- identification for database entity which related beans list be returned- Returns:
- beans as list
-
orderCheckout
java.util.List<OrderDTO> orderCheckout()
Checkout the orders for the given shopping cart id.- Returns:
- the list of OrderDTOs representing the checked out orders
-
sendOrderConfirmationEmail
void sendOrderConfirmationEmail(java.util.LinkedHashMap<java.lang.String,java.lang.Object> emailData)
Sends a success email for the order.This method sends a success email for the order specified by the given email message.
- Parameters:
emailData- the email message object containing the details of the success email
-
removeOrder
void removeOrder(java.lang.String orderId)
This method removes database entities.- Parameters:
orderId- identification for database entity which will be removed
-
removeOrdersByIds
void removeOrdersByIds(java.util.ArrayList<java.lang.String> orderIds)
This method removes a list of database entities.- Parameters:
orderIds- the list of database entities which will be removed
-
removeCommerceItemFromOrder
boolean removeCommerceItemFromOrder(java.lang.String orderId, java.lang.String commerceItemId)This method removes relationship between database entities.- Parameters:
orderId- identification for database entity which will be removedcommerceItemId- identification for database entity which will be updated- Returns:
- the status of the action, whether it was successful or not
-
isUserParticipatesInOrder
boolean isUserParticipatesInOrder(java.lang.String orderId, boolean asVendor)This method checks is database entity belong to other database entity.- Parameters:
orderId- identification for database entity which will be checkedasVendor-true- for checking as vendor,false- if as buyer- Returns:
- value as boolean
-
getLastOrderTimelineBean
OrderTimeLineBean getLastOrderTimelineBean(java.lang.String orderId)
This method returns bean.- Parameters:
orderId- identification for database entity which found last bean and returned- Returns:
- bean
-
approve
boolean approve(java.lang.String orderId)
Approves order.- Parameters:
orderId- order id- Returns:
- true on success
-
pay
PaymentStatus pay(java.lang.String orderId)
Commits payment for the order.- Parameters:
orderId- order id- Returns:
- status of the payment
-
obtain3DSecureLink
java.lang.String obtain3DSecureLink(java.lang.String orderId)
Obtains a payment authorization link;- Parameters:
orderId- order id- Returns:
- the link
-
ship
boolean ship(java.lang.String orderId)
Ships order.- Parameters:
orderId- order id- Returns:
- true on success
-
deliver
boolean deliver(java.lang.String orderId)
Deliver order.- Parameters:
orderId- order id- Returns:
- true on success
-
payout
java.lang.String payout(java.lang.String orderId)
Commits payout.- Parameters:
orderId- order id- Returns:
- status of the payout
-
complete
boolean complete(java.lang.String orderId)
Complete order.- Parameters:
orderId- order id- Returns:
- true on success
-
cancel
boolean cancel(java.lang.String orderId)
Cancels an order.- Parameters:
orderId- order id- Returns:
- true on success
-
addAttachment
boolean addAttachment(java.lang.String orderId, Attachment attachment)Adds attachment to the last timeline.- Parameters:
orderId- id of the orderattachment- attachment- Returns:
- success or not
-
removeAttachment
boolean removeAttachment(java.lang.String orderId, java.lang.String attachmentName)Removes attachment from the last timeline.- Parameters:
orderId- id of the orderattachmentName- attachment name- Returns:
- success or not
-
addAttachment
boolean addAttachment(java.lang.String orderId, java.lang.String orderTimelineStep, Attachment attachment)Adds attachment to the last timeline.- Parameters:
orderId- id of the orderorderTimelineStep- step of the timelineattachment- attachment- Returns:
- success or not
-
removeAttachment
boolean removeAttachment(java.lang.String orderId, java.lang.String orderTimelineStep, java.lang.String attachmentName)Removes attachment from the last timeline.- Parameters:
orderId- id of the orderorderTimelineStep- step of the timelineattachmentName- attachment name- Returns:
- success or not
-
getShippingAddresses
java.util.Set<Address> getShippingAddresses()
Get saved shipping addresses.- Returns:
- addresses set
-
canCancel
boolean canCancel(java.lang.String orderId)
Checks if order is cancelable.- Parameters:
orderId- id of the order- Returns:
- true if order status could be changed to
OrderStatus.CANCELEDorOrderStatus.DENIED
-
canAddAttachment
boolean canAddAttachment(java.lang.String orderId)
Checks if current user can add an Attachment.- Parameters:
orderId- order ID- Returns:
- true if the user has rights to add an attachment to the order.
-
changeAddress
boolean changeAddress(java.lang.String orderId, java.util.LinkedHashMap<java.lang.String,java.lang.Object> params)Changes shipping address of the order.- Parameters:
orderId- order idparams- params of address- Returns:
- true if successful
-
changePaymentMethod
boolean changePaymentMethod(java.lang.String orderId, java.util.LinkedHashMap<java.lang.String,java.lang.Object> paymentMethod)Changes payment method for the order's payment intent.- Parameters:
orderId- order idpaymentMethod- params of a new payment method- Returns:
- true if successful
-
createInvoiceBuyerToVendor
Attachment createInvoiceBuyerToVendor(java.lang.String orderId)
This method make an invoice from buyer to vendor- Parameters:
orderId- order- Returns:
- value as attachment
-
canChangeStatus
boolean canChangeStatus(java.lang.String orderId)
Checks if current user can change the status of given order.- Parameters:
orderId- order- Returns:
- true if user can change the status
-
mustAddAttachments
boolean mustAddAttachments(java.lang.String orderId)
Checks if attachments must be added on the current step but currently absent.- Parameters:
orderId- order- Returns:
- true if attachments must be added
-
prepareItemsToShipment
boolean prepareItemsToShipment(java.util.List<CommerceItem> items)
This method does reserve for the items which are paid already.- Parameters:
items- commerce items which will be reserved- Returns:
- true if it successful
-
getInvoiceTemplate
java.lang.String getInvoiceTemplate(java.lang.String orderId)
This method makes the process of compiling the invoice template- Parameters:
orderId- order- Returns:
- compiled invoice template as a string
-
calculateDelivery
java.math.BigDecimal calculateDelivery(java.lang.String orderId)
Calculates the delivery cost for a specified order.- Parameters:
orderId- the unique identifier for the order- Returns:
- the calculated delivery cost as a BigDecimal value
-
clearPaymentInfo
Order clearPaymentInfo(java.lang.String orderId)
Removes payment information from order- Parameters:
orderId- the unique identifier for the order- Returns:
- order without payment information
-
updateCommerceItemMetaInfo
CommerceItem updateCommerceItemMetaInfo(java.lang.String commerceItemId, java.util.LinkedHashMap<java.lang.String,java.lang.Object> metaInfo)
Updates the meta information associated with a specific commerce item.- Parameters:
commerceItemId- The ID of the commerce item to update meta info formetaInfo- A LinkedHashMap containing the new meta information to be updated- Returns:
- The updated CommerceItem with the new meta information
-
-