}                      //NH constuctor

        public Policy(PolicyHolder policyHolder, Offer offer)
        {
            Id            = null;
            Number        = Guid.NewGuid().ToString();
            ProductCode   = offer.ProductCode;
            Status        = PolicyStatus.Active;
            CreateionDate = SysTime.CurrentTime;
            versions.Add(PolicyVersion.FromOffer(this, 1, policyHolder, offer));
        }
        public virtual PolicyVersion EndOn(DateTime endDate)
        {
            var endedCovers = this.covers.Select(c => c.EndOn(endDate)).ToList();

            var termVersion = new PolicyVersion
            {
                Policy                = this.Policy,
                VersionNumber         = this.Policy.NextVersionNumber(),
                PolicyHolder          = new PolicyHolder(PolicyHolder.FirstName, PolicyHolder.LastName, PolicyHolder.Pesel),
                CoverPeriod           = CoverPeriod.EndOn(endDate),
                VersionValidityPeriod = ValidityPeriod.Between(endDate.AddDays(1), VersionValidityPeriod.ValidTo),
                covers                = endedCovers,
                TotalPremiumAmount    = endedCovers.Sum(c => c.Premium)
            };

            return(termVersion);
        }