diff --git a/config/models b/config/models index 842ee4a..9ce65d0 100644 --- a/config/models +++ b/config/models @@ -41,10 +41,11 @@ Group UniqueGroupIdent ident Project - ident Text --CI - sharer SharerId - name Text Maybe - desc Text Maybe + ident Text --CI + sharer SharerId + name Text Maybe + desc Text Maybe + nextTicket Int default='0' UniqueProject ident sharer @@ -62,3 +63,13 @@ PersonInGroup group GroupId UniquePersonInGroup person group + +Ticket + project ProjectId + number Int + created UTCTime + title Text + desc Text -- Assume this is Pandoc Markdown + done Bool + + UniqueTicket project number diff --git a/src/Vervis/Field/Project.hs b/src/Vervis/Field/Project.hs index 1f43e74..c064b10 100644 --- a/src/Vervis/Field/Project.hs +++ b/src/Vervis/Field/Project.hs @@ -38,10 +38,11 @@ checkIdentTemplate = checkIdentUnique :: SharerId -> Field Handler Text -> Field Handler Text checkIdentUnique sid = checkM $ \ ident -> do let project = Project - { projectIdent = ident - , projectSharer = sid - , projectName = Nothing - , projectDesc = Nothing + { projectIdent = ident + , projectSharer = sid + , projectName = Nothing + , projectDesc = Nothing + , projectNextTicket = 0 } mup <- runDB $ checkUnique project return $ if isNothing mup diff --git a/src/Vervis/Form/Project.hs b/src/Vervis/Form/Project.hs index 3245a4e..e0286e1 100644 --- a/src/Vervis/Form/Project.hs +++ b/src/Vervis/Form/Project.hs @@ -28,6 +28,7 @@ newProjectAForm sid = Project <*> pure sid <*> aopt textField "Name" Nothing <*> aopt textField "Description" Nothing + <*> pure 0 newProjectForm :: SharerId -> Form Project newProjectForm = renderDivs . newProjectAForm