Examples of AggregateId


Examples of com.insacosa.canonicalmodel.publishedlanguage.AggregateId

import com.insacosa.canonicalmodel.publishedlanguage.AggregateId;

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

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

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

  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

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

        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

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

        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

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

    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

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

    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

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

    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
Copyright © 2018 www.massapi.com. 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.