Exemple #1
0
 public static Offer ForPrice(string productCode, DateTime policyFrom, DateTime policyTo, PolicyHolder policyHolder, Price price) =>
 new Offer(productCode, policyFrom, policyTo, policyHolder, price, null);
Exemple #2
0
 public static Offer ForPriceAndAgent(string productCode, DateTime policyFrom, DateTime policyTo, PolicyHolder policyHolder, Price price, string agent) =>
 new Offer(productCode, policyFrom, policyTo, policyHolder, price, agent);
Exemple #3
0
        protected Offer(string productCode, DateTime policyFrom, DateTime policyTo, PolicyHolder policyHolder, Price price, string agentLogin)
        {
            this._covers = price.Prices
                           .Select(c => new Cover(c.Key, c.Value))
                           .ToList();

            this.Number               = Guid.NewGuid().ToString();
            this.ProductCode          = productCode;
            this.PolicyValidityPeriod = ValidityPeriod.Between(policyFrom, policyTo);
            this.PolicyHolder         = policyHolder;
            this.Status               = OfferStatus.New;
            this.TotalPrice           = price.Prices.Sum(c => c.Value);
            this.AgentLogin           = agentLogin;
        }