-
Notifications
You must be signed in to change notification settings - Fork 18
Description
Currently the "@DomainEventExpectedEntityIdPath" annotation has a list of expected entity IDs in the path.
It is expected that they exactly match the provided IDs.
There are cases where also partial parts are possible. An example is a tree structure with multiple elements of the same type.
Example entity id paths that are all valid for the same command:
COMPANY 1/DEPARTEMENT 2/DEPARTEMENT 3COMPANY 1/DEPARTEMENT 2
As a departement may contain another departement, there can be 1..N departement IDs in this example.
If currently the expected path is: @DomainEventExpectedEntityIdPath(ComanyId.class, DepartementId.class) , the validation will fail for the first entity ID path. In case of @DomainEventExpectedEntityIdPath({ComanyId.class, DepartementId.class, DepartementId.class}) the scond one will fail.
We need some kind of new parameter open array for @DomainEventExpectedEntityIdPath, which means the last parameter in the expected path can bei repeated 0..N times. It should be defined by min and max.
Idea: @DomainEventExpectedEntityIdPath(value = {ComanyId.class, DepartementId.class}, lastParamMin=1, lastParamMax=10) - Any number of departement IDs from 1..10 allowed.