Skip to content

CAP-PFM-MTD-019Preserve Relationships Through Deletion and Merge

Markdown

CAP-PFM-MTD-019

Preserve Relationships Through Deletion and Merge

Markdown
  • DocumentDraft
  • Product intentConfirmed
  • ImplementationObserved

KindCapabilityProduct areaPlatformModuleMetadata and Organization-defined RecordsRevision1

Read atservices-platform ad3f6a65react-console baf6dae3

The Formal Contract

The narrative above explains; the sections below are authoritative — the rules, scenarios and tests this document binds.

Outcomes
Removing or consolidating endpoints must account for the information connected to them.Planning reports the expected effects before application.
Surfaces
jobapi
Intent sources
services-platform:docs/milestones/PLAT-M5-custom-records.md#CRM-M1 (owner delete), PLAT-M5 B5services-platform:docs/milestones/plans/PLAT-M6-plan.md#4. Assumptions A2, A3; 5. D4 (Andrew, 2026-10-21: move to survivor)services-platform:docs/milestones/PLAT-M6-custom-record-relationships.md#Changes requested (2026-10-21, "All or nothing")

Controls

23 controls apply, from the corpus control catalogue.

TC-AZ-001 TC-AZ-002 TC-AZ-003 TC-AZ-004 TC-DAT-001 TC-DAT-002 TC-DAT-003 TC-DAT-004 TC-LOG-002 TC-LOG-003 TC-LOG-004 TC-LOG-005 TC-PI-001 TC-PI-005 TC-PRV-001 TC-PRV-002 TC-TEN-001 TC-TEN-002 TC-TEN-003 TC-TEN-004 TC-VEN-001 TC-VEN-002 TC-VEN-003

Permissions

KeyChecked atScope
rhythm_crm_app and rhythm_platform_app execution of the endpoint deletion and merge functions (no user key)databasetenant

Business Rules

10 rules, 10 to be proved before approval. A rule's product intent is derived from its origin: 10 confirmed by a product decision, the rest inheriting this capability's confirmed.

IdRuleKindEnforced atProvenance
01must prove
Confirmed
Endpoint deletion applies the configured side rule: detach removes links, cascade also deletes the opposite custom record, restrict refuses in-force links and ended links are removed regardless of policy.
origin: services-platform:docs/milestones/plans/PLAT-M6-plan.md#4. Assumptions A1 (approved 2026-10-21)
policydatabasetest
services-platform:modules/associations/tests/integration/db/apply-endpoint-deletion.integration.spec.js#answers what endpointDeletionOutcome says for an open association on the to side under restrict
02must prove
Confirmed
Cascades cannot delete contacts or organizations, stop at a depth of ten and roll back when the depth or a record lock prevents deletion.
validationdatabasetest
services-platform:modules/associations/tests/integration/db/apply-endpoint-deletion.integration.spec.js#refuses to delete a locked record in the cascade, naming it, and removes nothing
03must prove
Confirmed
CRM endpoint deletion invokes relationship rules within its own transaction and reports restricting types while rolling back all resulting changes on refusal.
origin: services-platform:docs/milestones/PLAT-M5-custom-records.md#CRM-M1 (owner delete), applied 2026-10-19
policydatabasetest
04must prove
Confirmed
CRM-originated cascades perform the same value cleanup, asset detachment, audit, history and event work as direct custom-record deletion.
invariantdatabasetest
services-platform:modules/associations/tests/integration/db/apply-endpoint-deletion.integration.spec.js#leaves the same audit rows, events, revisions and no record, as the record store does
05must prove
Confirmed
Deletion functions operate only within the transaction workspace and are executable only by the authorized CRM and Platform service roles.
permissiondatabasetest
services-platform:modules/associations/tests/integration/db/apply-endpoint-deletion.integration.spec.js#refuses another tenant than the transaction’s with 42501, removing nothing
06must prove
Confirmed
Owner policies continue to apply when the owned object is draft or archived, including cascades and restricting links.
origin: services-platform:docs/milestones/PLAT-M5-custom-records.md#PLAT-M5 B5 (Andrew, 2026-10-19: "Rule applies anyway")
policydatabasetest
07must prove
Confirmed
Merging CRM duplicates moves current and ended links to the survivor, ends overlapping duplicate or self-links on the merge day and clears an additional primary flag.
policydatabasetest
services-platform:modules/associations/tests/integration/db/associations-merge.integration.spec.js#ends m’s association that repeats s’s, giving it s’s id, and leaves s’s as it was
08must prove
Confirmed
Merge also redirects custom-record reference values from merged contacts or organizations to the survivor and captures prior values in history.
origin: services-platform:docs/milestones/plans/PLAT-M6-plan.md#5. D4 (Andrew, 2026-10-21: "Move to survivor")
policydatabasetest
09must prove
Confirmed
Merge planning counts moved links, redirected references and endings, application follows those counts, repeat application moves nothing and per-record limits do not block a merge.
calculationdatabasetest
services-platform:modules/associations/tests/integration/db/associations-merge.integration.spec.js#counts the associations held by m, and says how many end instead of moving
10must prove
Confirmed
Workspace deletion clears relationships before their types, and reset empties both collections.
no proof recorded yet
lifecycleservicedocumented

Scenarios

IdGivenWhenThenProvenance
01Ola owns Fulmar under a cascading ownership policy.Delete Ola through CRM.Both endpoint and dependent boat disappear and no retained link names Ola.test

Edge Cases

IdGivenWhenThenProvenance
02Jane duplicate has crew ties and is a boat Previous Owner reference.Merge the duplicate into Jane through CRM.Crew links, boat ownership and the reference identify the survivor.test
react-console:acceptance/custom-objects/playwright/journeys/PLAT-M6-S11.spec.ts#PLAT-M6-S11: after CRM merges Jane's duplicate her crew places, her boats and Osprey's Previous Owner name the surviving Jane

The Markdown files under specs/ in rhythmsoftware/rhythm-v2-docs are the canonical source of truth. This reader is a generated, read-only projection of them.