fix(timetable): null-on-delete advance_submissions per RFC §5.4 retention

advance_submissions.advance_section_id FK changed from cascadeOnDelete
to nullOnDelete; column made nullable. Aligns implementation with
RFC v0.2 §5.4 audit-immutability ("submissions remain for retention
compliance") — when ArtistEngagementObserver::deleted hard-deletes a
section, its submissions persist as orphans rather than disappearing.

Migration edited in place (branch unpushed, dev-only). Observer
docblock + test assertion updated to match. Removed pre-existing
follow-up comment that documented the deviation.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-08 19:42:36 +02:00
parent e43dd60756
commit a5190ee309
4 changed files with 20 additions and 14 deletions

View File

@@ -15,10 +15,10 @@ use App\Models\Scopes\OrganisationScope;
* (RFC v0.2 D10) and asserts artist.organisation_id === event.organisation_id.
*
* On `deleted` (soft delete): cascade soft-delete to child Performance
* rows; hard-delete child AdvanceSection rows (RFC §5.4 sections have
* no soft delete). Child AdvanceSubmission rows are immutable audit
* records and remain attached to their (now-deleted) section reference
* by FK this is the audit-retention compliance path.
* rows; hard-delete child AdvanceSection rows (per RFC §5.4 sections
* have no soft delete). AdvanceSubmission rows remain in the table with
* `advance_section_id = NULL` (FK is `nullOnDelete`) per RFC §5.4
* audit-immutability orphaned but preserved for retention compliance.
*/
final class ArtistEngagementObserver
{