aboutsummaryrefslogtreecommitdiff
path: root/common/src/Common/Model/Category.hs
blob: cc3f795f319ddbf56f6837fcf2298c32403eddfc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
module Common.Model.Category
  ( CategoryId
  , Category(..)
  ) where

import           Data.Aeson   (FromJSON, ToJSON)
import           Data.Int     (Int64)
import           Data.Text    (Text)
import           Data.Time    (UTCTime)
import           GHC.Generics (Generic)

type CategoryId = Int64

data Category = Category
  { _category_id        :: CategoryId
  , _category_name      :: Text
  , _category_color     :: Text
  , _category_createdAt :: UTCTime
  , _category_editedAt  :: Maybe UTCTime
  , _category_deletedAt :: Maybe UTCTime
  } deriving (Eq, Show, Generic)

instance FromJSON Category
instance ToJSON Category