mirror of
https://code.sup39.dev/repos/Wqawg
synced 2024-12-29 15:44:51 +09:00
Add Ticket to persistent model
This commit is contained in:
parent
dbf0c5a2cb
commit
5f909bd3b3
3 changed files with 21 additions and 8 deletions
|
@ -45,6 +45,7 @@ Project
|
||||||
sharer SharerId
|
sharer SharerId
|
||||||
name Text Maybe
|
name Text Maybe
|
||||||
desc Text Maybe
|
desc Text Maybe
|
||||||
|
nextTicket Int default='0'
|
||||||
|
|
||||||
UniqueProject ident sharer
|
UniqueProject ident sharer
|
||||||
|
|
||||||
|
@ -62,3 +63,13 @@ PersonInGroup
|
||||||
group GroupId
|
group GroupId
|
||||||
|
|
||||||
UniquePersonInGroup person group
|
UniquePersonInGroup person group
|
||||||
|
|
||||||
|
Ticket
|
||||||
|
project ProjectId
|
||||||
|
number Int
|
||||||
|
created UTCTime
|
||||||
|
title Text
|
||||||
|
desc Text -- Assume this is Pandoc Markdown
|
||||||
|
done Bool
|
||||||
|
|
||||||
|
UniqueTicket project number
|
||||||
|
|
|
@ -42,6 +42,7 @@ checkIdentUnique sid = checkM $ \ ident -> do
|
||||||
, projectSharer = sid
|
, projectSharer = sid
|
||||||
, projectName = Nothing
|
, projectName = Nothing
|
||||||
, projectDesc = Nothing
|
, projectDesc = Nothing
|
||||||
|
, projectNextTicket = 0
|
||||||
}
|
}
|
||||||
mup <- runDB $ checkUnique project
|
mup <- runDB $ checkUnique project
|
||||||
return $ if isNothing mup
|
return $ if isNothing mup
|
||||||
|
|
|
@ -28,6 +28,7 @@ newProjectAForm sid = Project
|
||||||
<*> pure sid
|
<*> pure sid
|
||||||
<*> aopt textField "Name" Nothing
|
<*> aopt textField "Name" Nothing
|
||||||
<*> aopt textField "Description" Nothing
|
<*> aopt textField "Description" Nothing
|
||||||
|
<*> pure 0
|
||||||
|
|
||||||
newProjectForm :: SharerId -> Form Project
|
newProjectForm :: SharerId -> Form Project
|
||||||
newProjectForm = renderDivs . newProjectAForm
|
newProjectForm = renderDivs . newProjectAForm
|
||||||
|
|
Loading…
Reference in a new issue