Package pl.com.bottega.ecommerce.sales.domain.productscatalog

Examples of pl.com.bottega.ecommerce.sales.domain.productscatalog.Product


 
  @Override
  public Void handle(AddProdctCommand command) {
    Reservation reservation = reservationRepository.load(command.getOrderId());
   
    Product product = productRepository.load(command.getProductId());
   
    if (! product.isAvailabe()){
      Client client = loadClient()
      product = suggestionService.suggestEquivalent(product, client);
    }
     
    reservation.add(product, command.getQuantity());
View Full Code Here


  @Override
  public void addProduct(AggregateId orderId, AggregateId productId,
      int quantity) {
    Reservation reservation = reservationRepository.load(orderId);
   
    Product product = productRepository.load(productId);
   
    if (! product.isAvailabe()){
      Client client = loadClient()
      product = suggestionService.suggestEquivalent(product, client);
    }
     
    reservation.add(product, quantity);
View Full Code Here

  @Invariant("duplicates")
  @Test
  public void shouldIncreaseQuantityWhenAddingAlreadyAddedProduct(){
    //given
    Reservation reservation = ReservationObjectMother.emptyReservation();
    Product product = ProductObjectMother.someProduct();
    reservation.add(product, 1);
    //when
    reservation.add(product, 1);
    //then
    Assert.assertEquals(1, reservation.getReservedProducts().size());
View Full Code Here

TOP

Related Classes of pl.com.bottega.ecommerce.sales.domain.productscatalog.Product

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.