Create amends endpoint, switch to UUID primary keys
[?]
May 25, 2015, 2:37 AM
GCVQD44VRPQVKPZEPIC4AOIXLJIG2ZMV3QI2Y7KALUT6NVUBSGSACDependencies
- [2]
RPAJLHMTChange to use UUIDs instead of ints for primary keys. - [3]
LD4GLVSFMore database stuff. - [4]
LAROLAYUWIP - [5]
64C6AWH6Rename Ananke -> Quixotic, project reboot. - [6]
TNR3TEHKSwitch to Postgres + snaplet arch compiles. - [7]
VJPT6HDRFix remaining type errors after addition of login handler. - [8]
KNSI575VCleanup of EventLog types. - [9]
WZUHEZSBStart of migration back toward snap. - [10]
WO2MINIFAuctions now compile! - [11]
HE3JTXO3Added client call to payouts. - [12]
Z3M53KTLAdrift. - [13]
NTPC7KJETrivial changes, feature scratchpad. - [14]
EQXRXRZDChanged to use tasty instead of test-framework - [15]
Z7KS5XHHVery WIP. Wow. - [16]
2G3GNDDUEvent logging is now functioning in postgres. - [17]
BROSTG5KBeginning of modularization of server. - [18]
5XFJNUAZStart of addition of project infrastructure. - [19]
EMVTF2IWWIP moving back to snap. - [20]
SLL7262CMake depreciation functions more flexible. - [21]
EZQG2APBUpdate task list. - [22]
W35DDBFYFactor common JSON conversions up into client lib module. - [23]
Y35QCWYWMinor improvement in WorkIndex type to eliminate duplicated information. - [24]
5DRIWGLUImproving TimeLog specs - [25]
7DBNV3GVInitial, stack-based impl of time log event reduction. - [26]
TCOAKCGGCompleted conversion to snap. - [27]
RSEB2NFGReplacing Snap with Scotty. - [28]
TZQJVHBAAdd auction functions to ADB. - [29]
NJZ3DKZYTHEY CAN TALK! - [30]
7KZP4RHZSwitch from Data.Time to Data.Thyme - [31]
2OIPAQCBMerge branch 'master' of github.com:nuttycom/ananke - [32]
GKGVYBZGAdded JSON serialization to TimeLog - [33]
2Y2QZFVFSwitch to more modern cabal2nix-based workflow. - [34]
XTBSG4C7Adding serveJSON combinator to eliminate some boilerplate from handlers. - [35]
IZEVQF62Work in progress replacing sqlite with postgres. - [36]
FD7SV5I6Fix handling of event_t columns. - [37]
I2KHGVD4Require project permissions for access to most data. - [38]
7XN3I3QJAdd 'loggedIntervals' endpoint. - [39]
A6HKMINBAttempting to improve JSON handling. - [40]
2KZPOGRBOnce you get Haskell to compile, the tests pass! - [41]
PBD7LZYQPostgres & auth are beginning to function. - [42]
4IQVQL4TAdded client for payouts endpoint. - [43]
OV5AKJHARemove unused LogInterval type. - [44]
O5FVTOM6Undo JSON silliness, enable a couple more routes. - [45]
TLQ72DSJLenses, sqlite-simple - [46]
OBFPJS2GProject successfully builds and tests under nix. - [47]
WFZDMVUXRename ADB -> QDB - [48]
NVOCQVASInitial failing tests. - [*]
75N3UJ4JMore progression toward lenses. - [*]
ADMKQQGCInitial empty Snap project.
Change contents
- edit in lib/Quixotic/Auction.hs at line 22
newtype BidId = BidId UUID deriving (Show, Eq)makePrisms ''BidId - replacement in lib/Quixotic/Database/PostgreSQL.hs at line 8
import Data.ByteString.Char8 as Bimport qualified Data.ByteString.Char8 as B - edit in lib/Quixotic/Database/PostgreSQL.hs at line 10
import Data.List as L - replacement in lib/Quixotic/Database/PostgreSQL.hs at line 14
import qualified Data.List as DLimport Data.UUID(UUID) - edit in lib/Quixotic/Database/PostgreSQL.hs at line 48
eidParser :: FieldParser EventIdeidParser f v = EventId <$> fromField f v - edit in lib/Quixotic/Database/PostgreSQL.hs at line 72[3.1606]→[3.1606:1607](∅→∅),[3.1607]→[3.766:872](∅→∅),[3.229]→[3.1715:1753](∅→∅),[3.303]→[3.1715:1753](∅→∅),[3.872]→[3.1715:1753](∅→∅),[3.3511]→[3.1715:1753](∅→∅),[3.1715]→[3.1715:1753](∅→∅),[3.1753]→[3.873:958](∅→∅),[3.958]→[3.1829:2289](∅→∅),[3.1829]→[3.1829:2289](∅→∅),[3.2289]→[3.52:90](∅→∅),[3.90]→[3.85:472](∅→∅),[3.472]→[3.159:160](∅→∅),[3.159]→[3.159:160](∅→∅),[3.160]→[3.2289:2338](∅→∅),[3.2289]→[3.2289:2338](∅→∅)
workEventParser :: RowParser LogEventworkEventParser = fieldWith eventTypeParser <*> fieldWith utcParserlogEntryParser :: RowParser LogEntrylogEntryParser = LogEntry <$> fieldWith btcAddrParser <*> workEventParser <*> fieldauctionRowParser :: RowParser AuctionauctionRowParser = Auction <$> fieldWith btcParser <*> fieldbidRowParser :: RowParser BidbidRowParser = Bid <$> fieldWith uidParser<*> fieldWith secondsParser<*> fieldWith btcParser<*> fielduserRowParser :: RowParser UseruserRowParser = User <$> fieldWith usernameParser<*> fieldWith btcAddrParser<*> fieldqdbUserRowParser :: RowParser QDBUserqdbUserRowParser = QDBUser <$> fieldWith uidParser<*> userRowParserprojectRowParser :: RowParser ProjectprojectRowParser = Project <$> field<*> field<*> fieldWith uidParserqdbProjectRowParser :: RowParser QDBProjectqdbProjectRowParser = QDBProject <$> fieldWith pidParser <*> projectRowParser-- Local newtypes to permit field serialization - replacement in lib/Quixotic/Database/PostgreSQL.hs at line 84
-- Local newtypes to permit row deserialization via-- typeclass. Wish I could just pass the RowParser instanceslogEntryParser :: RowParser LogEntrylogEntryParser =LogEntry <$> fieldWith btcAddrParser<*> (fieldWith eventTypeParser <*> fieldWith utcParser)<*> field - replacement in lib/Quixotic/Database/PostgreSQL.hs at line 90
newtype PLogEntry = PLogEntry { pLogEntry :: LogEntry }instance FromRow PLogEntry wherefromRow = PLogEntry <$> logEntryParserqdbLogEntryParser :: RowParser QDBLogEntryqdbLogEntryParser =(,,,) <$> fieldWith eidParser<*> fieldWith pidParser<*> fieldWith uidParser<*> logEntryParserauctionParser :: RowParser AuctionauctionParser =Auction <$> fieldWith btcParser<*> field - replacement in lib/Quixotic/Database/PostgreSQL.hs at line 102
newtype PBid = PBid { pBid :: Bid }instance FromRow PBid wherefromRow = PBid <$> bidRowParserbidParser :: RowParser BidbidParser =Bid <$> fieldWith uidParser<*> fieldWith secondsParser<*> fieldWith btcParser<*> field - replacement in lib/Quixotic/Database/PostgreSQL.hs at line 109
newtype PUser = PUser { pUser :: User }instance FromRow PUser wherefromRow = PUser <$> userRowParseruserParser :: RowParser UseruserParser =User <$> fieldWith usernameParser<*> fieldWith btcAddrParser<*> field - replacement in lib/Quixotic/Database/PostgreSQL.hs at line 115
newtype PAuction = PAuction { pAuction :: Auction }instance FromRow PAuction wherefromRow = PAuction <$> auctionRowParserqdbUserParser :: RowParser QDBUserqdbUserParser =(,) <$> fieldWith uidParser<*> userParser - replacement in lib/Quixotic/Database/PostgreSQL.hs at line 120
newtype PQDBUser = PQDBUser { pQDBUser :: QDBUser }instance FromRow PQDBUser wherefromRow = PQDBUser <$> qdbUserRowParserprojectParser :: RowParser ProjectprojectParser =Project <$> field<*> field<*> fieldWith uidParser - replacement in lib/Quixotic/Database/PostgreSQL.hs at line 126
newtype PProject = PProject { pProject :: Project }instance FromRow PProject wherefromRow = PProject <$> projectRowParserqdbProjectParser :: RowParser QDBProjectqdbProjectParser =(,) <$> fieldWith pidParser<*> projectParser - replacement in lib/Quixotic/Database/PostgreSQL.hs at line 131
newtype PQDBProject = PQDBProject { pQDBProject :: QDBProject }instance FromRow PQDBProject wherefromRow = PQDBProject <$> qdbProjectRowParserpexec :: (ToRow d) => Query -> d -> QDBM Int64pexec q d = doconn <- asklift $ execute conn q d - replacement in lib/Quixotic/Database/PostgreSQL.hs at line 136
pquery :: (ToRow d, FromRow r) => Query -> d -> QDBM [r]pquery q d = dopinsert :: (ToRow d) => (UUID -> r) -> Query -> d -> QDBM rpinsert f q d = do - replacement in lib/Quixotic/Database/PostgreSQL.hs at line 139
lift $ query conn q dids <- lift $ query conn q dpure . f . fromOnly $ L.head ids - replacement in lib/Quixotic/Database/PostgreSQL.hs at line 142
pexec :: (ToRow d) => Query -> d -> QDBM Int64pexec q d = dopquery :: (ToRow d) => RowParser r -> Query -> d -> QDBM [r]pquery p q d = do - replacement in lib/Quixotic/Database/PostgreSQL.hs at line 145
lift $ execute conn q dlift $ queryWith p conn q d - replacement in lib/Quixotic/Database/PostgreSQL.hs at line 148[3.359]→[3.359:424](∅→∅),[3.424]→[3.1489:1510](∅→∅),[3.1024]→[3.1489:1510](∅→∅),[3.1489]→[3.1489:1510](∅→∅)
createEvent' (ProjectId pid) (UserId uid) (LogEntry a e m) = doeventIds <- pquerycreateEvent' (ProjectId pid) (UserId uid) (LogEntry a e m) =pinsert EventId - replacement in lib/Quixotic/Database/PostgreSQL.hs at line 159
pure . EventId . fromOnly $ DL.head eventIdsfindEvent' :: EventId -> QDBM (Maybe QDBLogEntry)findEvent' (EventId eid) = dologEntries <- pquery qdbLogEntryParser"SELECT id, project_id, user_id, btc_addr, event_type, event_time, event_metadata FROM work_events \\WHERE id = ?"(Only eid)pure $ headMay logEntries - replacement in lib/Quixotic/Database/PostgreSQL.hs at line 170
let q (Before e) = pquerylet q p (Before e) = pquery p - replacement in lib/Quixotic/Database/PostgreSQL.hs at line 174
q (During s e) = pqueryq p (During s e) = pquery p - replacement in lib/Quixotic/Database/PostgreSQL.hs at line 179
q (After s) = pqueryq p (After s) = pquery p - replacement in lib/Quixotic/Database/PostgreSQL.hs at line 183
in fmap pLogEntry <$> q ivalin q logEntryParser ival - replacement in lib/Quixotic/Database/PostgreSQL.hs at line 185
amendEvent' :: EventId -> LogModification -> QDBM ()amendEvent' :: EventId -> EventAmendment -> QDBM AmendmentId - replacement in lib/Quixotic/Database/PostgreSQL.hs at line 187
void $ pexec"INSERT INTO event_time_amendments (event_id, mod_time, event_time) VALUES (?, ?, ?)"pinsert AmendmentId"INSERT INTO event_time_amendments (event_id, mod_time, event_time) VALUES (?, ?, ?) RETURNING id" - replacement in lib/Quixotic/Database/PostgreSQL.hs at line 192
void $ pexec"INSERT INTO event_addr_amendments (event_id, mod_time, btc_addr) VALUES (?, ?, ?)"pinsert AmendmentId"INSERT INTO event_addr_amendments (event_id, mod_time, btc_addr) VALUES (?, ?, ?) RETURNING id" - replacement in lib/Quixotic/Database/PostgreSQL.hs at line 197
void $ pexec"INSERT INTO event_metadata_amendments (event_id, mod_time, btc_addr) VALUES (?, ?, ?)"( eid, fromThyme $ mt ^. _ModTime, v )pinsert AmendmentId"INSERT INTO event_metadata_amendments (event_id, mod_time, btc_addr) VALUES (?, ?, ?) RETURNING id"( eid, fromThyme $ mt ^. _ModTime, v) - replacement in lib/Quixotic/Database/PostgreSQL.hs at line 203
rows <- pquerylogEntries <- pquery logEntryParser - replacement in lib/Quixotic/Database/PostgreSQL.hs at line 206
pure . workIndex $ fmap pLogEntry rowspure $ workIndex logEntries - replacement in lib/Quixotic/Database/PostgreSQL.hs at line 209[3.482]→[3.482:510](∅→∅),[3.510]→[3.2467:2486](∅→∅),[3.859]→[3.2467:2486](∅→∅),[3.2486]→[3.860:954](∅→∅),[3.3748]→[3.860:954](∅→∅)
createAuction' pid auc = doaucIds <- pquery"INSERT INTO auctions (project_id, raise_amount, end_time) VALUES (?, ?, ?) RETURNING id"createAuction' pid auc =pinsert AuctionId"INSERT INTO auctions (project_id, raise_amount, end_time) \\VALUES (?, ?, ?) RETURNING id" - edit in lib/Quixotic/Database/PostgreSQL.hs at line 214
pure . AuctionId . fromOnly $ DL.head aucIds - replacement in lib/Quixotic/Database/PostgreSQL.hs at line 217[3.585]→[3.2538:2555](∅→∅),[3.4020]→[3.2538:2555](∅→∅),[3.2555]→[3.4062:4129](∅→∅),[3.4062]→[3.4062:4129](∅→∅)
rows <- pquery"SELECT raise_amount, end_time FROM auctions WHERE ROWID = ?"auctions <- pquery auctionParser"SELECT raise_amount, end_time FROM auctions WHERE id = ?" - replacement in lib/Quixotic/Database/PostgreSQL.hs at line 220
pure . fmap pAuction $ headMay rowspure $ headMay auctions - replacement in lib/Quixotic/Database/PostgreSQL.hs at line 222
createBid' :: AuctionId -> Bid -> QDBM ()createBid' :: AuctionId -> Bid -> QDBM BidId - replacement in lib/Quixotic/Database/PostgreSQL.hs at line 224[3.666]→[3.2599:2614](∅→∅),[3.4298]→[3.2599:2614](∅→∅),[3.2614]→[3.54:159](∅→∅),[3.4341]→[3.54:159](∅→∅)
void $ pexec"INSERT INTO bids (auction_id, bidder_id, bid_seconds, bid_amount, bid_time) values (?, ?, ?, ?, ?)"pinsert BidId"INSERT INTO bids (auction_id, bidder_id, bid_seconds, bid_amount, bid_time) \\VALUES (?, ?, ?, ?, ?) RETURNING id" - replacement in lib/Quixotic/Database/PostgreSQL.hs at line 235
readBids' aucId = dorows <- pqueryreadBids' aucId =pquery bidParser - edit in lib/Quixotic/Database/PostgreSQL.hs at line 239
pure $ fmap pBid rows - replacement in lib/Quixotic/Database/PostgreSQL.hs at line 241
createUser' user' = douids <- pquerycreateUser' user' =pinsert UserId - edit in lib/Quixotic/Database/PostgreSQL.hs at line 245
pure . UserId . fromOnly $ DL.head uids - replacement in lib/Quixotic/Database/PostgreSQL.hs at line 248
users <- pqueryusers <- pquery userParser - replacement in lib/Quixotic/Database/PostgreSQL.hs at line 251
pure . fmap pUser $ headMay userspure $ headMay users - replacement in lib/Quixotic/Database/PostgreSQL.hs at line 255
users <- pqueryusers <- pquery qdbUserParser - replacement in lib/Quixotic/Database/PostgreSQL.hs at line 258
pure . fmap pQDBUser $ headMay userspure $ headMay users - replacement in lib/Quixotic/Database/PostgreSQL.hs at line 263
pids <- pquerypid <- pinsert ProjectId - replacement in lib/Quixotic/Database/PostgreSQL.hs at line 266[3.90]→[3.90:126](∅→∅),[3.126]→[3.2925:2940](∅→∅),[3.2940]→[3.155:273](∅→∅),[3.155]→[3.155:273](∅→∅)
let pid = fromOnly $ DL.head pidsvoid $ pexec"INSERT INTO project_companions (project_id, companion_id) VALUES (?, ?)"(pid, uid)pure . ProjectId $ pidvoid $ pexec"INSERT INTO project_companions (project_id, user_id) VALUES (?, ?)"(pid ^. _ProjectId, uid)pure pid - replacement in lib/Quixotic/Database/PostgreSQL.hs at line 273
projects <- pqueryprojects <- pquery projectParser - replacement in lib/Quixotic/Database/PostgreSQL.hs at line 276
pure . fmap pProject $ headMay projectspure $ headMay projects - replacement in lib/Quixotic/Database/PostgreSQL.hs at line 279
findUserProjects' (UserId uid) = doresults <- pqueryfindUserProjects' (UserId uid) =pquery qdbProjectParser - replacement in lib/Quixotic/Database/PostgreSQL.hs at line 283
\WHERE pc.companion_id = ?"\WHERE pc.user_id = ?" - edit in lib/Quixotic/Database/PostgreSQL.hs at line 285
pure $ fmap pQDBProject results - edit in lib/Quixotic/Database/PostgreSQL.hs at line 286
- edit in lib/Quixotic/Database/PostgreSQL.hs at line 291
, findEvent = findEvent' - edit in lib/Quixotic/Database.hs at line 6
import Control.Lens - replacement in lib/Quixotic/Database.hs at line 12
data QDBUser = QDBUser{ _userId :: UserId, _user :: User}makeLenses ''QDBUsertype QDBUser = (UserId, User)type QDBLogEntry = (EventId, ProjectId, UserId, LogEntry)type QDBProject = (ProjectId, Project) - edit in lib/Quixotic/Database.hs at line 16
data QDBProject = QDBProject{ _projectId :: ProjectId, _project :: Project}makeLenses ''QDBProject - replacement in lib/Quixotic/Database.hs at line 18
, amendEvent :: EventId -> LogModification -> m (), amendEvent :: EventId -> EventAmendment -> m AmendmentId, findEvent :: EventId -> m (Maybe QDBLogEntry) - replacement in lib/Quixotic/Database.hs at line 25
, createBid :: AuctionId -> Bid -> m (), createBid :: AuctionId -> Bid -> m BidId - edit in lib/Quixotic/Json.hs at line 27
, trivialVersion :: Word8 - replacement in lib/Quixotic/Json.hs at line 29
printVersion :: Version -> TextprintVersion Version{..} = intercalate "." (fmap tshow [majorVersion, minorVersion, trivialVersion])instance Show Version whereshow Version{..} = intercalate "." $ fmap show [majorVersion, minorVersion] - replacement in lib/Quixotic/Json.hs at line 33
versionParser = Version <$> P.decimal <*> (P.char '.' >> P.decimal) <*> (P.char '.' >> P.decimal)versionParser = Version <$> P.decimal <*> (P.char '.' >> P.decimal) - edit in lib/Quixotic/Json.hs at line 35
versioned :: Version -> Value -> Valueversioned ver v = object [ "schemaVersion" .= printVersion ver, "value" .= v ] - replacement in lib/Quixotic/Json.hs at line 42
-- TODO: Include source location information, and implement quote patterns. - edit in lib/Quixotic/Json.hs at line 47
versioned :: Version -> Value -> Valueversioned ver v = object [ "schemaVersion" .= tshow ver, "value" .= v ] - edit in lib/Quixotic/Json.hs at line 52
{-|- Convenience function to allow dispatch of different serialized- versions to different parsers.-} - replacement in lib/Quixotic/Json.hs at line 58
vers <- v .: "schemaVersion"vers' <- either (\_ -> mzero) pure $ P.parseOnly versionParser (encodeUtf8 vers)value <- v .: "value"f vers' valueunversion _ _ = mzeroverstr <- v .: "schemaVersion"vers <- either fail pure $ P.parseOnly versionParser (encodeUtf8 verstr)v .: "value" >>= f versunversion _ x =fail $ show x <> " did not contain the expected version information."---------------- Versions ----------------v1 :: Value -> Valuev1 = versioned $ Version 1 0unv1 :: String -> (Value -> Parser a) -> Value -> Parser aunv1 name f v =let p (Version 1 0) = fp ver = const . fail $ "Unrecognized " <> name <> " schema version: " <> show verin unversion p v------------------- Serializers ------------------- - replacement in lib/Quixotic/Json.hs at line 83[3.1552]→[3.1552:1573](∅→∅),[3.1573]→[2.1663:1728](∅→∅),[2.1728]→[3.1630:1682](∅→∅),[3.1630]→[3.1630:1682](∅→∅)
qdbProjectJSON qp =object [ "projectId" .= (tshow $ qp ^. (projectId._ProjectId)), "project" .= projectJSON (qp ^. project)qdbProjectJSON (projectId, project) = v1 $object [ "projectId" .= (tshow $ projectId ^. _ProjectId), "project" .= projectJSON project - replacement in lib/Quixotic/Json.hs at line 89
projectJSON p =projectJSON p = v1 $ - replacement in lib/Quixotic/Json.hs at line 95
payoutsJSON (Payouts m) = toJSON $ MS.mapKeys (^. _BtcAddr) mparsePayoutsJSON :: Value -> Parser PayoutsparsePayoutsJSON v =Payouts . MS.mapKeys BtcAddr <$> parseJSON vpayoutsJSON (Payouts m) = v1 $toJSON $ MS.mapKeys (^. _BtcAddr) m - replacement in lib/Quixotic/Json.hs at line 99
workIndexJSON (WorkIndex widx) =workIndexJSON (WorkIndex widx) = v1 $ - replacement in lib/Quixotic/Json.hs at line 103
eventIdJSON (EventId eid) = toJSON eideventIdJSON (EventId eid) = v1 $object [ "eventId" .= tshow eid ] - replacement in lib/Quixotic/Json.hs at line 107
logEntryJSON (LogEntry a ev m) =logEntryJSON (LogEntry a ev m) = v1 $ - edit in lib/Quixotic/Json.hs at line 113
amendmentIdJSON :: AmendmentId -> ValueamendmentIdJSON (AmendmentId aid) = v1 $object [ "amendmentId" .= tshow aid ]--------------- Parsers --------------- - edit in lib/Quixotic/Json.hs at line 122[3.2134]
parsePayoutsJSON :: Value -> Parser PayoutsparsePayoutsJSON = unv1 "payouts" $ \v ->Payouts . MS.mapKeys BtcAddr <$> parseJSON vparseEventAmendment :: ModTime -> Value -> Parser EventAmendmentparseEventAmendment t =let parseA x "timeChange" = TimeChange t <$> x .: "eventTime"parseA x "addrChage" = doaddrText <- x .: "btcAddr"maybe(fail $ (show addrText) <> "is not a valid BTC address")(pure . AddressChange t)$ parseBtcAddr addrTextparseA x "metadataChange" =MetadataChange t <$> x .: "eventMeta"parseA _ other =fail $ "Amendment value " <> other <> " not recognized."p (Object x) = x .: "amendment" >>= parseA xp x = fail $ "Value " <> show x <> " missing 'amendment' field."in unv1 "amendment" p - replacement in lib/Quixotic/TimeLog.hs at line 13
, LogModification(..), EventAmendment(..), AmendmentId(AmendmentId), _AmendmentId - edit in lib/Quixotic/TimeLog.hs at line 27
import Data.Foldable as F - edit in lib/Quixotic/TimeLog.hs at line 30[3.94]→[3.65:91](∅→∅),[3.119]→[3.65:91](∅→∅),[3.225]→[3.65:91](∅→∅),[3.808]→[3.65:91](∅→∅),[3.3878]→[3.65:91](∅→∅),[3.5660]→[3.65:91](∅→∅),[3.1808]→[3.65:91](∅→∅)
import Data.Foldable as F - edit in lib/Quixotic/TimeLog.hs at line 33
import Data.UUID - replacement in lib/Quixotic/TimeLog.hs at line 71
newtype EventId = EventId Int64 deriving (Show, Eq)newtype EventId = EventId UUID deriving (Show, Eq) - replacement in lib/Quixotic/TimeLog.hs at line 77
data LogModification = TimeChange ModTime C.UTCTime| AddressChange ModTime BtcAddr| MetadataChange ModTime A.Valuedata EventAmendment = TimeChange ModTime C.UTCTime| AddressChange ModTime BtcAddr| MetadataChange ModTime A.Valuenewtype AmendmentId = AmendmentId UUID deriving (Show, Eq)makePrisms ''AmendmentId - replacement in lib/Quixotic.hs at line 50
newtype InvitationId = InvitationId Int64newtype InvitationId = InvitationId UUID deriving (Show, Eq) - edit in payouts/Main.hs at line 12
import System.IO(FilePath) - replacement in payouts/Main.hs at line 37
loadConfig :: FilePath -> IO QPConfigloadConfig :: System.IO.FilePath -> IO QPConfig - edit in quixotic.cabal at line 53
, semigroupoids - replacement in quixotic.cabal at line 58
, uuid >= 1.3.10, uuid >= 1.3 - edit in quixotic.cabal at line 101
, aeson, attoparsec, base64-bytestring - edit in quixotic.cabal at line 106
, aeson - edit in quixotic.cabal at line 107
, configurator - edit in quixotic.cabal at line 110
, mtl >= 2 && < 3 - replacement in quixotic.cabal at line 111[3.52]→[3.52:72](∅→∅),[3.72]→[3.222:233](∅→∅),[3.222]→[3.222:233](∅→∅),[3.233]→[3.2965:2977](∅→∅),[3.2977]→[3.73:92](∅→∅),[3.244]→[3.73:92](∅→∅)
, sqlite-simple, text, thyme, transformers, mtl >= 2 && < 3 - edit in quixotic.cabal at line 113
, configurator - edit in quixotic.cabal at line 115
, resource-pool-catchio - replacement in quixotic.cabal at line 120
, attoparsec, base64-bytestring, resource-pool-catchio, text, thyme, transformers, uuid >= 1.3 - replacement in scripts/log_end.sh at line 1
curl -v -u "nuttycom:kjntest" -X POST -d '' http://localhost:8000/projects/1/logEnd/1KamUn1BaRMd2HwikyQWGTdUvfPScg9QA5[3.532]curl -v -u "nuttycom:kjntest" -X POST -d '' http://localhost:8000/projects/6f4cba6f-02ec-4cc3-9241-00609d6a6f6a/logEnd/1KamUn1BaRMd2HwikyQWGTdUvfPScg9QA5 - replacement in scripts/log_start.sh at line 1
curl -v -u "nuttycom:kjntest" -X POST -d '' http://localhost:8000/projects/1/logStart/1KamUn1BaRMd2HwikyQWGTdUvfPScg9QA5[3.689]curl -v -u "nuttycom:kjntest" -X POST -d '' http://localhost:8000/projects/6f4cba6f-02ec-4cc3-9241-00609d6a6f6a/logStart/1KamUn1BaRMd2HwikyQWGTdUvfPScg9QA5 - edit in server/Main.hs at line 11
import System.IO(FilePath) - replacement in server/Main.hs at line 33
, authSiteKey :: FilePath, authSiteKey :: System.IO.FilePath - replacement in server/Main.hs at line 60
logIntervalsRoute = serveJSON workIndexJSON $ method GET loggedIntervalsHandler--amendEventRoute = void $ method PUT amendEventHandlerlogIntervalsRoute = serveJSON workIndexJSON $ method GET loggedIntervalsHandleramendEventRoute = serveJSON amendmentIdJSON $ method PUT amendEventHandler - replacement in server/Main.hs at line 71
--, ("events/:eventId/amend", amendEventHandler),, ("events/:eventId/amend", amendEventRoute) - replacement in server/Main.hs at line 83
loadQConfig :: FilePath -> IO QConfigloadQConfig :: System.IO.FilePath -> IO QConfig - replacement in server/Quixotic/Snaplet/Auth.hs at line 39
Just u -> pure (u ^. userId)Just u -> pure (u ^. _1) - replacement in server/Quixotic/Snaplet/Auth.hs at line 50
if any (\p -> p ^. projectId == pid) projectsif any (\p -> p ^. _1 == pid) projects - edit in server/Quixotic/Snaplet/WorkLog.hs at line 8
import Data.Aeson.Typesimport Data.UUID as U - edit in server/Quixotic/Snaplet/WorkLog.hs at line 15
import Quixotic.Json - edit in server/Quixotic/Snaplet/WorkLog.hs at line 26
-- TODO: ignore "duplicate" events within some small time limit? - edit in server/Quixotic/Snaplet/WorkLog.hs at line 34
let logEntry addr = LogEntry addr (evCtr timestamp) (A.decode requestBody)storeEv addr = runReaderT . createEvent pid uid $ logEntry addr - replacement in server/Quixotic/Snaplet/WorkLog.hs at line 36
Just addr -> liftPG $ storeEv addrJust addr ->let logEntry a = LogEntry a (evCtr timestamp) (A.decode requestBody)storeEv a = runReaderT . createEvent pid uid $ logEntry ain liftPG $ storeEv addr - replacement in server/Quixotic/Snaplet/WorkLog.hs at line 56
(Nothing, Nothing) -> snapError 400 $ "You must at least one of the \"after\" or \"before\" query parameter"(Nothing, Nothing) -> snapError 400 "You must at least one of the \"after\" or \"before\" query parameter" - replacement in server/Quixotic/Snaplet/WorkLog.hs at line 62
pid <- fmap snd requireProjectAccesswidx <- liftPG . runReaderT $ readWorkIndex pidpid <- fmap snd requireProjectAccesswidx <- liftPG . runReaderT $ readWorkIndex pid - replacement in server/Quixotic/Snaplet/WorkLog.hs at line 67
-- amendEventHandler :: Handler App App AmendmentIdamendEventHandler :: Handler App App AmendmentIdamendEventHandler = doQDB{..} <- view qdb <$> with qm get(uid, _) <- requireProjectAccesseventIdBytes <- getParam "eventId"eventId <- maybe(snapError 400 "eventId parameter is required")(pure . EventId)(eventIdBytes >>= U.fromASCIIBytes) - edit in server/Quixotic/Snaplet/WorkLog.hs at line 77[2.5480]
ev <- liftPG . runReaderT $ findEvent eventId(_, _, uid', _) <- maybe (snapError 404 ("Event not found for id " <> tshow eventId)) pure evmodTime <- ModTime <$> liftIO C.getCurrentTimerequestJSON <- readRequestJSON 4096if uid' == uidthen either(snapError 400 . pack)(liftPG . runReaderT . amendEvent eventId)(parseEither (parseEventAmendment modTime) requestJSON)else(snapError 403 "You do not have permission to view this event.") - edit in server/Quixotic/Snaplet.hs at line 10
import qualified Data.Aeson as A - edit in server/Quixotic/Snaplet.hs at line 56
readRequestJSON :: MonadSnap m => Int64 -> m A.ValuereadRequestJSON i = dorequestBody <- A.decode <$> readRequestBody imaybe (snapError 400 "Could not interpret request body as a nonempty JSON value.") pure requestBody - edit in sql/quixotic-pg.sql at line 1
create extension "uuid-ossp"; - replacement in sql/quixotic-pg.sql at line 4
id serial primary key,id uuid primary key default uuid_generate_v4(), - replacement in sql/quixotic-pg.sql at line 11
id serial primary key,id uuid primary key default uuid_generate_v4(), - replacement in sql/quixotic-pg.sql at line 14
initiator_id integer references users (id) not nullinitiator_id uuid references users (id) not null - replacement in sql/quixotic-pg.sql at line 18
project_id integer references projects(id) not null,companion_id integer references users(id) not nullproject_id uuid references projects(id) not null,companion_id uuid references users(id) not null - replacement in sql/quixotic-pg.sql at line 25
id serial primary key,project_id integer references projects(id) not null,user_id integer references users(id) not null,id uuid primary key default uuid_generate_v4(),project_id uuid references projects(id) not null,user_id uuid references users(id) not null, - replacement in sql/quixotic-pg.sql at line 35
id serial primary key,project_id integer references projects(id) not null,initiator_id integer references users (id) not null,id uuid primary key default uuid_generate_v4(),project_id uuid references projects(id) not null,initiator_id uuid references users (id) not null, - replacement in sql/quixotic-pg.sql at line 43
id serial primary key,auction_id integer references projects (id) not null,bidder_id integer references users (id) not null,id uuid primary key default uuid_generate_v4(),auction_id uuid references projects (id) not null,bidder_id uuid references users (id) not null,