Beispiel #1
0
        public void UpdatePercentDed(float pValue)
        {
            PercentValue  value  = Value as PercentValue;
            MonetaryValue mValue = new MonetaryValue(value.Amount * pValue);

            Value   = mValue;
            DedType = TermValueType.Numeric;
        }
Beispiel #2
0
        private static void GetInfoFromJSONExp(Dictionary <string, object> expDict, out Value result, out TermValueType termValType)
        {
            Value parsedValue = RecursiveParseJSONValue(expDict);

            if (parsedValue is FunctionValue)
            {
                FunctionValue function = parsedValue as FunctionValue;
                if (function.Function == FunctionType.RCV)
                {
                    string RCVarg2 = (function.Arguments[1] as SymbolicValue).Symbol;
                    if (RCVarg2 == "Covered")
                    {
                        termValType = TermValueType.PercentCovered;
                    }
                    else if (RCVarg2 == "Affected")
                    {
                        termValType = TermValueType.PercentAffected;
                    }
                    else
                    {
                        throw new JSONParseException("Cannot handle RCV with second argument: " + RCVarg2);
                    }
                    result = (PercentValue)function.Arguments[0];
                }
                else if (function.Function == FunctionType.Subject)
                {
                    termValType = TermValueType.PercentLoss;
                    result      = (PercentValue)function.Arguments[0];
                }
                else if (function.Function == FunctionType.Min || function.Function == FunctionType.Sum || function.Function == FunctionType.Max || function.Function == FunctionType.Constant)
                {
                    termValType = TermValueType.PayFunction;
                    result      = function;
                }
                else if (function.Function == FunctionType.WaitingPeriod)
                {
                    if (function.Arguments[1].ToString() == "Days")
                    {
                        termValType = TermValueType.PercentCovered;
                        result      = new PercentValue(function.Arguments[0].Amount / 365 * 100);
                    }
                    else
                    {
                        throw new NotSupportedException("Cannot handle BI waiting period that is not specified as days...");
                    }
                }
                else
                {
                    throw new JSONParseException("Cannot currently process functions of type: " + function.Function.ToString());
                }
            }
            else
            {
                termValType = TermValueType.Numeric;
                result      = parsedValue;
            }
        }
Beispiel #3
0
 public void SetFinTerms(string name, bool _attIsFranchise, Value _attPoint, Value _limit, PercentValue _proRata, bool _unlimited, TermValueType _valType)
 {
     CoverName      = name;
     AttIsFranchise = _attIsFranchise;
     AttPoint       = _attPoint;
     Limit          = _limit;
     ProRata        = _proRata;
     Unlimited      = _unlimited;
     LimitValType   = _valType;
 }
Beispiel #4
0
 public Cover(string name, bool _attIsFranchise, Value _attPoint, Value _limit, PercentValue _proRata, bool _unlimited, TimeBasis _attachmentTimeBasis, TimeBasis _limitTimeBasis, TermValueType _valType)
 {
     CoverName           = name;
     AttIsFranchise      = _attIsFranchise;
     AttPoint            = _attPoint;
     Limit               = _limit;
     ProRata             = _proRata;
     Unlimited           = _unlimited;
     LimitTimeBasis      = _limitTimeBasis;
     AttachmentTimeBasis = _attachmentTimeBasis;
     LimitValType        = _valType;
 }
Beispiel #5
0
 public void SetFinTerms(string name, bool _attIsFranchise, Value _attPoint,
                         Value _limit, PercentValue _proRata, bool _unlimited, TermValueType _valType,
                         uint _numofReinstatements, bool _unlimitedReinstatements)
 {
     CoverName               = name;
     AttIsFranchise          = _attIsFranchise;
     AttPoint                = _attPoint;
     Limit                   = _limit;
     ProRata                 = _proRata;
     Unlimited               = _unlimited;
     LimitValType            = _valType;
     NumofReinstatements     = _numofReinstatements;
     UnlimitedReinstatements = _unlimitedReinstatements;
 }
Beispiel #6
0
        public static Cover GetCoverForTerm(Dictionary <string, object> coverDictionary)
        {
            int index = Convert.ToInt32(coverDictionary["Index"]);
            //bool franchise = Convert.ToBoolean(coverDictionary["IsFranchise"]);

            bool unlimited = false;
            bool franchise = false;

            if (coverDictionary.ContainsKey("isFranchise"))
            {
                franchise = true;
            }

            //if (!GetValueFromJSONExp(Convert.ToBoolean(coverDictionary["IsFranchise"]), out franchise))
            //    throw new InvalidOperationException("IsGranchise with index " + index.ToString() + " is not coded as monetary amount in CDL, cannot be supported at this time...");

            TermValueType vType = TermValueType.Numeric;
            Value         attpoint;
            Value         limit = null;
            Value         proRata;

            string name = coverDictionary["Label"].ToString();

            if (coverDictionary.ContainsKey("AttachmentSpecification"))
            {
                GetInfoFromJSONCoverExp(coverDictionary["AttachmentSpecification"], out attpoint, out vType);
            }
            else
            {
                attpoint = new MonetaryValue(0);
            }

            if (coverDictionary.ContainsKey("LimitSpecification"))
            {
                GetInfoFromJSONCoverExp(coverDictionary["LimitSpecification"], out limit, out vType);
            }
            else
            {
                unlimited = true;
            };

            if (coverDictionary.ContainsKey("Participation"))
            {
                GetInfoFromJSONCoverExp(coverDictionary["Participation"], out proRata, out vType);
            }
            else
            {
                proRata = new PercentValue(100);
            }

            TimeBasis attTimeBasis;
            TimeBasis limitTimeBasis;

            if (coverDictionary.ContainsKey("AttachmentTimeBasis"))
            {
                attTimeBasis = (TimeBasis)Enum.Parse(typeof(TimeBasis), coverDictionary["AttachmentTimeBasis"].ToString());
            }
            else
            {
                attTimeBasis = TimeBasis.Occurrence;
            }

            if (coverDictionary.ContainsKey("LimitTimeBasis"))
            {
                limitTimeBasis = (TimeBasis)Enum.Parse(typeof(TimeBasis), coverDictionary["LimitTimeBasis"].ToString());
            }
            else
            {
                limitTimeBasis = TimeBasis.Occurrence;
            }

            return(new Cover(name, franchise, attpoint, limit, (PercentValue)proRata, unlimited, attTimeBasis, limitTimeBasis, vType));
        }