public static ValuationReport Generate(string valuationId, string party1Name, string party2Name,
                                               bool isParty1Base, Trade trade, Market market,
                                               AssetValuation assetValuation)
        {
            var valuationReport = new ValuationReport
            {
                header = new NotificationMessageHeader
                {
                    messageId = new MessageId
                    {
                        Value = valuationId
                    }
                },
                market = market
            };
            //  Associate id with the valuation
            //
            var tradeValuationItem = new TradeValuationItem();

            valuationReport.tradeValuationItem = new[] { tradeValuationItem };
            string baseParty = isParty1Base ? party1Name : party2Name;
            Party  party1    = PartyFactory.Create("Party1", party1Name);
            Party  party2    = PartyFactory.Create("Party2", party2Name);

            valuationReport.party           = new[] { party1, party2 };
            tradeValuationItem.Items        = new object[] { trade };
            tradeValuationItem.valuationSet = new ValuationSet
            {
                baseParty      = PartyReferenceFactory.Create(baseParty),
                assetValuation = new[] { assetValuation }
            };
            return(valuationReport);
        }
示例#2
0
        internal static void ReplacePartiesInValuationReport(ValuationReport valuationReport, List <PartyIdRangeItem> partyIdList)
        {
            if (null == partyIdList)
            {
                return;
            }
            var listOfParties = new List <Party>();

            foreach (PartyIdRangeItem partyIdRangeItem in partyIdList)
            {
                Party party   = PartyFactory.Create(partyIdRangeItem.IdOrRole);
                var   partyId = new PartyId {
                    Value = partyIdRangeItem.PartyId
                };
                party.partyId = new[] { partyId };
                listOfParties.Add(party);
            }
            valuationReport.party = listOfParties.ToArray();
        }