diff options
Diffstat (limited to 'Handler/Common')
-rw-r--r-- | Handler/Common/Types.hs | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/Handler/Common/Types.hs b/Handler/Common/Types.hs new file mode 100644 index 0000000..ca7cb8d --- /dev/null +++ b/Handler/Common/Types.hs | |||
@@ -0,0 +1,23 @@ | |||
1 | {-# LANGUAGE FunctionalDependencies #-} | ||
2 | |||
3 | module Handler.Common.Types where | ||
4 | |||
5 | import Import | ||
6 | |||
7 | import Control.Lens | ||
8 | |||
9 | data InventoryState = InventoryState | ||
10 | { stock :: [Entity Item] | ||
11 | , formState :: Maybe FormState | ||
12 | } | ||
13 | |||
14 | data FormState = InsertForm | ||
15 | { fsInsertForm :: Widget | ||
16 | , fsInsertEncoding :: Enctype | ||
17 | } | ||
18 | | UpdateForm | ||
19 | { fsUpdateItem :: ItemId | ||
20 | , fsUpdateForm :: Widget | ||
21 | , fsUpdateEncoding :: Enctype | ||
22 | } | ||
23 | makeLensesWith abbreviatedFields ''FormState | ||