1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
{-# LANGUAGE GeneralizedNewtypeDeriving, NoDeriveAnyClass #-}
-- | Typesafe identifiers for our various objects
module Thermoprint.Identifiers
( PrinterId(..)
, JobId(..)
, DraftId(..)
) where
import Servant.API (ToText, FromText)
import Data.Aeson (FromJSON, ToJSON)
newtype PrinterId = PrinterId Integer
deriving (Show, Eq, Ord, Enum, FromText, ToText, FromJSON, ToJSON)
newtype JobId = JobId Integer
deriving (Show, Eq, Ord, Enum, FromText, ToText, FromJSON, ToJSON)
newtype DraftId = DraftId Integer
deriving (Show, Eq, Ord, Enum, FromText, ToText, FromJSON, ToJSON)
|