As a user I want to split a combined person entry into separate persons so I can clean up incorrectly merged import data #51
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
User Journey
The user is on a person detail page and notices the person has a combined name like
Clara Cram Gruyter//Ellen B-M— a result of how the original ODS data was structured. They click the Split button next to the existing Merge action. An inline panel appears below the name card with two rows. Each row has a person typeahead to search for an existing person; a "Neue Person anlegen" link below the typeahead switches that row to first name + last name inputs instead.The user fills in both rows — one mapped to an existing person, one as a new person. They see a hint telling them how many documents will be reassigned. They click Aufteilen. The combined person is deleted, both resulting persons are linked to all the original documents, and the user is redirected to the persons list where they can now see the two separate entries.
If they need more than two parts, they click + Weiteren Teil hinzufügen to add another row before confirming.
E2E Scenarios
Implementation Plan
Backend
SplitPersonRequestDTO — list ofSplitPersonPartobjects, each with eitherexistingPersonId: UUID(nullable) ornewFirstName+newLastNamestrings.PersonRepository— no new queries needed. Reuse existing merge helpers:reassignSender(sourceId, firstTargetId)— called once for the first targetinsertMissingReceiverReference(sourceId, targetId)— called in a loop for each targetdeleteReceiverReferences(sourceId)— called once after all targets are addeddeleteById(sourceId)— remove originalPersonService.splitPerson(UUID sourceId, SplitPersonRequest):createPerson)PersonentitiesPersonController— addPOST /api/persons/{id}/splitendpoint, requiresWRITE_ALLpermission, returnsList<Person>.ErrorCode— no new codes needed; useResponseStatusExceptionfor simple validation errors (< 2 parts, source = target, etc.).Frontend
Regenerate API types after backend changes (
npm run generate:api)./persons/[id]/+page.svelte— add split panel:POST /api/persons/{id}/splitdirectly (client-side fetch, no form action needed since it's a destructive operation with redirect)goto('/persons')i18n — add translation keys in
de.json,en.json,es.jsonfor all new UI strings (button label, panel title, row labels, hint text, confirmation).Out of Scope
//,&,und, etc.) — user fills in the parts manuallyfeat: split combined person entries into separate personsto As a user I want to split a combined person entry into separate persons so I can clean up incorrectly merged import data