Internal.hs 1.27 KB
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
    -- Comment approved.
13
    = ECommentPosted CommentId Comment
14

15 16
    -- Comment unapproved (pending approval).
    | ECommentPending CommentId Comment
17 18 19 20

    -- Comment closed (ticket or otherwise)
    | ECommentClosed CommentClosingId CommentClosing

David L. L. Thomas's avatar
David L. L. Thomas committed
21 22
    -- Ticket claimed
    | ETicketClaimed TicketClaimingId TicketClaiming
23

David L. L. Thomas's avatar
David L. L. Thomas committed
24 25
    -- Ticket unclaimed
    | ETicketUnclaimed TicketClaimingId TicketClaiming
26

27 28
    -- Comment rethreaded.
    | ECommentRethreaded RethreadId Rethread -- rethreaded-from-URL
29

30
    | ENotificationSent NotificationId Notification
31

32 33
    -- New WikiEdit made.
    | EWikiEdit WikiEditId WikiEdit
34

35 36
    -- New WikiPage posted.
    | EWikiPage WikiPageId WikiPage
37

David L. L. Thomas's avatar
David L. L. Thomas committed
38 39
    -- New blog post posted.
    | EBlogPost BlogPostId BlogPost
40

41
    -- New pledge.
42
    | ENewPledge SharesPledgedId SharesPledged
43

44
    -- Pledge that has changed in value.
45 46
    | EUpdatedPledge Int64                         -- old shares
                     SharesPledgedId SharesPledged -- new pledge info
47

48 49
    -- Deleted pledge.
    | EDeletedPledge UTCTime UserId ProjectId Int64