This resolves the issue at hand, but in an ad hoc way, which feels very wrong. I still feel like I/we are doing something wrong with these conversions.
The problem here is:
Given an AggregateReference<E, C> with E an entity and C a type for which a write converter is regsitered, we currently determine C as the target type of the conversion.
With this information we call the AggregateReference converter, which extracts the id value and determines it is done, because the result is of the desired target type.
This is demonstrated by the failing new unit test.
The integration test is fixed by just slapping a getPotentiallyConvertedSimpleWrite on the already converted type, which looks exactly for the customconversions, that we currently missing.
But this means we do 2 custom conversions. Why 2? Why not arbitrary many?
This resolves the issue at hand, but in an ad hoc way, which feels very wrong. I still feel like I/we are doing something wrong with these conversions.
The problem here is:
Given an
AggregateReference<E, C>
withE
an entity andC
a type for which a write converter is regsitered, we currently determineC
as the target type of the conversion. With this information we call theAggregateReference
converter, which extracts the id value and determines it is done, because the result is of the desired target type.This is demonstrated by the failing new unit test.
The integration test is fixed by just slapping a
getPotentiallyConvertedSimpleWrite
on the already converted type, which looks exactly for the customconversions, that we currently missing.But this means we do 2 custom conversions. Why 2? Why not arbitrary many?