feat(sync) : add slot selection controllers, custom field sync, and position fallbacks

- Add selectedPieceId support to ComposantPieceSlotController
- Create ComposantProductSlotController and ComposantSubcomponentSlotController
- Add updateCustomFields() to SkeletonStructureService for managing CustomField entities
- Fix position/orderIndex fallback to array index in all 3 sync strategies
- Fix type comparison in ProductSyncStrategy for dual format support
- Update CLAUDE.md with new entities, controllers, and fixtures documentation
- Update frontend submodule with interactive slot selectors

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Matthieu
2026-03-13 16:40:44 +01:00
parent 4072abf7ba
commit b2aff0e414
11 changed files with 1380 additions and 28 deletions

View File

@@ -43,10 +43,11 @@ class ProductSyncStrategy implements SyncStrategyInterface
$existingByOrder[$field->getOrderIndex()] = $field;
}
// Map proposed fields by orderIndex
// Map proposed fields by orderIndex (falls back to array index)
$proposedByOrder = [];
foreach ($proposedFields as $pf) {
$proposedByOrder[$pf['orderIndex']] = $pf;
foreach ($proposedFields as $i => $pf) {
$order = $pf['orderIndex'] ?? $i;
$proposedByOrder[$order] = $pf;
}
$addedFields = 0;
@@ -57,7 +58,7 @@ class ProductSyncStrategy implements SyncStrategyInterface
foreach ($proposedByOrder as $orderIndex => $pf) {
if (!isset($existingByOrder[$orderIndex])) {
++$addedFields;
} elseif ($existingByOrder[$orderIndex]->getType() !== $pf['type']) {
} elseif ($existingByOrder[$orderIndex]->getType() !== ($pf['type'] ?? $pf['value']['type'] ?? null)) {
++$modifiedFields;
}
}