##### Context The planning tree displays each member's relationship to the account holder (e.g., "Grandson"). Initially, every relationship was defined explicitly from the owner to each member. This required redundant data entry — if David is Robert's Son and Olivia is David's Daughter, the user still had to separately define Olivia as Robert's Granddaughter. The tree also needs to draw connector lines between parents and their children, which requires knowing the direct parent-child chain — not just the relationship to the owner. ##### Decision Support both **explicit** and **computed** relationships to the account holder. Relationships are defined person-to-person (parent → child), and the relationship to the owner is derived by walking the chain. **Rules:** 1. **Direct relationships take precedence.** If the owner explicitly defines a relationship to a person (e.g., Robert → Olivia = Granddaughter), that label is used regardless of what the chain would compute. 2. **Computed relationships fill gaps.** If a person has no direct relationship to the owner but is reachable through a parent-child chain, the system computes the relationship label and level. 3. **Tree lines follow the actual parent-child chain.** Connector lines are always drawn from a person's direct parent (or the parent's union diamond if the parent has a spouse), not from the owner. 4. **Either model works independently.** A user can define a grandson without including parents — the explicit relationship is sufficient. A user can also define only parent-child links and let the system compute everything. **Label computation:** - Each parent-child hop adds one generational level - The computed label is derived from the cumulative level and the final relationship type's gender: - Level 1: Son / Daughter - Level 2: Grandson / Granddaughter - Level 0 (peer): Brother / Sister / Wife / Husband - Level -1: Father / Mother - Level -2: Grandfather / Grandmother **Discovery:** - Members are discovered by loading direct relationships from the owner, then recursively walking inter-member parent-child relationships to find additional descendants - A person discovered through a chain is added to the tree even if the owner has no explicit relationship to them ##### Rationale - **Reduces data entry**: Adding a grandchild only requires one relationship (parent → child), not two - **Maintains flexibility**: Users who want to define relationships their own way can still do so - **Single source of truth for tree lines**: The parent-child chain is the structural truth; the owner relationship is a display label - **Backward compatible**: Existing explicit relationships continue to work unchanged ##### Consequences - Service layer must perform recursive traversal to discover chain-connected members - Computed labels may need refinement as relationship types expand (e.g., Step-son, In-law) - The "relationship to you" shown in the UI may differ from what a user expects if they define relationships inconsistently (e.g., defining someone as both a Son and a Grandson through different paths) — direct always wins - Inter-member relationships are stored in the same `Relationship` table with no structural change --- **Decision Date**: March 23, 2026 **Author**: Joshua Angulo