Package pl.com.bottega.ecommerce.canonicalmodel.publishedlanguage

Examples of pl.com.bottega.ecommerce.canonicalmodel.publishedlanguage.AggregateId


@Component
public class SystemContext {
 
  public SystemUser getSystemUser(){
    return new SystemUser(new AggregateId("1"));//TODO introduce security integration
  }
View Full Code Here


  private DomainEventPublisher publisher;

  public Payment createPayment(ClientData clientData, Money amount){
    //TODO validate
   
    AggregateId aggregateId = AggregateId.generate();
    publisher.publish(new ClientPaidEvent(aggregateId, clientData, amount));
    return new Payment(aggregateId, clientData, amount);
  }
View Full Code Here

        return "/shipping/shipmentsList";
    }

    @RequestMapping(value = "/send", method = RequestMethod.POST)
    public String shipOrder(@RequestParam("shipmentId") String shipmentId) {
        gate.dispatch(new SendShipmentCommand(new AggregateId(shipmentId)));
        return "redirect:/shipping/shipment/list";
    }
View Full Code Here

        return "redirect:/shipping/shipment/list";
    }

    @RequestMapping(value = "/deliver", method = RequestMethod.POST)
    public String receiveShipment(@RequestParam("shipmentId") String shipmentId) {
        gate.dispatch(new DeliverShipmentCommand(new AggregateId(shipmentId)));
        return "redirect:/shipping/shipment/list";
    }
View Full Code Here

    authenticationHelper.deauthenticate();
  }
 
  @Test
  public void shouldPurchaseProducts(){
    AggregateId orderId = orderingService.createOrder();
    orderingService.addProduct(orderId, new AggregateId("p1"), 1);
    orderingService.addProduct(orderId, new AggregateId("p2"), 20);
    Offer offer = orderingService.calculateOffer(orderId);
   
    orderingService.confirm(orderId, new OrderDetailsCommand(), offer);
  }
View Full Code Here

    orderingService.confirm(orderId, new OrderDetailsCommand(), offer);
  }
 
  @Test
  public void canNotPurchaseIfOfferChanged(){
    AggregateId orderId = orderingService.createOrder();
    orderingService.addProduct(orderId, new AggregateId("p1"), 1);
    orderingService.addProduct(orderId, new AggregateId("p2"), 20);
   
    Offer offer = orderingService.calculateOffer(orderId);
    //change order
    orderingService.addProduct(orderId, new AggregateId("p2"), 30);
    //confirm obsolete offer
    try{
      orderingService.confirm(orderId, new OrderDetailsCommand(), offer);
      Assert.fail();
    }
View Full Code Here

    authenticationHelper.deauthenticate();
  }
 
  @Test
  public void shouldPurchaseProducts(){
    AggregateId orderId = orderingService.createOrder();
   
    AddProdctCommand cmd = new AddProdctCommand(orderId, new AggregateId("p1"), 1);   
    gate.dispatch(cmd);
   
    Offer offer = orderingService.calculateOffer(orderId);
   
    orderingService.confirm(orderId, new OrderDetailsCommand(), offer);
View Full Code Here

TOP

Related Classes of pl.com.bottega.ecommerce.canonicalmodel.publishedlanguage.AggregateId

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.