aboutsummaryrefslogtreecommitdiff
path: root/common/src/Common/Model/Category.hs
blob: bbd3c33bf9a883664d4b960bc8ccc77a2e1342c7 (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
25
26
{-# LANGUAGE DeriveGeneric #-}

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 (Show, Generic)

instance FromJSON Category
instance ToJSON Category