aa62ca490e
A new per-tree Cleanup page (and cleanup_service + endpoints), each fix preview-first per the propose-then-approve rule: - Mark deceased by birth year: lists people born ≤ a cutoff (default 1930) not already deceased; apply sets is_living=false for the ones you keep checked. - Set sex from a source GEDCOM: upload the source .ged (it carries SEX); matches by name and proposes sex only where it's missing — far more accurate than guessing from first names. Review, then apply. - Names that look broken: flags date-in-surname / date-in-given / no-surname / packed given names, with inline editable given+surname; fix the checked ones. No migration (uses existing columns). 55 backend tests pass (preview+apply for all three); frontend builds. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
51 lines
816 B
Python
51 lines
816 B
Python
import uuid
|
|
|
|
from pydantic import BaseModel
|
|
|
|
|
|
class DeceasedCandidate(BaseModel):
|
|
person_id: uuid.UUID
|
|
name: str
|
|
birth_year: int
|
|
|
|
|
|
class DeceasedApply(BaseModel):
|
|
person_ids: list[uuid.UUID]
|
|
|
|
|
|
class GenderProposal(BaseModel):
|
|
person_id: uuid.UUID
|
|
name: str
|
|
proposed_gender: str
|
|
|
|
|
|
class GenderUpdate(BaseModel):
|
|
person_id: uuid.UUID
|
|
gender: str
|
|
|
|
|
|
class GenderApply(BaseModel):
|
|
updates: list[GenderUpdate]
|
|
|
|
|
|
class NameIssue(BaseModel):
|
|
name_id: uuid.UUID
|
|
person_id: uuid.UUID
|
|
given: str | None = None
|
|
surname: str | None = None
|
|
issue: str
|
|
|
|
|
|
class NameEdit(BaseModel):
|
|
name_id: uuid.UUID
|
|
given: str | None = None
|
|
surname: str | None = None
|
|
|
|
|
|
class NameApply(BaseModel):
|
|
edits: list[NameEdit]
|
|
|
|
|
|
class CleanupResult(BaseModel):
|
|
updated: int
|