public void DenyPricing(long suggestedPrice) { if (!Progress.WasPricingDenied()) { Apply(PricingDenied.Instance(Id, Client, Expectations, suggestedPrice)); } }
public static PricingDenied Instance( Id proposalId, Client client, Expectations expectations, long suggestedPrice) { PricingDenied pricingDenied = new PricingDenied { ProposalId = proposalId.Value, ClientId = client.Id.Value, Price = expectations.Price, SuggestedPrice = suggestedPrice }; return(pricingDenied); }
public void When(PricingDenied deniedEvent) { this.Expectations = Expectations.WithAdjusted(deniedEvent.SuggestedPrice); this.Progress = Progress.DeniedForPricing(); }