Example #1
0
        public OperationResult GetBondAccrued(string cusip, string quoteType, double quote, string tradeDate,
                                              string settleDate, int notional)
        {
            try
            {
                var refData = _refDataFetcher.GetByCusip(cusip);

                var analyticsRefData = RefDataMapping.Map(refData);
                //       var analyticsRefData = RefDataMapping.JsonDeserialise<AnalyticsRefData>(refData);
                //          var bond = mockAnalytics.createBond(analyticsRefData);

                return(new OperationResult.OK
                {
                    ResponseResource = _analytics.GetBondEvaluation(analyticsRefData, quoteType,
                                                                    quote, tradeDate, settleDate, notional)
                });
            }

            catch (KeyNotFoundException ex)
            {
                return(new OperationResult.BadRequest {
                    ResponseResource = ex.StackTrace
                });
            }
        }
Example #2
0
        public OperationResult GetBondYield(string cusip, double price)
        {
            try
            {
                var refData = _refDataFetcher.GetByCusip(cusip);

                var analyticsRefData = RefDataMapping.Map(refData);
                //          var bond = mockAnalytics.createBond(analyticsRefData);

                return(new OperationResult.OK {
                    ResponseResource = _analytics.GetBondYield(analyticsRefData, price)
                });
            }

            catch (KeyNotFoundException ex)
            {
                return(new OperationResult.BadRequest {
                    ResponseResource = ex.StackTrace
                });
            }
        }
Example #3
0
        public OperationResult GetByCusip(string cusip)
        {
            Console.WriteLine("Reached RefDataHandler with cusip : " + cusip);

            try
            {
                //  string mockURL = "http://localhost/Repositories/MockRefDataRepository?cusip=" + cusip;

                var refData = _refDataFetcher.GetByCusip(cusip);

                return(new OperationResult.OK
                {
                    ResponseResource = refData
                });
            }

            catch (KeyNotFoundException ex)
            {
                return(new OperationResult.BadRequest {
                    ResponseResource = ex.StackTrace
                });
            }
        }