Add first revenue date to project payout computation.
[?]
Jan 31, 2021, 11:49 PM
XXJFUZOVELM3KIPRU6C2NHB3YQ3B3A3GGF2YYBTYJGPU3PR2OV4ACDependencies
- [2]
W3PIWHDKFix logged hours display error. - [3]
PBD7LZYQPostgres & auth are beginning to function. - [4]
UWMGUJOWAutoformat sources. - [5]
7KZP4RHZSwitch from Data.Time to Data.Thyme - [6]
4QX5E5ACInitial compilation of payouts function succeeds. - [7]
HMDM3B55Implement core of payments/billing infrastructure. - [8]
QMRKFEPGRefactor QDB to use a free monad algebra instead. - [9]
4354Y4PEAdd endpoint to list project contributors. - [10]
7DBNV3GVInitial, stack-based impl of time log event reduction. - [11]
TLQ72DSJLenses, sqlite-simple - [12]
2XQD6KKKAdd invitation logic and clean up DBProg error handling. - [13]
4R7XIYK3Switch from ClassyPrelude to Relude - [14]
EFSXYZPOAutoformat everything with brittany. - [15]
DZ7G36NCAllow first-revenue cutoff for depreciation. - [16]
MU6WOCCJUpdate auctions to permit zcash as a funding currency. - [17]
NEDDHXUKReformat via stylish-haskell - [18]
IR75ZMX3Return actual events for interval ends, not just timestamps. - [19]
HALRDT2FAdded initial auction create route. - [20]
X3ES7NUAFine. I'll use ormolu. At least it doesn't break the code. - [21]
CI4OPKQMAdd payouts spec. - [22]
M4PWY5RUPreliminary work to add support for Zcash payments. - [23]
5DRIWGLUImproving TimeLog specs - [24]
NVOCQVASInitial failing tests. - [25]
N4NDAZYTInitial implementation of payouts. - [26]
DXIGERDTChange order of Docker build to avoid rebuilding the universe. - [27]
SLL7262CMake depreciation functions more flexible. - [28]
U7YAT2ZKAdd error reporting to signup form. - [29]
RKY3XCSIGet the correct contributor data. - [*]
KEP5WUFJConvert project to stack-based build. - [*]
B6HWAPDPModularize & update to recent haskoin. - [*]
2WOOGXDHUse dbmigrations to manage database state.
Change contents
- replacement in lib/Aftok/Database/PostgreSQL/Projects.hs at line 34
depf,depRules, - edit in lib/Aftok/Database/PostgreSQL/Projects.hs at line 48
DepreciationRules(..),depf - replacement in lib/Aftok/Database/PostgreSQL/Projects.hs at line 67
<*> (unSerDepFunction <$> fieldWith fromJSONField)<*> (DepreciationRules<$> (unSerDepFunction <$> fieldWith fromJSONField)<*> (fmap C.toThyme <$> field)) - replacement in lib/Aftok/Database/PostgreSQL/Projects.hs at line 91
toJSON $ p ^. depf . to SerDepFunctiontoJSON $ p ^. depRules . depf . to SerDepFunction - replacement in lib/Aftok/Database/PostgreSQL/Projects.hs at line 103
[sql| SELECT project_name, inception_date, initiator_id, depreciation_fn FROM projects WHERE id = ? |][sql| SELECT project_name, inception_date, initiator_id, depreciation_fn, first_revenue_dateFROM projects WHERE id = ? |] - replacement in lib/Aftok/Database/PostgreSQL/Projects.hs at line 112
p.id, p.project_name, p.inception_date, p.initiator_id, p.depreciation_fnp.id, p.project_name, p.inception_date, p.initiator_id, p.depreciation_fn, p.first_revenue_date - replacement in lib/Aftok/Payments/Util.hs at line 18
import Aftok.Project (depf)import Aftok.Project (depRules) - replacement in lib/Aftok/Payments/Util.hs at line 37
pure $ TL.payouts (TL.toDepF $ project' ^. depf) ptime widxpure $ TL.payouts (TL.toDepF $ project' ^. depRules) ptime widx - replacement in lib/Aftok/Project.hs at line 25
_depf :: DepreciationFunction_depRules :: DepreciationRules - edit in lib/Aftok/TimeLog.hs at line 20
DepreciationRules(..), - replacement in lib/Aftok/TimeLog.hs at line 139
type DepF = Maybe C.UTCTime -> C.UTCTime -> Interval C.UTCTime -> NDTtype DepF = C.UTCTime -> Interval C.UTCTime -> NDT - replacement in lib/Aftok/TimeLog.hs at line 141
toDepF :: DepreciationFunction -> DepFtoDepF (LinearDepreciation undepLength depLength) =linearDepreciation undepLength depLengthtoDepF :: DepreciationRules -> DepFtoDepF (DepreciationRules (LinearDepreciation undepLength depLength) firstRevenue) =linearDepreciation firstRevenue undepLength depLength - edit in lib/Aftok/TimeLog.hs at line 151
-- | The date of first revenue, if applicableMaybe C.UTCTime -> - replacement in lib/Aftok/TimeLog.hs at line 159
linearDepreciation undepDays depDays =linearDepreciation firstRevenue undepDays depDays = - replacement in lib/Aftok/TimeLog.hs at line 170
in \firstRevenue payoutDate ival ->in \payoutDate ival -> - replacement in lib/Aftok/TimeLog.hs at line 183
let intervalCredit ival = (Sum . ilen &&& Sum . depf Nothing payoutDate) $ fmap (view eventTime) ivallet intervalCredit ival = (Sum . ilen &&& Sum . depf payoutDate) $ fmap (view eventTime) ival - edit in lib/Aftok/Types.hs at line 65[32.33998]
data DepreciationRules = DepreciationRules{ _depf :: DepreciationFunction, _firstRevenue :: Maybe C.UTCTime}makeLenses ''DepreciationRules - file addition: 2021-01-31_23-40-41_project_first_revenue.txt[33.1]
Description: (Describe migration here.)Created: 2021-01-31 23:40:52.022174268 UTCDepends: 2016-10-13_05-36-55_user-event-logApply: |alter table projects add column first_revenue_date timestamp with time zone; - replacement in server/Aftok/Snaplet/Projects.hs at line 88
snapEval . createProject $ Project (cpn cp) t uid (cpdepf cp)snapEval . createProject $ Project (cpn cp) t uid (DepreciationRules (cpdepf cp) Nothing) - replacement in server/Aftok/Snaplet/Projects.hs at line 113
let p = payouts (toDepF $ project ^. depf) ptime widxlet p = payouts (toDepF $ project ^. depRules) ptime widx - replacement in server/Aftok/Snaplet/Projects.hs at line 149
pure $ payouts (toDepF $ project ^. depf) ptime widxpure $ payouts (toDepF $ project ^. depRules) ptime widx - replacement in server/Aftok/Snaplet/Projects.hs at line 224
"depf" .= depfToJSON (p ^. depf)"depf" .= depfToJSON (p ^. depRules . depf)