Adds storage of original event JSON for some DBOp constructors.
[?]
Jan 21, 2017, 9:11 PM
O227CEAV7BTKSE3SSC7XHC5IWEBXZL2AOOKJMBMOOFNTLINBLQMACDependencies
- [2]
QADKFHARAdds CreatePayment handler implementation. - [3]
NEDDHXUKReformat via stylish-haskell - [4]
7VGYLTMUClean up schema version handling. - [5]
73NDXDEZBegin implementation of billing event persistence. - [6]
A6HKMINBAttempting to improve JSON handling. - [7]
GCVQD44VCreate amends endpoint, switch to UUID primary keys - [8]
Y3LIJ5USAdd handler for CreatePaymentRequest - [9]
IZEVQF62Work in progress replacing sqlite with postgres. - [10]
7HPY3QPFFix linting errors. (yay hlint!) - [11]
POX3UAMTEnabling logging of time to contributor/project accounts - [12]
O722AOKEAdd route to allow crediting of events to users/projects. - [13]
RPAJLHMTChange to use UUIDs instead of ints for primary keys. - [14]
QMRKFEPGRefactor QDB to use a free monad algebra instead. - [15]
HALRDT2FAdded initial auction create route. - [16]
DFOBMSAOInitial work on payments API - [17]
NAS4BFL4Trivial stylish-haskell reformat. - [18]
3QVT6MA6Add database support for event amend operations. - [19]
O5FVTOM6Undo JSON silliness, enable a couple more routes. - [*]
64C6AWH6Rename Ananke -> Quixotic, project reboot. - [*]
W35DDBFYFactor common JSON conversions up into client lib module. - [*]
Z3MK2PJ5Add GET handler for retrieving auction data. - [*]
NLZ3JXLOFix formatting with stylish-haskell.
Change contents
- replacement in lib/Aftok/Database/PostgreSQL.hs at line 9
import Data.Aeson (toJSON)import Data.Aeson (toJSON, Value) - edit in lib/Aftok/Database/PostgreSQL.hs at line 30
import Aftok.Json (billableJSON, subscriptionJSON) - replacement in lib/Aftok/Database/PostgreSQL.hs at line 206
storeEvent (CreateBillable _) = error "Not implemented"storeEvent (CreateSubscription _ _) = error "Not implemented"storeEvent (CreatePaymentRequest _) = error "Not implemented"storeEvent (CreatePayment _) = error "Not implemented"storeEvent (CreateBillable uid b) =Just $ storeEventJSON uid "create_billable" (billableJSON b)storeEvent (CreateSubscription uid bid) =Just $ storeEventJSON uid "create_subscription" (subscriptionJSON uid bid)storeEvent (CreatePaymentRequest _ _) = error "Not implemented"storeEvent (CreatePayment _ _) = error "Not implemented" - edit in lib/Aftok/Database/PostgreSQL.hs at line 215
type EventType = TextstoreEventJSON :: UserId -> EventType -> Value -> QDBM EventIdstoreEventJSON uid t v = dotimestamp <- liftIO C.getCurrentTimepinsert EventId"INSERT INTO aftok_events \\(event_time, created_by, event_type, event_json) \\VALUES (?, ?, ?, ?) RETURNING id"(fromThyme timestamp, uid ^. _UserId, t, v) - replacement in lib/Aftok/Database/PostgreSQL.hs at line 421
updateCache dbop @ (CreateBillable b) = doupdateCache dbop @ (CreateBillable _ b) = do - replacement in lib/Aftok/Database/PostgreSQL.hs at line 453
updateCache dbop @ (CreatePaymentRequest req) = doupdateCache dbop @ (CreatePaymentRequest _ req) = do - replacement in lib/Aftok/Database/PostgreSQL.hs at line 464
updateCache dbop @ (CreatePayment req) = doupdateCache dbop @ (CreatePayment _ req) = do - replacement in lib/Aftok/Database.hs at line 53
CreateBillable :: Billable -> DBOp BillableIdCreateBillable :: UserId -> Billable -> DBOp BillableId - replacement in lib/Aftok/Database.hs at line 58
CreatePaymentRequest :: PaymentRequest -> DBOp PaymentRequestIdCreatePayment :: Payment -> DBOp PaymentIdCreatePaymentRequest :: UserId -> PaymentRequest -> DBOp PaymentRequestIdCreatePayment :: UserId -> Payment -> DBOp PaymentId - replacement in lib/Aftok/Database.hs at line 177
createBillable :: Billable -> DBProg BillableIdcreateBillable b = withProjectAuth (b ^. B.project) (b ^. B.creator) $ CreateBillable bcreateBillable :: UserId -> Billable -> DBProg BillableIdcreateBillable uid b =withProjectAuth (b ^. B.project) uid $ CreateBillable uid b - edit in lib/Aftok/Json.hs at line 24[23.115][24.1294]
import qualified Aftok.Billables as B - replacement in lib/Aftok/Json.hs at line 155
logEventJSON :: LogEvent -> ValuelogEventJSON ev = object [ eventName ev .= object [ "eventTime" .= (ev ^. eventTime) ] ]logEventJSON' :: LogEvent -> ValuelogEventJSON' ev = object [ eventName ev .= object [ "eventTime" .= (ev ^. eventTime) ] ] - replacement in lib/Aftok/Json.hs at line 161
, "event" .= logEventJSON ev, "event" .= logEventJSON' ev - edit in lib/Aftok/Json.hs at line 168
billableJSON :: B.Billable -> ValuebillableJSON b = v1 $obj [ "projectId" .= tshow (b ^. (B.project . _ProjectId)), "name" .= (b ^. B.name), "description" .= (b ^. B.description), "recurrence" .= recurrenceJSON' (b ^. B.recurrence)]recurrenceJSON' :: B.Recurrence -> ValuerecurrenceJSON' B.Annually = object [ "annually" .= Null ]recurrenceJSON' (B.Monthly i) = object [ "monthly " .= object [ "months" .= i ] ]recurrenceJSON' B.SemiMonthly = object [ "semimonthly" .= Null ]recurrenceJSON' (B.Weekly i) = object [ "weekly " .= object [ "weeks" .= i ] ]recurrenceJSON' B.OneTime = object [ "onetime" .= Null ] - edit in lib/Aftok/Json.hs at line 184
subscriptionJSON :: UserId -> B.BillableId -> ValuesubscriptionJSON uid bid = v1 $obj [ "userId" .= tshow (uid ^. _UserId), "billableId" .= tshow (bid ^. B._BillableId)]