,
makePrisms,
)
newtype UserId = UserId UUID
makePrisms ''UserId
newtype UserName = UserName Text
makePrisms ''UserName
newtype Email = Email Text
makePrisms ''Email
data RecoverBy z
= RecoverByEmail Email
| RecoverByZAddr z
makePrisms ''RecoverBy
data User
= User
{ _username :: !UserName,
ProjectId = ProjectId UUID
makePrisms ''ProjectId
-- Identifier for a cryptocurrency account. An account
-- is a mapping from cryptocurrency network to address;
-- this abstraction permits users to accept payment
-- in multiple currencies, or to direct payments in a
-- fashion that can change over time.
newtype AccountId = AccountId UUID
makePrisms ''AccountId
data CreditTo
= -- payouts are made directly via a cryptocurrency network
CreditToAccount !AccountId
| -- payouts are distributed as requested by the specified contributor
CreditToUser !UserId
| -- payouts are distributed to this project's contributors
CreditToProject !ProjectId
makePrisms ''CreditTo
data DepreciationFunction = LinearDepreciation C.Days C.Days
data DepreciationRules
= DepreciationRules
{ _depf :: DepreciationFunction,
( makeLenses