public Repr.Waypoint To(
                int reverseAuctionId,
                Repr.Waypoint newPickup)
            {
                newPickup.MustNotBeNull(nameof(newPickup));

                // This assertion knows too much about underlying details.
                // It seems like another clue that we need a Domain Value Type
                // that represents a ReverseAuctionIdentifier.
                //reverseAuctionId.MustBePositive(nameof(reverseAuctionId));

                var auction = _repository.Get(reverseAuctionId);

                // TODO: There's a substantial, intentional mismatch bettween
                // the coarser API Waypoint resource and the finer-grained
                // Domain Waypoint, Location, and TimeRange concepts.  Right
                // now, only changes to the location are allowed.  Pickup
                // TimeRange changes should be allowed, but require both more
                // business logic and some thought about how the two fit
                // together.
                ThrowIfPickupTimeRangeHasChanged(auction, newPickup);

                auction.AlterPickup(
                    _dependencies,
                    newPickup.Address);

                _repository.Update(auction);
                return(Convert.ToRepr(auction.BuyerTerms.Pickup));
            }
Exemplo n.º 2
0
 public void LoadExistingReverseAuction(int id)
 {
     _aggregate = _repository.Get(id);
 }