Search in sources :

Example 1 with ReadableOrderStatusHistory

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;
}
Also used : ReadableOrderStatusHistory(com.salesmanager.shop.model.order.history.ReadableOrderStatusHistory)

Example 2 with ReadableOrderStatusHistory

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;
}
Also used : ShopOrder(com.salesmanager.shop.model.order.ShopOrder) Order(com.salesmanager.core.model.order.Order) ShoppingCart(com.salesmanager.core.model.shoppingcart.ShoppingCart) OrderEntity(com.salesmanager.shop.model.order.OrderEntity) DigitalProductService(com.salesmanager.core.business.services.catalog.product.file.DigitalProductService) OrderProduct(com.salesmanager.core.model.order.orderproduct.OrderProduct) ZonedDateTime(java.time.ZonedDateTime) ReadableOrderPopulator(com.salesmanager.shop.populator.order.ReadableOrderPopulator) Autowired(org.springframework.beans.factory.annotation.Autowired) Delivery(com.salesmanager.core.model.common.Delivery) StringUtils(org.apache.commons.lang3.StringUtils) ShippingQuote(com.salesmanager.core.model.shipping.ShippingQuote) BigDecimal(java.math.BigDecimal) ShippingProduct(com.salesmanager.core.model.shipping.ShippingProduct) Map(java.util.Map) PricingService(com.salesmanager.core.business.services.catalog.product.PricingService) TransactionService(com.salesmanager.core.business.services.payments.TransactionService) ShippingService(com.salesmanager.core.business.services.shipping.ShippingService) CreditCardType(com.salesmanager.core.model.payments.CreditCardType) CustomerFacade(com.salesmanager.shop.store.controller.customer.facade.CustomerFacade) FieldError(org.springframework.validation.FieldError) Set(java.util.Set) CreditCardPayment(com.salesmanager.core.model.payments.CreditCardPayment) ShoppingCartItemPopulator(com.salesmanager.shop.populator.order.ShoppingCartItemPopulator) ZoneId(java.time.ZoneId) PaymentService(com.salesmanager.core.business.services.payments.PaymentService) ServiceRuntimeException(com.salesmanager.shop.store.api.exception.ServiceRuntimeException) ShippingQuoteService(com.salesmanager.core.business.services.shipping.ShippingQuoteService) ShopOrder(com.salesmanager.shop.model.order.ShopOrder) ProductService(com.salesmanager.core.business.services.catalog.product.ProductService) OrderSummary(com.salesmanager.core.model.order.OrderSummary) Billing(com.salesmanager.core.model.common.Billing) CreditCardUtils(com.salesmanager.core.business.utils.CreditCardUtils) BindingResult(org.springframework.validation.BindingResult) OrderService(com.salesmanager.core.business.services.order.OrderService) CollectionUtils(org.apache.commons.collections4.CollectionUtils) ShoppingCartFacade(com.salesmanager.shop.store.controller.shoppingCart.facade.ShoppingCartFacade) ArrayList(java.util.ArrayList) ZoneService(com.salesmanager.core.business.services.reference.zone.ZoneService) OrderTotalSummary(com.salesmanager.core.model.order.OrderTotalSummary) OrderAttribute(com.salesmanager.core.model.order.attributes.OrderAttribute) PersistableOrderProduct(com.salesmanager.shop.model.order.PersistableOrderProduct) Service(org.springframework.stereotype.Service) ProductAttributeService(com.salesmanager.core.business.services.catalog.product.attribute.ProductAttributeService) LinkedHashSet(java.util.LinkedHashSet) ShoppingCartService(com.salesmanager.core.business.services.shoppingcart.ShoppingCartService) Product(com.salesmanager.core.model.catalog.product.Product) Country(com.salesmanager.core.model.reference.country.Country) ReadableOrderProduct(com.salesmanager.shop.model.order.ReadableOrderProduct) EmailTemplatesUtils(com.salesmanager.shop.utils.EmailTemplatesUtils) Validate(org.apache.commons.lang3.Validate) Date(java.util.Date) LoggerFactory(org.slf4j.LoggerFactory) CreditCard(com.salesmanager.core.model.order.payment.CreditCard) ServiceException(com.salesmanager.core.business.exception.ServiceException) ShoppingCartItem(com.salesmanager.core.model.shoppingcart.ShoppingCartItem) MerchantStore(com.salesmanager.core.model.merchant.MerchantStore) ReadableTransaction(com.salesmanager.shop.model.order.transaction.ReadableTransaction) ObjectError(org.springframework.validation.ObjectError) Locale(java.util.Locale) OrderCriteria(com.salesmanager.core.model.order.OrderCriteria) OrderProductPopulator(com.salesmanager.shop.populator.order.OrderProductPopulator) OrderFacade(com.salesmanager.shop.store.controller.order.facade.OrderFacade) CountryService(com.salesmanager.core.business.services.reference.country.CountryService) OrderList(com.salesmanager.core.model.order.OrderList) Instant(java.time.Instant) Collectors(java.util.stream.Collectors) ReadableOrderProductPopulator(com.salesmanager.shop.populator.order.ReadableOrderProductPopulator) ReadableCustomer(com.salesmanager.shop.model.customer.ReadableCustomer) ReadableOrderStatusHistory(com.salesmanager.shop.model.order.history.ReadableOrderStatusHistory) List(java.util.List) Payment(com.salesmanager.core.model.payments.Payment) LocaleUtils(com.salesmanager.shop.utils.LocaleUtils) PersistableOrderStatusHistory(com.salesmanager.shop.model.order.history.PersistableOrderStatusHistory) PersistableOrderApiPopulator(com.salesmanager.shop.populator.order.PersistableOrderApiPopulator) CoreConfiguration(com.salesmanager.core.business.utils.CoreConfiguration) LocalDate(java.time.LocalDate) ProductAvailability(com.salesmanager.core.model.catalog.product.availability.ProductAvailability) Address(com.salesmanager.shop.model.customer.address.Address) OrderStatusHistory(com.salesmanager.core.model.order.orderstatus.OrderStatusHistory) Async(org.springframework.scheduling.annotation.Async) PersistableCustomerPopulator(com.salesmanager.shop.populator.customer.PersistableCustomerPopulator) Order(com.salesmanager.core.model.order.Order) DateUtil(com.salesmanager.shop.utils.DateUtil) HashMap(java.util.HashMap) TransactionType(com.salesmanager.core.model.payments.TransactionType) OrderTotal(com.salesmanager.shop.model.order.total.OrderTotal) PaymentType(com.salesmanager.core.model.payments.PaymentType) HashSet(java.util.HashSet) Inject(javax.inject.Inject) Language(com.salesmanager.core.model.reference.language.Language) ResourceNotFoundException(com.salesmanager.shop.store.api.exception.ResourceNotFoundException) LabelUtils(com.salesmanager.shop.utils.LabelUtils) ReadableTransactionPopulator(com.salesmanager.shop.populator.order.transaction.ReadableTransactionPopulator) Qualifier(org.springframework.beans.factory.annotation.Qualifier) CustomerPopulator(com.salesmanager.shop.populator.customer.CustomerPopulator) PersistablePaymentPopulator(com.salesmanager.shop.populator.order.transaction.PersistablePaymentPopulator) Transaction(com.salesmanager.core.model.payments.Transaction) Constants(com.salesmanager.core.business.constants.Constants) Logger(org.slf4j.Logger) OrderStatus(com.salesmanager.core.model.order.orderstatus.OrderStatus) Customer(com.salesmanager.core.model.customer.Customer) ImageFilePath(com.salesmanager.shop.utils.ImageFilePath) PersistableCustomer(com.salesmanager.shop.model.customer.PersistableCustomer) ShippingSummary(com.salesmanager.core.model.shipping.ShippingSummary) ConversionException(com.salesmanager.core.business.exception.ConversionException) Comparator(java.util.Comparator) Collections(java.util.Collections) ReadableOrderStatusHistory(com.salesmanager.shop.model.order.history.ReadableOrderStatusHistory) ResourceNotFoundException(com.salesmanager.shop.store.api.exception.ResourceNotFoundException) ReadableOrderStatusHistory(com.salesmanager.shop.model.order.history.ReadableOrderStatusHistory) PersistableOrderStatusHistory(com.salesmanager.shop.model.order.history.PersistableOrderStatusHistory) OrderStatusHistory(com.salesmanager.core.model.order.orderstatus.OrderStatusHistory)

