Change 'DECIDED' property 'updatedAt' to always be set

This commit is contained in:
Wolfgang Huß 2019-11-08 09:41:28 +01:00
parent f4a62b03dc
commit 353687766e
2 changed files with 5 additions and 6 deletions

View File

@ -50,8 +50,7 @@ export default {
CREATE (resource)<-[decision:DECIDED]-(moderator)
SET decision.latest = true
`
} else {
// an open decision …
} else { // an open decision …
if (disable === undefined) disable = openDecisionTxResult.decision.properties.disable // default set to existing
if (closed === undefined) closed = openDecisionTxResult.decision.properties.closed // default set to existing
// current moderator is not the same as old
@ -89,8 +88,8 @@ export default {
}
const cypher =
cypherHeader +
`SET (CASE WHEN decision.createdAt IS NOT NULL THEN decision END).updatedAt = toString(datetime())
SET (CASE WHEN decision.createdAt IS NULL THEN decision END).createdAt = toString(datetime())
`SET decision.updatedAt = toString(datetime())
SET (CASE WHEN decision.createdAt IS NULL THEN decision END).createdAt = decision.updatedAt
SET decision.disable = $disable, decision.closed = $closed
SET resource.disabled = $disable
` +
@ -146,6 +145,6 @@ export default {
},
},
DECIDED: {
...undefinedToNullResolver(['updatedAt', 'uuid']),
...undefinedToNullResolver(['uuid']),
},
}

View File

@ -1,6 +1,6 @@
type DECIDED {
createdAt: String!
updatedAt: String
updatedAt: String!
# reasonCategory: ReasonCategory
# reasonDescription: String
disable: Boolean!