2020-01-09 12:58:07 +03:00
|
|
|
module Fixtures where
|
|
|
|
|
|
|
|
import Wasp
|
2020-01-21 16:03:14 +03:00
|
|
|
import qualified Wasp.EntityForm as EF
|
2020-01-09 12:58:07 +03:00
|
|
|
|
2020-01-14 14:59:56 +03:00
|
|
|
app :: App
|
|
|
|
app = App
|
|
|
|
{ appName = "test_app"
|
|
|
|
, appTitle = "Hello World!"
|
|
|
|
}
|
|
|
|
|
2020-01-09 12:58:07 +03:00
|
|
|
taskEntity :: Entity
|
|
|
|
taskEntity = Entity
|
|
|
|
{ entityName = "Task"
|
|
|
|
, entityFields =
|
|
|
|
[ Wasp.EntityField "description" Wasp.EftString
|
|
|
|
, Wasp.EntityField "isDone" Wasp.EftBoolean
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
2020-01-21 16:03:14 +03:00
|
|
|
taskCreateForm :: EF.EntityForm
|
|
|
|
taskCreateForm = EF.EntityForm
|
|
|
|
{ EF._name = "CreateTaskForm"
|
|
|
|
, EF._entityName = "Task"
|
|
|
|
, EF._submit = Just EF.Submit
|
|
|
|
{ EF._onEnter = Just False
|
|
|
|
, EF._submitButton = Nothing
|
2020-01-09 12:58:07 +03:00
|
|
|
}
|
2020-01-26 19:59:23 +03:00
|
|
|
, EF._fields = []
|
2020-01-09 12:58:07 +03:00
|
|
|
}
|
|
|
|
|
2020-01-14 14:59:56 +03:00
|
|
|
userEntity :: Entity
|
|
|
|
userEntity = Entity
|
|
|
|
{ entityName = "User"
|
|
|
|
, entityFields =
|
|
|
|
[ Wasp.EntityField "name" Wasp.EftString
|
|
|
|
, Wasp.EntityField "surname" Wasp.EftString
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
2020-01-21 16:03:14 +03:00
|
|
|
userCreateForm :: EF.EntityForm
|
|
|
|
userCreateForm = EF.EntityForm
|
|
|
|
{ EF._name = "CreateUserForm"
|
|
|
|
, EF._entityName = "User"
|
|
|
|
, EF._submit = Nothing
|
2020-01-26 19:59:23 +03:00
|
|
|
, EF._fields = []
|
2020-01-14 14:59:56 +03:00
|
|
|
}
|
|
|
|
|
2020-01-09 12:58:07 +03:00
|
|
|
wasp :: Wasp
|
|
|
|
wasp = fromWaspElems
|
2020-01-14 14:59:56 +03:00
|
|
|
[ WaspElementApp app
|
|
|
|
, WaspElementEntity taskEntity
|
2020-01-09 12:58:07 +03:00
|
|
|
, WaspElementEntityForm taskCreateForm
|
|
|
|
]
|