using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Web.Http.Results;
using Interfaces;
using Nancy;

namespace RaceLapTimer.ApiControllers
{
    class OldRaceSessionApiModule : NancyModule
    {
        private INotifierManager _manager;

        public OldRaceSessionApiModule(INotifierManager notifierManager)
            :base("/api/v1/race_session")
        {
            _manager = notifierManager;
            Post["new"] = args => CreateNewRace();
        }

        private dynamic CreateNewRace()
        {
            //TODO: what goes here?
            _manager.NotifyRaceStarted(new NotificationEventArgs());
            return HttpStatusCode.OK;
        }
    }
}
