module Model.Submission where

import ClassyPrelude.Yesod
import CryptoID

data SubmissionSinkException = DuplicateFileTitle FilePath
                             | DuplicateRating
                             | RatingWithoutUpdate
                             | ForeignRating CryptoFileNameSubmission
  deriving (Typeable, Show)

instance Exception SubmissionSinkException

data SubmissionMultiSinkException
  = SubmissionSinkException
    { _submissionSinkId :: CryptoFileNameSubmission
    , _submissionSinkFedFile :: Maybe FilePath
    , _submissionSinkException :: SubmissionSinkException
    }
  deriving (Typeable, Show)

instance Exception SubmissionMultiSinkException
