We are no longer offering accounts on this server. Consider https://gitlab.freedesktop.org/ as a place to host projects.

Internal.hs 863 Bytes
Newer Older
Mitchell Rosen's avatar
Mitchell Rosen committed
1 2 3
module Model.SnowdriftEvent.Internal
    ( SnowdriftEvent(..)
    ) where
Mitchell Rosen's avatar
Mitchell Rosen committed
4 5 6

import Model

7 8 9
import Data.Int (Int64)
import Data.Time (UTCTime)

Mitchell Rosen's avatar
Mitchell Rosen committed
10 11
-- A sum type of all events, each of which have their own database table.
data SnowdriftEvent
12 13 14 15
    -- Comment approved.
    = ECommentPosted  CommentId Comment
    -- Comment unapproved (pending approval).
    | ECommentPending CommentId Comment
16
    | ENotificationSent NotificationId Notification
17 18 19 20 21
    -- New WikiEdit made.
    | EWikiEdit WikiEditId WikiEdit
    -- New WikiPage posted.
    | EWikiPage WikiPageId WikiPage
    -- New pledge.
22
    | ENewPledge SharesPledgedId SharesPledged
23 24
    -- Pledge that has changed in value.
    | EUpdatedPledge Int64 {- old shares -}
25
                     SharesPledgedId SharesPledged {- new pledge info -}
26 27
    -- Deleted pledge.
    | EDeletedPledge UTCTime UserId ProjectId Int64