Skip to content

9.0 !!! REFACTOR: adjust move event structure (breaking event payload change) #3913

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Nov 7, 2022

Conversation

skurfuerst
Copy link
Member

@skurfuerst skurfuerst commented Oct 7, 2022

ToDo List

  • Event Payload Update
  • Command Handler Update
  • Projection Update
  • Event Documentation
  • tests run through again
  • adjust DocumentUriPathProjection
  • adjust ChangeProjection

The current structure of the NodeAggregateWasMoved is rather complex. Especially the NodeMoveMappings are hard to grasp.

Besides, the hash of the affected ContentDimensionSpacepoints is expected as keys for NodeVariantAssignments::createFromArray() which makes this error prone. Also it makes the internal implementation detail part of the event payload.

Solution

It makes sense to combine the two sets newParentAssignments and newSucceedingSiblingAssignments into one and to replace the associative array, e.g.:

OLD:

{
	"nodeAggregateIdentifier": "a",
	"nodeMoveMappings": [{
		"movedNodeOrigin": {
			"language": "ch"
		},
		"newParentAssignments": {
			"1041cc1fe1030c1a82ac24346f8c69a7": {
				"nodeAggregateIdentifier": "b",
				"originDimensionSpacePoint": {
					"language": "de"
				}
			}
		},
		"newSucceedingSiblingAssignments": {
			"1041cc1fe1030c1a82ac24346f8c69a7": {
				"nodeAggregateIdentifier": "b1",
				"originDimensionSpacePoint": {
					"language": "de"
				}
			}
		}
	}],
        // ...
}

New:

{
	"nodeAggregateIdentifier": "a",
	"nodeMoveMappings": [{
		"movedNodeOrigin": {
			"language": "ch"
		},
		"newLocations": [{
			"coveredDimensionSpacePoint": {
				"language": "ch"
			},
			"newParent": {
				"nodeAggregateIdentifier": "b",
				"originDimensionSpacePoint": {
					"language": "de"
				}
			},
			"newSucceedingSibling": {
				"nodeAggregateIdentifier": "b1",
				"originDimensionSpacePoint": {
					"language": "de"
				}
			}
		}]
	}],
        // ...
}

Resolves: #3825

@skurfuerst skurfuerst changed the title 9.0 DRAFT: adjust move event structure (not yet working) 9.0 !!! REFACTOR: adjust move event structure (breaking event payload change) Nov 4, 2022
@skurfuerst skurfuerst marked this pull request as ready for review November 4, 2022 21:06
@skurfuerst skurfuerst merged commit fdbc88e into 9.0 Nov 7, 2022
@skurfuerst skurfuerst deleted the simplify-moved-event branch November 7, 2022 14:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant