aboutsummaryrefslogtreecommitdiff
path: root/common/src/Common/Model/Category.hs
blob: 53a6bdb6532522759f8d24ee55125341fa022a57 (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