2019-07-27 14:34:28 +00:00
|
|
|
{-# LANGUAGE DeriveGeneric #-}
|
|
|
|
module Types.Amount where
|
|
|
|
|
|
|
|
import GHC.Generics
|
|
|
|
|
|
|
|
import Data.Aeson
|
|
|
|
|
|
|
|
data AmountUpdate = AmountUpdate
|
|
|
|
{ amountUpdateProductId :: Int
|
|
|
|
, amountUpdateRealAmount :: Int
|
|
|
|
}
|
|
|
|
deriving (Show, Generic)
|
|
|
|
|
|
|
|
instance ToJSON AmountUpdate where
|
|
|
|
toEncoding = genericToEncoding defaultOptions
|
|
|
|
|
|
|
|
instance FromJSON AmountUpdate
|
2019-08-05 16:10:21 +00:00
|
|
|
|
|
|
|
|
|
|
|
data AmountRefill = AmountRefill
|
|
|
|
{ amountRefillProductId :: Int
|
|
|
|
, amountRefillAmount :: Int
|
|
|
|
}
|
|
|
|
deriving (Show, Generic)
|
|
|
|
|
|
|
|
instance ToJSON AmountRefill where
|
|
|
|
toEncoding = genericToEncoding defaultOptions
|
|
|
|
|
|
|
|
instance FromJSON AmountRefill
|