mateamt/src/Types/Beverage.hs

29 lines
735 B
Haskell
Raw Normal View History

2019-04-17 14:14:44 +00:00
{-# LANGUAGE DeriveGeneric #-}
module Types.Beverage where
import GHC.Generics
import Data.Aeson
import qualified Data.Text as T
data Beverage = Beverage
{ beverageIdent :: T.Text
, beveragePrice :: Int
, beverageAmount :: Int
, beverageVanish :: Int
, beverageMl :: Int
, beverageAvatar :: Maybe Word
, beverageSupplier :: Maybe Word
, beverageMaxAmount :: Int
, beverageTotalBought :: Int
, beverageAmonutPerCrate :: Int
, beveragePricePerCrate :: Maybe Int
, beverageArtNr :: Maybe T.Text
} deriving (Generic, Show)
instance ToJSON Beverage where
toEncoding = genericToEncoding defaultOptions
instance FromJSON Beverage