Fix logged hours display error.
[?]
Jan 31, 2021, 11:18 PM
W3PIWHDK4DQHBD54FN4PIF3PELIT2V74L62AMMXM2M5BHYAACALACDependencies
- [2]
DZ7G36NCAllow first-revenue cutoff for depreciation. - [3]
M4PWY5RUPreliminary work to add support for Zcash payments. - [4]
HMDM3B55Implement core of payments/billing infrastructure. - [5]
IR75ZMX3Return actual events for interval ends, not just timestamps. - [6]
NVOCQVASInitial failing tests. - [7]
Y35QCWYWMinor improvement in WorkIndex type to eliminate duplicated information. - [8]
NEDDHXUKReformat via stylish-haskell - [9]
A2J7B4SCInitial impl of depreciation function. - [10]
CI4OPKQMAdd payouts spec. - [11]
SCXG6TJWMake log reduction safer in presence of overlapping events. - [12]
4R7XIYK3Switch from ClassyPrelude to Relude - [13]
4SCFOJGNSpecs for recovering intervals from the log now pass. - [14]
7HPY3QPFFix linting errors. (yay hlint!) - [15]
EMVTF2IWWIP moving back to snap. - [16]
KNSI575VCleanup of EventLog types. - [17]
RKY3XCSIGet the correct contributor data. - [18]
OBFPJS2GProject successfully builds and tests under nix. - [19]
LTSVBVA2Update to a recent haskoin-core. Fix Stack build. - [20]
N4NDAZYTInitial implementation of payouts. - [21]
OV5AKJHARemove unused LogInterval type. - [22]
B6HWAPDPModularize & update to recent haskoin. - [23]
7KZP4RHZSwitch from Data.Time to Data.Thyme - [24]
4U7F3CPITHE GREAT RENAMING OF THINGS! - [25]
U7YAT2ZKAdd error reporting to signup form. - [26]
64C6AWH6Rename Ananke -> Quixotic, project reboot. - [27]
EFSXYZPOAutoformat everything with brittany. - [28]
UUR6SMCAAdd start of specs for auctions. - [29]
5DRIWGLUImproving TimeLog specs - [30]
UWMGUJOWAutoformat sources. - [31]
X3ES7NUAFine. I'll use ormolu. At least it doesn't break the code. - [32]
4354Y4PEAdd endpoint to list project contributors. - [33]
NMWWP4ZNTrying out Hspec - [*]
QMRKFEPGRefactor QDB to use a free monad algebra instead. - [*]
IPG33FAWAdd billing daemon - [*]
PBD7LZYQPostgres & auth are beginning to function.
Change contents
- edit in lib/Aftok/TimeLog.hs at line 2
{-# LANGUAGE TemplateHaskell #-}{-# LANGUAGE ViewPatterns #-} - edit in lib/Aftok/TimeLog.hs at line 3
{-# LANGUAGE TemplateHaskell #-} - edit in lib/Aftok/TimeLog.hs at line 5
{-# LANGUAGE ViewPatterns #-} - replacement in lib/Aftok/TimeLog.hs at line 24
import Control.Lens (Lens', (.~), (^.), makeClassy, makeLenses, makePrisms, view)import Control.Lens ((.~), Lens', (^.), makeClassy, makeLenses, makePrisms, view) - edit in lib/Aftok/TimeLog.hs at line 49
- edit in lib/Aftok/TimeLog.hs at line 87
- edit in lib/Aftok/TimeLog.hs at line 174
- replacement in lib/Aftok/TimeLog.hs at line 179
workCredit depf ptime ivals =let intervalCredit ival = (Sum . ilen &&& Sum . depf Nothing ptime) $ fmap (view eventTime) ivalworkCredit depf payoutDate ivals =let intervalCredit ival = (Sum . ilen &&& Sum . depf Nothing payoutDate) $ fmap (view eventTime) ival - replacement in lib/Aftok/TimeLog.hs at line 188[3.1172]→[3.4834:4871](∅→∅),[3.19859]→[3.4834:4871](∅→∅),[3.23365]→[3.4834:4871](∅→∅),[3.32156]→[3.4834:4871](∅→∅),[3.90816]→[3.4834:4871](∅→∅),[3.1819]→[3.4834:4871](∅→∅)
payouts dep ptime (WorkIndex widx) =payouts depf payoutDate (WorkIndex widx) = - replacement in lib/Aftok/TimeLog.hs at line 191
let (logged, depreciated) = workCredit dep ptime ivalslet (logged, depreciated) = workCredit depf payoutDate ivals - replacement in lib/Aftok/TimeLog.hs at line 240
(StartWork t, StopWork t') | t' > t -> Right $ Interval e e' -- complete interval found(StartWork t, StartWork t') -> Left $ if t > t' then e else e' -- ignore redundant starts(StopWork t, StopWork t') -> Left $ if t <= t' then e else e' -- ignore redundant ends(StartWork t, StopWork t')| t' > t ->-- complete interval foundRight $ Interval e e'(StartWork t, StartWork t') ->-- ignore redundant startsLeft $ if t > t' then e else e'(StopWork t, StopWork t') ->-- ignore redundant endsLeft $ if t <= t' then e else e' - edit in lib/Aftok/Util.hs at line 10
import qualified Debug.Trace as T - edit in lib/Aftok/Util.hs at line 32[36.31166]
traceWith :: Show b => (a -> b) -> a -> atraceWith f a = T.trace (show $ f a) a - replacement in server/Aftok/Snaplet/Projects.hs at line 125
_timeDevoted = Hours . (`div` 360) . round . C.toSeconds' $ ws ^. wsLogged,_timeDevoted = Hours . (`div` 3600) . round . C.toSeconds' $ ws ^. wsLogged, - edit in test/Aftok/TimeLogSpec.hs at line 2
{-# LANGUAGE TypeApplications #-} - edit in test/Aftok/TimeLogSpec.hs at line 3
{-# LANGUAGE TypeApplications #-} - edit in test/Aftok/TimeLogSpec.hs at line 12
import Prelude hiding (head, tail) - replacement in test/Aftok/TimeLogSpec.hs at line 15[3.82762]→[3.1323:1419](∅→∅),[3.1419]→[2.1856:1965](∅→∅),[2.1965]→[3.1420:1449](∅→∅),[3.82813]→[3.1420:1449](∅→∅)
import Aftok.Types (UserId (..), DepreciationFunction(..))import Control.Lens ((^.), view, to)import Data.AffineSpace ((.-.), (.+^))import Data.VectorSpace ((*^), Sum (..), (^+^), (^-^), getSum, zeroV)import Data.Maybe (fromJust)import Aftok.Types (DepreciationFunction (..), UserId (..))import Control.Lens ((^.), to, view)import Data.AffineSpace ((.+^)) - edit in test/Aftok/TimeLogSpec.hs at line 19
import Data.Ratio ((%)) - edit in test/Aftok/TimeLogSpec.hs at line 21
import Data.Maybe (fromJust)import Data.Ratio ((%)) - replacement in test/Aftok/TimeLogSpec.hs at line 27
import Test.QuickCheck (Gen, forAll, sample', listOf, suchThat, arbitrary, choose)import Test.QuickCheck (Gen, arbitrary, choose, forAll, listOf, sample', suchThat)import Prelude hiding (head, tail) - edit in test/Aftok/TimeLogSpec.hs at line 78
- edit in test/Aftok/TimeLogSpec.hs at line 83
- edit in test/Aftok/TimeLogSpec.hs at line 87
- edit in test/Aftok/TimeLogSpec.hs at line 89
- edit in test/Aftok/TimeLogSpec.hs at line 91
- edit in test/Aftok/TimeLogSpec.hs at line 111
- replacement in test/Aftok/TimeLogSpec.hs at line 114
len = fromInteger @C.NominalDiffTime 360len = fromInteger @C.NominalDiffTime 3600 - replacement in test/Aftok/TimeLogSpec.hs at line 118
. filter (\i -> fst i `mod` 2 == 0)$ ([(0 :: Int)..] `zip` (timestamps `zip` tail timestamps))widx = WorkIndex $ M.fromList[ (u0, L.fromList $ take 10 intervals), (u1, L.fromList $ take 30 intervals), (u2, L.fromList $ take 120 intervals)]. filter (\i -> fst i `mod` 2 == 0)$ ([(0 :: Int) ..] `zip` (timestamps `zip` tail timestamps))widx =WorkIndex $M.fromList[ (u0, L.fromList $ take 10 intervals),(u1, L.fromList $ take 30 intervals),(u2, L.fromList $ take 120 intervals)] - edit in test/Aftok/TimeLogSpec.hs at line 130[3.729]→[3.3975:3976](∅→∅),[3.2104]→[3.3975:3976](∅→∅),[3.2989]→[3.3975:3976](∅→∅),[3.3832]→[3.3975:3976](∅→∅),[3.71422]→[3.3975:3976](∅→∅),[3.4083]→[3.3975:3976](∅→∅)
- replacement in test/Aftok/TimeLogSpec.hs at line 131
(shares ^. loggedTotal `shouldBe` (fromInteger @C.NominalDiffTime (360 * 160)))(shares ^. loggedTotal `shouldBe` (fromInteger @C.NominalDiffTime (3600 * 160))) - edit in test/Aftok/TimeLogSpec.hs at line 135
- edit in test/Aftok/TimeLogSpec.hs at line 168