Restore remainder of endpoints to compiling status.

[?]
Jan 20, 2015, 6:11 PM
EYGIUUQZSCUCLEF6IFIN6RD3TCSOTTSQEQ2SV7OJRVVNFE6NJQPQC

Dependencies

  • [2] TNR3TEHK Switch to Postgres + snaplet arch compiles.
  • [3] WFZDMVUX Rename ADB -> QDB
  • [4] ADMKQQGC Initial empty Snap project.
  • [5] 64VI73NP Server now compiles using abstracted SQLite
  • [6] 7XN3I3QJ Add 'loggedIntervals' endpoint.
  • [7] IZEVQF62 Work in progress replacing sqlite with postgres.
  • [8] MK7ODWHU Some minor renaming.
  • [*] Z3M53KTL Adrift.
  • [*] 2Y2QZFVF Switch to more modern cabal2nix-based workflow.
  • [*] 64C6AWH6 Rename Ananke -> Quixotic, project reboot.

Change contents

  • edit in server/Main.hs at line 15
    [2.1165]
    [10.112]
    import qualified Data.Aeson as A
  • edit in server/Main.hs at line 18
    [11.170]
    [3.7590]
    import Data.Map
  • edit in server/Main.hs at line 24
    [3.7661]
    [12.2543]
    import Quixotic.Json
  • edit in server/Main.hs at line 109
    [3.5696]
    [3.9241]
    -- | FIXME, make configurable
    depf :: DepF
    depf = linearDepreciation (Months 6) (Months 60)
  • replacement in server/Main.hs at line 142
    [3.982][3.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
    [3.982]
    [3.1016]
    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
  • edit in server/Main.hs at line 149
    [3.1017]
    [2.2462]
    payoutsHandler :: Handler App App ()
    payoutsHandler = requireLogin $ do
    QDB{..} <- with qdb get
    ptime <- liftIO $ getCurrentTime
    widx <- liftPG $ runReaderT readWorkIndex
    modifyResponse $ addHeader "content-type" "application/json"
    writeLBS . A.encode . PayoutsResponse $ payouts depf ptime widx