Package de.hybris.platform.orderhistory
Interface OrderHistoryService
-
- All Known Implementing Classes:
DefaultOrderHistoryService
public interface OrderHistoryServiceThis interface is provides methods for order history versioning and the creation of order snapshots.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description OrderModelcreateHistorySnapshot(OrderModel currentVersion)Creates a exact copy of the given order except that the copy will be marked as copy by settingOrderModel.VERSIONIDtotrue.java.util.Collection<OrderHistoryEntryModel>getHistoryEntries(OrderModel ownerOrder, EmployeeModel employee)Fetches history entries of the ownerOrder from the given employeejava.util.Collection<OrderHistoryEntryModel>getHistoryEntries(OrderModel ownerOrder, java.util.Date dateFrom, java.util.Date dateTo)Fetches history entries of the ownerOrder from the given time rangejava.util.Collection<OrderHistoryEntryModel>getHistoryEntries(UserModel user, java.util.Date dateFrom, java.util.Date dateTo)Fetches history entries of the orders placed by the user in the given time rangejava.util.Collection<java.lang.String>getHistoryEntriesDescriptions(OrderModel ownerOrder, java.util.Date dateFrom, java.util.Date dateTo)Fetches the descriptions of history entries of the ownerOrder from the given time rangejava.util.Collection<OrderModel>getHistorySnapshots(OrderModel currentVersion)Fetches all snapshots which have been created and assigned to the given order's history entries.voidsaveHistorySnapshot(OrderModel snapshot)Actually persists a previously created order snapshot.
-
-
-
Method Detail
-
createHistorySnapshot
OrderModel createHistorySnapshot(OrderModel currentVersion)
Creates a exact copy of the given order except that the copy will be marked as copy by settingOrderModel.VERSIONIDtotrue.- Parameters:
currentVersion- the original order to be copied copy- Returns:
- a newly created order model (which is not persisted yet!)
-
saveHistorySnapshot
void saveHistorySnapshot(OrderModel snapshot)
Actually persists a previously created order snapshot. Please note that it is necessary to use this method instead just callingModelService.save(Object)to overcome Jalo layer business logic resetting some attributes. In future this may not be necessary.- Parameters:
snapshot- the order snapshot- Throws:
java.lang.IllegalArgumentException- if the order is already persisted or is no snapshot at all
-
getHistorySnapshots
java.util.Collection<OrderModel> getHistorySnapshots(OrderModel currentVersion)
Fetches all snapshots which have been created and assigned to the given order's history entries.- Parameters:
currentVersion- the original order- Returns:
- all history snapshots
-
getHistoryEntries
java.util.Collection<OrderHistoryEntryModel> getHistoryEntries(OrderModel ownerOrder, java.util.Date dateFrom, java.util.Date dateTo)
Fetches history entries of the ownerOrder from the given time range- Parameters:
ownerOrder- the owner orderdateFrom- upper limit of the time rangedateTo- lower limit of the time range- Returns:
- Collection of history entries of the given ownerOrder that were captured in the given time range
-
getHistoryEntriesDescriptions
java.util.Collection<java.lang.String> getHistoryEntriesDescriptions(OrderModel ownerOrder, java.util.Date dateFrom, java.util.Date dateTo)
Fetches the descriptions of history entries of the ownerOrder from the given time range- Parameters:
ownerOrder- the owner orderdateFrom- upper limit of the time rangedateTo- lower limit of the time range- Returns:
- Collection of history entries of the given ownerOrder that were captured in the given time range
-
getHistoryEntries
java.util.Collection<OrderHistoryEntryModel> getHistoryEntries(OrderModel ownerOrder, EmployeeModel employee)
Fetches history entries of the ownerOrder from the given employee- Parameters:
ownerOrder- the owner orderemployee- instance ofEmployeeModelto get the history of orders for- Returns:
- collection of
OrderHistoryEntryModel
-
getHistoryEntries
java.util.Collection<OrderHistoryEntryModel> getHistoryEntries(UserModel user, java.util.Date dateFrom, java.util.Date dateTo)
Fetches history entries of the orders placed by the user in the given time range- Parameters:
user- user that placed the ordersdateFrom- set dateFrom to null if you want to make the time range only half limiteddateTo- set dateTo to null if you want to make the time range only half limited- Returns:
- collection of
OrderHistoryEntryModel
-
-