feat(timetable): ArtistAdvanceDefault seeder + bootstrap
Seeds 5 default sections per RFC v0.2 D15 (General Info, Contacts, Production, Technical Rider, Hospitality) on a per-organisation artist_advance FormSchema with section_level_submit=true. Each section ships with 3-4 illustrative form_fields; organisations customise via the FormBuilder UI later. Wired into org-creation via the new OrganisationObserver so new tenants receive the schema automatically. Existing orgs get coverage via the new artist:seed-advance-default artisan command (idempotent — orgs that already own a schema are skipped). Note: introduces a new production-grade default-seeder convention. Prior FormBuilder defaults were dev-only via FormBuilderDevSeeder called from DevSeeder::run(). This is the first non-dev path. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
27
api/app/Observers/OrganisationObserver.php
Normal file
27
api/app/Observers/OrganisationObserver.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Observers;
|
||||
|
||||
use App\FormBuilder\Defaults\ArtistAdvanceDefault;
|
||||
use App\Models\Organisation;
|
||||
|
||||
/**
|
||||
* Bootstrap an organisation's domain defaults on creation.
|
||||
*
|
||||
* Currently provisions the artist_advance FormSchema (RFC-TIMETABLE
|
||||
* v0.2 D15) so new tenants can use the artist portal flow without a
|
||||
* separate manual step. Existing organisations get the same coverage
|
||||
* via the `artist:seed-advance-default` artisan command.
|
||||
*
|
||||
* The default seeder is idempotent — if the org already owns an
|
||||
* artist_advance schema, the call is a no-op. Safe to re-run.
|
||||
*/
|
||||
final class OrganisationObserver
|
||||
{
|
||||
public function created(Organisation $organisation): void
|
||||
{
|
||||
ArtistAdvanceDefault::seedFor($organisation);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user