use of com.salesmanager.shop.model.order.history.ReadableOrderStatusHistory in project shopizer by shopizer-ecommerce.
the class OrderFacadeImpl method mapToReadbleOrderStatusHistory.
ReadableOrderStatusHistory mapToReadbleOrderStatusHistory(OrderStatusHistory source) {
ReadableOrderStatusHistory readable = new ReadableOrderStatusHistory();
readable.setComments(source.getComments());
readable.setDate(DateUtil.formatLongDate(source.getDateAdded()));
readable.setId(source.getId());
readable.setOrderId(source.getOrder().getId());
readable.setOrderStatus(source.getStatus().name());
return readable;
}
use of com.salesmanager.shop.model.order.history.ReadableOrderStatusHistory in project shopizer by shopizer-ecommerce.
the class OrderFacadeImpl method getReadableOrderHistory.
@Override
public List<ReadableOrderStatusHistory> getReadableOrderHistory(Long orderId, MerchantStore store, Language language) {
Order order = orderService.getOrder(orderId, store);
if (order == null) {
throw new ResourceNotFoundException("Order id [" + orderId + "] not found for merchand [" + store.getId() + "]");
}
Set<OrderStatusHistory> historyList = order.getOrderHistory();
List<ReadableOrderStatusHistory> returnList = historyList.stream().map(f -> mapToReadbleOrderStatusHistory(f)).collect(Collectors.toList());
return returnList;
}
Aggregations