Skip to content

Commit

Permalink
TASK: Introduce $affectedOriginDimensionSpacePoints to `NodeAggrega…
Browse files Browse the repository at this point in the history
…teTypeWasChanged` (and rename)

This information is required for the change projection and in the future to select changes for one dimension to publish
  • Loading branch information
mhsdesign committed Dec 5, 2024
1 parent ec01723 commit 0337e96
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,7 @@ protected function createEventsForWronglyTypedNodeAggregate(
$contentGraph->getContentStreamId(),
$nodeAggregate->nodeAggregateId,
$newNodeTypeName,
$nodeAggregate->occupiedDimensionSpacePoints
);

# Handle property adjustments
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

namespace Neos\ContentRepository\Core\Feature\NodeRenaming\Event;

use Neos\ContentRepository\Core\DimensionSpace\OriginDimensionSpacePointSet;
use Neos\ContentRepository\Core\EventStore\EventInterface;
use Neos\ContentRepository\Core\Feature\Common\EmbedsContentStreamId;
use Neos\ContentRepository\Core\Feature\Common\EmbedsNodeAggregateId;
Expand All @@ -39,6 +40,8 @@ public function __construct(
public ContentStreamId $contentStreamId,
public NodeAggregateId $nodeAggregateId,
public NodeName $newNodeName,
/** All dimensions are always affected. All origins this node occupied. */
public OriginDimensionSpacePointSet $affectedOriginDimensionSpacePoints,
) {
}

Expand All @@ -64,6 +67,7 @@ public function withWorkspaceNameAndContentStreamId(WorkspaceName $targetWorkspa
$contentStreamId,
$this->nodeAggregateId,
$this->newNodeName,
$this->affectedOriginDimensionSpacePoints
);
}

Expand All @@ -74,6 +78,7 @@ public static function fromArray(array $values): self
ContentStreamId::fromString($values['contentStreamId']),
NodeAggregateId::fromString($values['nodeAggregateId']),
NodeName::fromString($values['newNodeName']),
OriginDimensionSpacePointSet::fromArray($values['affectedOriginDimensionSpacePoints'])
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,9 @@ private function handleChangeNodeAggregateName(ChangeNodeAggregateName $command,
new NodeAggregateNameWasChanged(
$contentGraph->getWorkspaceName(),
$contentGraph->getContentStreamId(),
$command->nodeAggregateId,
$nodeAggregate->nodeAggregateId,
$command->newNodeName,
$nodeAggregate->occupiedDimensionSpacePoints
),
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

namespace Neos\ContentRepository\Core\Feature\NodeTypeChange\Event;

use Neos\ContentRepository\Core\DimensionSpace\OriginDimensionSpacePointSet;
use Neos\ContentRepository\Core\EventStore\EventInterface;
use Neos\ContentRepository\Core\Feature\Common\EmbedsContentStreamId;
use Neos\ContentRepository\Core\Feature\Common\EmbedsNodeAggregateId;
Expand All @@ -38,7 +39,9 @@ public function __construct(
public WorkspaceName $workspaceName,
public ContentStreamId $contentStreamId,
public NodeAggregateId $nodeAggregateId,
public NodeTypeName $newNodeTypeName
public NodeTypeName $newNodeTypeName,
/** All dimensions are always affected. All origins this node occupied. */
public OriginDimensionSpacePointSet $affectedOriginDimensionSpacePoints,
) {
}

Expand All @@ -63,7 +66,8 @@ public function withWorkspaceNameAndContentStreamId(WorkspaceName $targetWorkspa
$targetWorkspaceName,
$contentStreamId,
$this->nodeAggregateId,
$this->newNodeTypeName
$this->newNodeTypeName,
$this->affectedOriginDimensionSpacePoints
);
}

Expand All @@ -74,6 +78,7 @@ public static function fromArray(array $values): self
ContentStreamId::fromString($values['contentStreamId']),
NodeAggregateId::fromString($values['nodeAggregateId']),
NodeTypeName::fromString($values['newNodeTypeName']),
OriginDimensionSpacePointSet::fromArray($values['affectedOriginDimensionSpacePoints'])
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ private function handleChangeNodeAggregateType(
$contentGraph->getContentStreamId(),
$command->nodeAggregateId,
$command->newNodeTypeName,
$nodeAggregate->occupiedDimensionSpacePoints
),
];

Expand Down

0 comments on commit 0337e96

Please sign in to comment.