feat(form-builder): add PublishGuard framework + 9 concrete guards (WS-6)
Per-purpose schema validation composes a PurposeGuardProvider returning a list of guards. Errors collected (not first-fail) so the builder UI surfaces every issue per save. ConditionalRequirement composes higher- order without proliferating one-off classes. RequiresIdentityKeyBinding checks the is_identity_key flag specifically; the binding-existence check is handled additively by the existing assertRequiredBindingsPresent in FormSchemaService. SchemaHasLinkedEvent checks owner_type='event' + owner_id (FormSchema uses polymorphic owner; there is no direct event_id column). i18n messages live in lang/nl/form_builder_publish_guards.php. Refs: RFC-WS-6.md §3 (Q13), §4 (V1, V3) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
19
api/lang/nl/form_builder_publish_guards.php
Normal file
19
api/lang/nl/form_builder_publish_guards.php
Normal file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* RFC-WS-6 §3 (Q13) — i18n keys for PublishGuardResult::failed() messages.
|
||||
* Dutch only for v1 per CLAUDE.md (Crewli is Dutch-first).
|
||||
*/
|
||||
return [
|
||||
'requires_identity_key_binding' => 'Het veld voor :entity.:attribute moet als identity-key zijn aangemerkt.',
|
||||
'max_one_identity_key_per_target_entity' => 'Per doel-entiteit mag maximaal één binding identity-key zijn.',
|
||||
'requires_field_type' => 'Dit formulier moet ten minste :min_count veld(en) van type :type bevatten.',
|
||||
'schema_has_linked_event' => 'Dit formulier moet aan een evenement gekoppeld zijn.',
|
||||
'tag_categories_configured_on_all_pickers' => 'Alle TAG_PICKER-velden moeten een geconfigureerde categorie hebben.',
|
||||
'identity_key_bindings_only_in_first_section' => 'Identity-key bindings zijn alleen toegestaan in de eerste sectie wanneer per-sectie inzenden actief is.',
|
||||
'append_strategy_requires_collection_target' => 'Append-strategie is alleen toegestaan op collectie-typen.',
|
||||
'no_ambiguous_trust_levels' => 'Twee of meer bindings naar hetzelfde doel hebben hetzelfde trust-niveau — kies een uniek niveau om volgorde te bepalen.',
|
||||
'conditional' => 'Conditionele eis niet voldaan.',
|
||||
];
|
||||
Reference in New Issue
Block a user