feat(person): ErrorCode.PERSON_RENAME_CONFLICT for optimistic-lock conflicts
Adds the structured error code returned when a rename rolls back because a referenced transcription block was edited concurrently (OptimisticLockException on transcription_blocks.version). Mirrors the contract in frontend src/lib/errors.ts and adds the localised message keys error_person_rename_conflict in de/en/es so the UI surfaces a retry hint instead of a generic 500. The actual translation of OptimisticLockException → DomainException (PERSON_RENAME_CONFLICT) lands in the next commit alongside the integration test that proves the rollback semantics. Refs #362 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -8,6 +8,7 @@ export type ErrorCode =
|
||||
| 'PERSON_NOT_FOUND'
|
||||
| 'ALIAS_NOT_FOUND'
|
||||
| 'INVALID_PERSON_TYPE'
|
||||
| 'PERSON_RENAME_CONFLICT'
|
||||
| 'DOCUMENT_NOT_FOUND'
|
||||
| 'DOCUMENT_NO_FILE'
|
||||
| 'FILE_NOT_FOUND'
|
||||
@@ -79,6 +80,8 @@ export function getErrorMessage(code: ErrorCode | string | undefined): string {
|
||||
return m.error_alias_not_found();
|
||||
case 'INVALID_PERSON_TYPE':
|
||||
return m.error_invalid_person_type();
|
||||
case 'PERSON_RENAME_CONFLICT':
|
||||
return m.error_person_rename_conflict();
|
||||
case 'DOCUMENT_NOT_FOUND':
|
||||
return m.error_document_not_found();
|
||||
case 'DOCUMENT_NO_FILE':
|
||||
|
||||
Reference in New Issue
Block a user