Default work logging credit to logged-in user.

[?]
Jun 15, 2017, 1:34 PM
UOG5H2TW5R3FSHQPJCEMNFDQZS5APZUP7OM54FIBQG7ZP4HASQ7QC

Dependencies

  • [2] G4BS4NND Add simple shell script demonstrating how to invite a companion.
  • [3] NAS4BFL4 Trivial stylish-haskell reformat.
  • [4] RN7EI6IN Update database layer to use CreditTo
  • [5] HMDM3B55 Implement core of payments/billing infrastructure.
  • [6] XZLSHL4D The server is now (tenuously) running, and serving pages via SSL!
  • [7] POX3UAMT Enabling logging of time to contributor/project accounts
  • [8] PBD7LZYQ Postgres & auth are beginning to function.
  • [9] XJ4EYMIH Let curl prompt for http password, rather than bash.
  • [10] UILI6PIL The route-based logStart/logStop is nicer.
  • [11] HYV3VQAD Fix a couple of stupid typos.
  • [12] 7VGYLTMU Clean up schema version handling.
  • [13] CDHZL3RP Add a couple of other CLI utilities for interacing with the service.
  • [14] NEDDHXUK Reformat via stylish-haskell
  • [15] O722AOKE Add route to allow crediting of events to users/projects.
  • [16] GKLIPHR5 Fix error in parsing of event metadata
  • [17] SPJCFHXW Update shell scripts to point to https://aftok.com and prompt for input.
  • [18] BWN72T44 Don't accept work timestamp from an external source.
  • [*] W35DDBFY Factor common JSON conversions up into client lib module.
  • [*] 2G3GNDDU Event logging is now functioning in postgres.
  • [*] BROSTG5K Beginning of modularization of server.

Change contents

  • replacement in lib/Aftok/Json.hs at line 329
    [4.4290][4.3:87](),[4.87][3.1398:1445]()
    parseLogEntry :: (C.UTCTime -> LogEvent) -> Value -> Parser (C.UTCTime -> LogEntry)
    parseLogEntry f = unversion "LogEntry" p where
    [4.3863]
    [4.4722]
    parseLogEntry :: UserId -> (C.UTCTime -> LogEvent) -> Value -> Parser (C.UTCTime -> LogEntry)
    parseLogEntry uid f = unversion "LogEntry" p where
  • replacement in lib/Aftok/Json.hs at line 332
    [4.4747][4.4747:4801]()
    creditTo' <- o .: "creditTo" >>= parseCreditToV2
    [4.4747]
    [4.4801]
    creditTo' <- o .:? "creditTo" >>= maybe (pure $ CreditToUser uid) parseCreditToV2
  • replacement in scripts/create_project.sh at line 7
    [4.104][4.2:131]()
    curl -v -k -u $USER -X POST -H "Content-Type: application/json" -d "{\"projectName\":\"$PROJECT\"}" 'https://aftok.com/projects'
    [4.104]
    [4.1379]
    curl --verbose --insecure --user $USER \
    --request POST --header "Content-Type: application/json" \
    --data "{\"projectName\":\"$PROJECT\"}" \
    'https://aftok.com/projects'
  • replacement in scripts/create_user.sh at line 9
    [4.2009][4.243:422]()
    curl -k -v -H 'Content-Type: application/json' -d "{\"username\":\"$USER\", \"password\":\"$PASS\", \"email\":\"$EMAIL\", \"btcAddr\":\"$BTC_ADDR\"}" 'https://aftok.com/register'
    [4.2009]
    [4.1648]
    curl --verbose --insecure \
    --request POST --header 'Content-Type: application/json' \
    --data "{\"username\":\"$USER\", \"password\":\"$PASS\", \"email\":\"$EMAIL\", \"btcAddr\":\"$BTC_ADDR\"}" \
    'https://aftok.com/register'
  • replacement in scripts/invite.sh at line 5
    [2.46][2.46:77]()
    read -p "Project ID: " PROJECT
    [2.46]
    [2.77]
    read -p "Project UUID: " PROJECT
  • replacement in scripts/invite.sh at line 9
    [2.108][2.108:200]()
    curl -v -k -u $USER -X POST -d '' "https://aftok.com/projects/$PROJECT/invite?email=$EMAIL"
    [2.108]
    curl --verbose --insecure --user $USER \
    --request POST \
    --data '' \
    "https://aftok.com/projects/$PROJECT/invite?email=$EMAIL"
  • replacement in scripts/list_projects.sh at line 5
    [4.71][4.133:186]()
    curl -k -u $USER -X GET "https://aftok.com/projects"
    [4.71]
    curl --verbose --insecure --user $USER \
    --request GET \
    "https://aftok.com/projects"
  • replacement in scripts/log.sh at line 7
    [4.284][4.188:309]()
    curl -v -k -u $USER -X GET "https://aftok.com/projects/$PROJECT/logEntries?after=$(date -Iseconds --date='1 month ago')"
    [4.284]
    curl --verbose --insecure --user $USER \
    --request GET \
    "https://aftok.com/projects/$PROJECT/logEntries?after=$(date -Iseconds --date='1 month ago')"
  • replacement in scripts/log_end.sh at line 5
    [4.497][4.497:528](),[4.528][4.42:66]()
    read -p "Project ID: " PROJECT
    read -p "User ID: " UID
    [4.497]
    [4.561]
    read -p "Project UUID: " PROJECT
  • replacement in scripts/log_end.sh at line 7
    [4.562][4.4877:5024]()
    curl -v -k -u $USER -X POST -d "{\"schemaVersion\": \"2.0\", \"creditTo\": {\"creditToUser\": \"$UID\"}}" "https://aftok.com/projects/$PID/logEnd"
    [4.562]
    curl --verbose --insecure --user $USER \
    --request POST \
    --data '{"schemaVersion": "2.0"}' \
    "https://aftok.com/projects/$PID/logEnd"
  • replacement in scripts/log_start.sh at line 5
    [4.738][4.188:239]()
    read -p "Project ID: " PID
    read -p "User ID: " UID
    [4.738]
    [4.802]
    read -p "Project UUID: " PID
  • replacement in scripts/log_start.sh at line 7
    [4.803][4.5026:5175]()
    curl -v -k -u $USER -X POST -d "{\"schemaVersion\": \"2.0\", \"creditTo\": {\"creditToUser\": \"$UID\"}}" "https://aftok.com/projects/$PID/logStart"
    [4.803]
    curl --verbose --insecure --user $USER \
    --request POST \
    --data '{"schemaVersion": "2.0"}' \
    "https://aftok.com/projects/$PID/logStart"
  • replacement in server/Aftok/Snaplet/WorkLog.hs at line 31
    [4.322][4.322:397]()
    case A.eitherDecode requestBody >>= parseEither (parseLogEntry evCtr) of
    [4.322]
    [4.397]
    case A.eitherDecode requestBody >>= parseEither (parseLogEntry uid evCtr) of