B:BD[
8.982] → [
6.9873:10559]
--loggedIntervalsHandler :: QDB IO a -> ReaderT a Snap ()
--loggedIntervalsHandler qdb = do
--  let QDB{..} = qdb
--  widx <- mapReaderT liftIO $ readWorkIndex
--  lift . modifyResponse $ addHeader "content-type" "application/json"
--  lift . writeLBS . A.encode $ mapKeys (^. address) widx
--
--payoutsHandler :: QDB IO a -> ReaderT a Snap ()
--payoutsHandler qdb = do 
--  let QDB{..} = qdb
--      dep = linearDepreciation (Months 6) (Months 60) 
--  ptime <- lift . liftIO $ getCurrentTime
--  widx <- mapReaderT liftIO $ readWorkIndex
--  lift . modifyResponse $ addHeader "content-type" "application/json"
--  lift . writeLBS . A.encode . PayoutsResponse $ payouts dep ptime widx
loggedIntervalsHandler :: Handler App App ()
loggedIntervalsHandler = requireLogin $ do
  QDB{..} <- with qdb get
  widx <- liftPG $ runReaderT readWorkIndex
  modifyResponse $ addHeader "content-type" "application/json"
  writeLBS . A.encode $ mapKeys (^. address) widx