using System;
using Nancy;
using Nancy.Security;

namespace RaceLapTimer.Modules
{
    public class SystemModule:NancyModule
    {
        //also needs to home system/start_race_session, this should probably be an api method with post arg.
        public SystemModule() : base("/system")
        {
            this.RequiresAuthentication();

            Get[""] = args => GetSystemHomePage(args);
            Get["/pilot"] = args => GetSystemPilotPage(args);
            Get["/soundfile"] = args => GetSystemSoundFilePage(args);
            Get["/configuraiton"] = args => GetConfigurationHomePage(args);
        }

        private dynamic GetConfigurationHomePage(dynamic args)
        {
            throw new NotImplementedException();
        }

        //this will return system configuration settings home page.
        private dynamic GetSystemHomePage(dynamic args)
        {
            return View["SystemIndex.cshtml"];
        }
        
        //system/pilot/create //api method
        //system/pilot/delete/id //api method
        //system/pilot/deactivate_token/pilotId //api method.

        //system/pilot page.
        private dynamic GetSystemPilotPage(dynamic args)
        {
            throw new NotImplementedException();
        }
        
        //system/soundfile page
        private dynamic GetSystemSoundFilePage(dynamic args)
        {
            throw new NotImplementedException();
        }
    }
}
