mirror of
https://code.sup39.dev/repos/Wqawg
synced 2024-12-29 01:14: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
|
@ -41,10 +41,11 @@ Group
|
||||||
UniqueGroupIdent ident
|
UniqueGroupIdent ident
|
||||||
|
|
||||||
Project
|
Project
|
||||||
ident Text --CI
|
ident Text --CI
|
||||||
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
|
||||||
|
|
|
@ -38,10 +38,11 @@ checkIdentTemplate =
|
||||||
checkIdentUnique :: SharerId -> Field Handler Text -> Field Handler Text
|
checkIdentUnique :: SharerId -> Field Handler Text -> Field Handler Text
|
||||||
checkIdentUnique sid = checkM $ \ ident -> do
|
checkIdentUnique sid = checkM $ \ ident -> do
|
||||||
let project = Project
|
let project = Project
|
||||||
{ projectIdent = ident
|
{ projectIdent = ident
|
||||||
, 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