Skip to content

Commit

Permalink
Revert "Memberships and roles are order by termination date, then inc…
Browse files Browse the repository at this point in the history
…eption date with the most recent at the top of the list"

This reverts commit 254f71d.
  • Loading branch information
Scott Newton committed Apr 18, 2018
1 parent c94abd8 commit 88f95c8
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions people/cypher.go
Expand Up @@ -119,9 +119,8 @@ func (pcw CypherDriver) Read(uuid string, transactionID string) (Person, bool, e
OPTIONAL MATCH (m)-[rr:HAS_ROLE]->(r:MembershipRole)
WITH canonical,
{ id:o.uuid, types:labels(o), prefLabel:o.prefLabel} as o,
{ id:m.uuid, types:labels(m), prefLabel:m.prefLabel, title:m.title, changeEvents:[{startedAt:m.inceptionDate}, {endedAt:m.terminationDate}] } as m ORDER BY m.terminationDateEpoch DESC, m.inceptionDateEpoch DESC, r, rr
WITH m, o,canonical,
{ id:r.uuid, types:labels(r), prefLabel:r.prefLabel, changeEvents:[{startedAt:rr.inceptionDate},{endedAt:rr.terminationDate}] } as r ORDER BY rr.terminationDateEpoch DESC, rr.inceptionDateEpoch DESC
{ id:m.uuid, types:labels(m), prefLabel:m.prefLabel, title:m.title, changeEvents:[{startedAt:m.inceptionDate}, {endedAt:m.terminationDate}] } as m,
{ id:r.uuid, types:labels(r), prefLabel:r.prefLabel, changeEvents:[{startedAt:rr.inceptionDate}, {endedAt:rr.terminationDate}] } as r
WITH canonical, m, o, collect(r) as r ORDER BY o.uuid DESC
WITH canonical, collect({m:m, o:o, r:r}) as m
WITH m, { ID:canonical.prefUUID, types:labels(canonical), prefLabel:canonical.prefLabel, labels:canonical.aliases,
Expand Down Expand Up @@ -167,9 +166,8 @@ func (pcw CypherDriver) ReadOldConcordanceModel(uuid string, transactionID strin
OPTIONAL MATCH (m)-[rr:HAS_ROLE]->(r:MembershipRole)
WITH p,
{ id:o.uuid, types:labels(o), prefLabel:o.prefLabel} as o,
{ id:m.uuid, types:labels(m), prefLabel:m.prefLabel, title:m.title, changeEvents:[{startedAt:m.inceptionDate}, {endedAt:m.terminationDate}] } as m ORDER BY m.terminationDateEpoch DESC, m.inceptionDateEpoch DESC, r, rr
WITH p, m, o,
{ id:r.uuid, types:labels(r), prefLabel:r.prefLabel, changeEvents:[{startedAt:rr.inceptionDate},{endedAt:rr.terminationDate}] } as r ORDER BY rr.terminationDateEpoch DESC, rr.inceptionDateEpoch DESC
{ id:m.uuid, types:labels(m), prefLabel:m.prefLabel, title:m.title, changeEvents:[{startedAt:m.inceptionDate}, {endedAt:m.terminationDate}] } as m,
{ id:r.uuid, types:labels(r), prefLabel:r.prefLabel, changeEvents:[{startedAt:rr.inceptionDate}, {endedAt:rr.terminationDate}] } as r
WITH p, m, o, collect(r) as r ORDER BY o.uuid DESC
WITH p, collect({m:m, o:o, r:r}) as m
WITH m, { id:p.uuid, types:labels(p), prefLabel:p.prefLabel, labels:p.aliases,
Expand Down

0 comments on commit 88f95c8

Please sign in to comment.