Allow to change use enum for org/equipment

This commit is contained in:
Eike Kettner
2021-03-10 23:54:04 +01:00
parent 0229a867af
commit 274e433d9d
10 changed files with 252 additions and 7 deletions

View File

@ -0,0 +1,50 @@
module Data.OrgUse exposing
( OrgUse(..)
, all
, asString
, fromString
, label
)
type OrgUse
= Correspondent
| Disabled
fromString : String -> Maybe OrgUse
fromString str =
case String.toLower str of
"correspondent" ->
Just Correspondent
"disabled" ->
Just Disabled
_ ->
Nothing
asString : OrgUse -> String
asString pu =
case pu of
Correspondent ->
"correspondent"
Disabled ->
"disabled"
label : OrgUse -> String
label pu =
case pu of
Correspondent ->
"Correspondent"
Disabled ->
"Disabled"
all : List OrgUse
all =
[ Correspondent, Disabled ]