Relationship validation

Created on 23 May 2025, 15 days ago

Problem/Motivation

It is possible to grant a relationship between the same contact.

The same contact can be selected for contact_a and contact_b.

Steps to reproduce

Proposed resolution

Update the Relationship entity validation method.

Remaining tasks

User interface changes

API changes

Data model changes

✨ Feature request
Status

Active

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States bluegeek9

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @bluegeek9
  • πŸ‡ΊπŸ‡ΈUnited States jdleonard Austin, TX, USA

    Brainstorming a counter argument to the assumption that a relationship can't be between one Contact and itself...

    Imagine a doctor's office with a Relationship "financially responsible for".

    JD is financially responsible for JD
    JD is financially responsible for Laura
    JD is financially responsible for Ramona
    JD is financially responsible for Sam

    This wouldn't necessarily flow through a Household and could involve the proposed forbidden relationship.

    Perhaps instead of limiting the relationship, there should be a warning to catch accidents but allow these sorts of exceptions.

  • πŸ‡ΊπŸ‡ΈUnited States bluegeek9

    It seems like a corner case. Is this something you are planning to use?

    It is possible to make it a setting on the relationship bundle.

    It would not make sense to allow the same contact in a parent-child relationship.

    If it is allowed, the form should make the user confirm, or otherwise indicate that the same contact is selected.

    None of the relationship types so far should allow the same contact.

    I am reluctant to add a setting at this time. I will think about it.

  • πŸ‡ΊπŸ‡ΈUnited States jdleonard Austin, TX, USA

    Not a use case I'm expecting to encounter personally. I'm just playing devil's advocate in an effort to avoid potential problems caused by validation.

    Thinking through a hypothetical setting on the Relationship, I would suggest that it default to preventing a relationship to oneself. It could even be hidden during Relationship creation and only be visible when editing a Relationship to support the option without cluttering the main flow, but I don't think it makes much difference.

  • πŸ‡ΊπŸ‡ΈUnited States bluegeek9

    Adds possible validation method.

  • Pipeline finished with Skipped
    13 days ago
    #506169
  • πŸ‡ΊπŸ‡ΈUnited States bluegeek9
Production build 0.71.5 2024