2019-12-17 00:56:22 +00:00
|
|
|
{-# LANGUAGE OverloadedStrings #-}
|
|
|
|
{-# LANGUAGE DeriveGeneric #-}
|
2019-12-19 01:43:10 +00:00
|
|
|
{-# LANGUAGE MultiParamTypeClasses #-}
|
2019-12-17 00:56:22 +00:00
|
|
|
module Types.Product where
|
|
|
|
|
|
|
|
import GHC.Generics
|
|
|
|
|
2019-12-19 01:43:10 +00:00
|
|
|
import Servant.API
|
|
|
|
import Servant.HTML.Blaze
|
|
|
|
import Web.Internal.FormUrlEncoded
|
|
|
|
|
2019-12-17 00:56:22 +00:00
|
|
|
import qualified Data.Text as T
|
|
|
|
|
|
|
|
data ProductSubmit = ProductSubmit
|
|
|
|
{ productSubmitIdent :: T.Text
|
2019-12-19 01:43:10 +00:00
|
|
|
, productSubmitPrice :: Float
|
2019-12-17 00:56:22 +00:00
|
|
|
, productSubmitMl :: Int
|
2019-12-19 01:43:10 +00:00
|
|
|
-- TODO: Create and manage suppliers and avatars
|
|
|
|
-- , productSubmitAvatar :: Maybe Int
|
|
|
|
-- , productSubmitSupplier :: Maybe Int
|
2019-12-17 00:56:22 +00:00
|
|
|
, productSubmitMaxAmount :: Int
|
|
|
|
, productSubmitAmountPerCrate :: Int
|
2019-12-19 01:43:10 +00:00
|
|
|
, productSubmitPricePerCrate :: Maybe Float
|
2019-12-17 00:56:22 +00:00
|
|
|
, productSubmitArtNr :: Maybe T.Text
|
|
|
|
} deriving (Generic, Show)
|
2019-12-19 01:43:10 +00:00
|
|
|
|
|
|
|
instance MimeUnrender HTML ProductSubmit
|
|
|
|
instance FromForm ProductSubmit
|