Skip to content

Relationship duration and the concept of active

The following business rules should be considered "global" for all relationships, and it is expected that these rules will be enforced in the API logic.

#Description
1All relationships have a duration that is determined by the relationship properties fromDate and thruDate.
2Any relationship is considered active if the fromDate relationship property is <= today and the thruDate is >= today or blank. This implies that the active relationship property is a convenience for users of the API that encapsulates the rule, and as such, active should be maintained by the API and not set directly by an end-user call.
3There can be one and only one active relationship between a party and a node.
4Relationship durations for a given party and node should not overlap other relationships for the same party and node.
5A relationship is never deleted except in very rare cases of a bug in the business logic where we are cleaning up an error. Instead, a relationship is deactivated. Deactivation business rules are discussed later in this document.
6No :Party should exist without at least one active :Role relationship.
7Attempting to set a thruDate in the future (> today) is invalid and will not be allowed by the API.

WATCH OUT FOR DATES

When working with these dates we must watch out for UTC issues here. When we use date() in the manner you will see in samples below, that will be the date as seen by Neo4j, which will very likely be UTC. This means the date may not appear "correct" due to the timezone issues. We will need to build out a special callout section on date handling in the service so we're all on the same page.

Confidential. For internal use only.