Pre-flight audit verified the implementation was already in place, so this commit is test-only (as the task prompt allowed): - api/database/migrations/2026_04_08_220000_create_persons_table.php:27 already carries $table->softDeletes(). - api/app/Models/Person.php lines 18 + 24 already use the SoftDeletes trait. No production code change required. tests/Feature/Person/PersonSoftDeleteTest.php pins the documented behaviour so WS-6 (FormBindingApplicator + ARTIST_ADVANCE / EVENT_REGISTRATION workflows) can rely on it without a second verification pass: - delete() sets deleted_at and excludes the row from default queries - Person::withTrashed()->find($id) returns the soft-deleted row - Person::onlyTrashed()->count() reports accurately - restore() clears deleted_at - forceDelete() removes the row permanently PersonPolicy was spot-checked alongside the audit; existing view/update/ delete methods do not invoke withTrashed() on controller resolution. That's acceptable today — no caller relies on editing a trashed Person — so AUTH_ARCHITECTURE.md is left unchanged. If a restore-workflow lands in a future sprint, the controller binding will need to switch to ->withTrashed() and the behaviour deserves a dedicated doc paragraph then. Minor path note: the task prompt specified tests/Feature/Persons/PersonSoftDeleteTest.php (plural), but the existing convention in this repo is tests/Feature/Person/ (singular). Matched the existing directory rather than introducing a singular/plural split. Also carries the BACKLOG DOC-04 entry Bert asked for during WS-4 review: scripts/install-claude-sync-hooks.sh belongs in SETUP.md / onboarding so new clones don't miss the post-commit sync hook. 5 tests / 10 new assertions. Full suite: 1005 passed (2716 assertions). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2.8 KiB
2.8 KiB