fix(timetable): config-flag observer + cleaner idempotency_key

OrganisationObserver was gated on app()->runningUnitTests() — replaced
with config('artist_advance.bootstrap_on_org_create') (default true,
phpunit.xml overrides to false). Behaviour identical, but the seam is
explicit and removable. Tracked for full convergence by new BACKLOG
entry TECH-OBSERVER-TEST-CONVERGENCE — productiegedrag = testgedrag,
geen branching, na test-cleanup.

idempotency_key for the engagement-scoped draft simplified from
'aa-' + sha1(engagement_id)[0:27] to 'aa:' + engagement_id (29 chars,
fits varchar(30)). Same uniqueness guarantee, recognisable shape.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-08 23:18:15 +02:00
parent 96eb7e91e7
commit 889441cb39
4 changed files with 35 additions and 9 deletions

View File

@@ -0,0 +1,25 @@
<?php
declare(strict_types=1);
return [
/*
|---------------------------------------------------------------------
| Bootstrap on organisation create
|---------------------------------------------------------------------
|
| When true (production default), OrganisationObserver provisions a
| default artist_advance FormSchema for every newly-created
| Organisation per RFC-TIMETABLE v0.2 D15. When false, the observer
| no-ops and tests opt in to the seeder explicitly via
| `ArtistAdvanceDefault::seedFor()`.
|
| Tracked for removal by BACKLOG: TECH-OBSERVER-TEST-CONVERGENCE
| once existing FormSchema-counting tests are updated to expect the
| auto-bootstrapped schema, this flag goes away (productiegedrag =
| testgedrag, geen branching).
|
*/
'bootstrap_on_org_create' => env('ARTIST_ADVANCE_BOOTSTRAP_ON_ORG_CREATE', true),
];