Search in sources :

Example 1 with Order

use of com.stardata.starshop2.ordercontext.command.domain.order.Order in project starshop by beautautumn.

the class OrderAppService method delete.

public OrderDeletedResponse delete(Long orderIdLong) {
    LongIdentity orderId = LongIdentity.from(orderIdLong);
    Order order = managingService.setInvisible(orderId);
    return OrderDeletedResponse.from(order);
}
Also used : WxPrepayOrder(com.stardata.starshop2.ordercontext.command.domain.order.WxPrepayOrder) Order(com.stardata.starshop2.ordercontext.command.domain.order.Order) LongIdentity(com.stardata.starshop2.sharedcontext.domain.LongIdentity)

Example 2 with Order

use of com.stardata.starshop2.ordercontext.command.domain.order.Order in project starshop by beautautumn.

the class OrderAppService method confirmReceived.

public OrderConfirmedResponse confirmReceived(Long orderIdLong) {
    LongIdentity orderId = LongIdentity.from(orderIdLong);
    Order order = managingService.closeOrder(orderId);
    OrderClosedEvent orderEvent = new OrderClosedEvent(order);
    orderEventPublisher.publish(orderEvent);
    return OrderConfirmedResponse.from(order);
}
Also used : WxPrepayOrder(com.stardata.starshop2.ordercontext.command.domain.order.WxPrepayOrder) Order(com.stardata.starshop2.ordercontext.command.domain.order.Order) LongIdentity(com.stardata.starshop2.sharedcontext.domain.LongIdentity)

Example 3 with Order

use of com.stardata.starshop2.ordercontext.command.domain.order.Order in project starshop by beautautumn.

the class OrderAppService method getDetail.

public OrderResponse getDetail(Long orderIdLong) {
    LongIdentity orderId = LongIdentity.from(orderIdLong);
    Order order = managingService.detail(orderId);
    return OrderResponse.from(order);
}
Also used : WxPrepayOrder(com.stardata.starshop2.ordercontext.command.domain.order.WxPrepayOrder) Order(com.stardata.starshop2.ordercontext.command.domain.order.Order) LongIdentity(com.stardata.starshop2.sharedcontext.domain.LongIdentity)

Example 4 with Order

use of com.stardata.starshop2.ordercontext.command.domain.order.Order in project starshop by beautautumn.

the class OrderManagingService method closeOrder.

public Order closeOrder(LongIdentity orderId) {
    Order order = orderRepository.instanceOf(orderId);
    order.close();
    orderRepository.update(order);
    return order;
}
Also used : WxPrepayOrder(com.stardata.starshop2.ordercontext.command.domain.order.WxPrepayOrder) Order(com.stardata.starshop2.ordercontext.command.domain.order.Order)

Example 5 with Order

use of com.stardata.starshop2.ordercontext.command.domain.order.Order in project starshop by beautautumn.

the class OrderManagingService method setInvisible.

public Order setInvisible(LongIdentity orderId) {
    Order order = orderRepository.instanceOf(orderId);
    order.setInvisible();
    orderRepository.update(order);
    return order;
}
Also used : WxPrepayOrder(com.stardata.starshop2.ordercontext.command.domain.order.WxPrepayOrder) Order(com.stardata.starshop2.ordercontext.command.domain.order.Order)

Aggregations

Order (com.stardata.starshop2.ordercontext.command.domain.order.Order)9 WxPrepayOrder (com.stardata.starshop2.ordercontext.command.domain.order.WxPrepayOrder)9 LongIdentity (com.stardata.starshop2.sharedcontext.domain.LongIdentity)3 BizParameter (com.stardata.starshop2.sharedcontext.domain.BizParameter)2 WxPayResult (com.stardata.starshop2.ordercontext.command.domain.order.WxPayResult)1