Aggregations

ReadableOrderStatusHistory (com.salesmanager.shop.model.order.history.ReadableOrderStatusHistory)2 Constants (com.salesmanager.core.business.constants.Constants)1 ConversionException (com.salesmanager.core.business.exception.ConversionException)1 ServiceException (com.salesmanager.core.business.exception.ServiceException)1 PricingService (com.salesmanager.core.business.services.catalog.product.PricingService)1 ProductService (com.salesmanager.core.business.services.catalog.product.ProductService)1 ProductAttributeService (com.salesmanager.core.business.services.catalog.product.attribute.ProductAttributeService)1 DigitalProductService (com.salesmanager.core.business.services.catalog.product.file.DigitalProductService)1 OrderService (com.salesmanager.core.business.services.order.OrderService)1 PaymentService (com.salesmanager.core.business.services.payments.PaymentService)1 TransactionService (com.salesmanager.core.business.services.payments.TransactionService)1 CountryService (com.salesmanager.core.business.services.reference.country.CountryService)1 ZoneService (com.salesmanager.core.business.services.reference.zone.ZoneService)1 ShippingQuoteService (com.salesmanager.core.business.services.shipping.ShippingQuoteService)1 ShippingService (com.salesmanager.core.business.services.shipping.ShippingService)1 ShoppingCartService (com.salesmanager.core.business.services.shoppingcart.ShoppingCartService)1 CoreConfiguration (com.salesmanager.core.business.utils.CoreConfiguration)1 CreditCardUtils (com.salesmanager.core.business.utils.CreditCardUtils)1 Product (com.salesmanager.core.model.catalog.product.Product)1 ProductAvailability (com.salesmanager.core.model.catalog.product.availability.ProductAvailability)1