using Interfaces;
using Nancy;

namespace RaceLapTimer.ApiControllers
{
    public class InfoApiModule:NancyModule
    {
        private IDbProvider _provider;
        public InfoApiModule(IDbProvider provider) : base("/api/info")
        {
            _provider = provider;

            Get["/lastscanned"] = args => GetLastScannedId();
        }

        private dynamic GetLastScannedId()
        {
            return Response.AsJson(_provider.GetLastScannedId());
        }
    }
}
