feat(form-builder): add BindingTypeRegistry as single source of truth for target shapes (WS-6)
Config-driven mapping from (target_entity, target_attribute) to storage shape (scalar/collection/relation), PHP type, and identity-key eligibility. Replaces any name-suffix matching (e.g. _tags, _skills) — those are convention-not-contract and reject by design. Used by publish guards now and (in session 2) by FormBindingApplicator. Refs: RFC-WS-6.md §4 (V1) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
21
api/app/FormBuilder/Bindings/BindingTargetMeta.php
Normal file
21
api/app/FormBuilder/Bindings/BindingTargetMeta.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\FormBuilder\Bindings;
|
||||
|
||||
use App\Enums\FormBuilder\BindingTargetType;
|
||||
|
||||
/**
|
||||
* RFC-WS-6 §4 (V1) — single config row from
|
||||
* config/form_builder/binding_targets.php, materialised by
|
||||
* {@see BindingTypeRegistry::resolve()}.
|
||||
*/
|
||||
final readonly class BindingTargetMeta
|
||||
{
|
||||
public function __construct(
|
||||
public BindingTargetType $type,
|
||||
public string $php,
|
||||
public bool $identityKeyEligible,
|
||||
) {}
|
||||
}
|
||||
Reference in New Issue
Block a user