5XFJNUAZUCQ3WCGW4QRIAWR764QYDOPHOIVO2TRMGSSG7UDX2M2AC
BROSTG5KP3NUNLSYPVQID254TE47E5RKQAKLPIY7PGWETE6JNMTAC
5W5M56VJFJEBXMGBVKGCKPHOEMVTKUOQMLPJP7VNDQLTYNJXXLHQC
LAROLAYUGJ4Q5AEFV5EJMIA2ZKBNCBWHHHPCJ3CKCNIUIYUKRFVQC
75N3UJ4JK56KXF56GASGPAWLFYGJDETVJNYTF4KXFCQM767JUU5AC
IZEVQF627FA7VV25KJAWYWGGC35LZUUBBQRPN5ZAINTQLPEDRTEAC
64C6AWH66FDKU6UE6Z6JPX2J2GBM2JOPTH2GL6LHKAIUBGNGDZ5AC
TZQJVHBAMDNWDBYCDE3SDVGBG2T5FOE3J5JAD6NENRW36XBHUUFQC
TNR3TEHKVADAEZSTOD2XLSUTSW5AWST2YUW4CWK5KE7DSC6XHZNAC
TCOAKCGGHOIRJCTZYEZQ3K6KCGL2LGAYGYFRGSPCHBTJJY2V6AXAC
{ recordEvent :: UserId -> LogEntry -> m ()
, readWorkIndex :: m WorkIndex
, newAuction :: Auction -> m AuctionId
, readAuction :: AuctionId -> m (Maybe Auction)
, recordBid :: AuctionId -> Bid -> m ()
, readBids :: AuctionId -> m [Bid]
, createUser :: User -> m UserId
, findUser :: UserId -> m (Maybe User)
{ recordEvent :: ProjectId -> UserId -> LogEntry -> m ()
, readWorkIndex :: ProjectId -> m WorkIndex
, newAuction :: ProjectId -> Auction -> m AuctionId
, readAuction :: ProjectId -> AuctionId -> m (Maybe Auction)
, recordBid :: ProjectId -> AuctionId -> Bid -> m ()
, readBids :: ProjectId -> AuctionId -> m [Bid]
, createUser :: User -> m UserId
, findUser :: UserId -> m (Maybe User)
{-# LANGUAGE TemplateHaskell #-}
module Quixotic.Projects where
import ClassyPrelude
import Control.Lens
import Network.Bitcoin
import Quixotic
import Quixotic.Users
newtype ProjectId = ProjectId Int64 deriving (Show, Eq)
makePrisms ''ProjectId
data Project = Project
{ _projectName :: Text
, _inceptionDate :: UTCTime
, _initiator :: UserId
}
makeLenses ''Project
data Invitation = Invitation
{ _projectId :: ProjectId
, _currentMember :: UserId
, _sentAt :: UTCTime
, _toAddr :: BtcAddr
, _amount :: BTC
}
makeLenses ''Invitation
data Acceptance = Acceptance
{ _acceptedInvitation :: Int64
, _blockHeight :: Integer
, _observedAt :: UTCTime
}
makeLenses ''Acceptance
data Cancellation = Cancellation
{ _cancelledInvitation :: Int64
, _requestedAt :: UTCTime
}
makeLenses ''Cancellation