public RootModel( TargetingType targetingType, BroadGlobalActivePortfolio portfolio, TargetingTypeBasketBaseValueChangesetInfo latestTtbbvChangesetInfo, TargetingTypeBasketPortfolioTargetChangesetInfo latestTtbptChangesetInfo, BgaPortfolioSecurityFactorChangesetInfo latestPstoChangesetInfo, BuPortfolioSecurityTargetChangesetInfo latestPstChangesetInfo, GlobeModel globe, CashModel cash, Overlaying.RootModel factors, IExpression <Decimal?> portfolioScaledGrandTotalExpression, IExpression <Decimal?> trueExposureGrandTotal, IExpression <Decimal?> trueActiveGrandTotal, DateTime benchmarkDate, Boolean isUserPermittedToSave ) { this.TargetingType = targetingType; this.Portfolio = portfolio; this.LatestTtbbvChangeset = latestTtbbvChangesetInfo; this.LatestTtbptChangeset = latestTtbptChangesetInfo; this.LatestPstoChangeset = latestPstoChangesetInfo; this.LatestPstChangeset = latestPstChangesetInfo; this.Globe = globe; this.Cash = cash; this.Factors = factors; this.PortfolioScaledGrandTotal = portfolioScaledGrandTotalExpression; this.TrueExposureGrandTotal = trueExposureGrandTotal; this.TrueActiveGrandTotal = trueActiveGrandTotal; this.BenchmarkDate = benchmarkDate; this.IsUserPermittedToSave = isUserPermittedToSave; }
protected IEnumerable <IValidationIssue> ValidateFactors(Overlaying.RootModel overlay) { return(overlay.Items.SelectMany(item => { return base.ValidateScope(item.BottomUpPortfolio.Name, item.OverlayFactor.Validate()); })); }
protected Overlaying.RootModel DeserializeOverlay( JsonReader reader, SecurityRepository securityRepository, PortfolioRepository portfolioRepository ) { var items = reader.ReadArray(JsonNames.Items, delegate { return(this.DeserializeOverlayItem( reader, securityRepository, portfolioRepository )); }); var result = new Overlaying.RootModel(items); return(result); }
protected void SerializeOverlay(Overlaying.RootModel overlay, IJsonWriter writer, CalculationTicket ticket) { writer.WriteArray(overlay.Items, JsonNames.Items, item => { writer.Write(delegate { #warning set up a special object for JSON property names in order not to confuse them with string values writer.Write(JsonNames.Portfolio, delegate { this.portfolioSerializer.SerializeBottomUpPortfolio(item.BottomUpPortfolio, writer); }); this.expressionWriter.SerializeOnceResolved( item.OverlayFactor, JsonNames.OverlayFactor, writer, ticket ); }); }); }
protected void TraverseOverlay(Overlaying.RootModel model, List <IExpression> result) { model.Items.ForEach(item => result.Add(item.OverlayFactor)); }