implement coop-asset-TRANSFER-transaction reversal #125

Merged
hsh-michaelhoennig merged 7 commits from feature/implement-coop-asset-transaction-reversal into master 2024-11-28 07:10:36 +01:00
2 changed files with 6 additions and 2 deletions
Showing only changes of commit bc2ec8df5c - Show all commits

View File

@ -157,6 +157,7 @@ public class HsOfficeCoopAssetsTransactionController implements HsOfficeCoopAsse
}
}
// TODO.refa: this logic needs to get extracted to a service
final BiConsumer<HsOfficeCoopAssetsTransactionEntity, HsOfficeCoopAssetsTransactionResource> ENTITY_TO_RESOURCE_POSTMAPPER = (entity, resource) -> {
resource.setMembershipUuid(entity.getMembership().getUuid());
resource.setMembershipMemberNumber(entity.getMembership().getTaggedMemberNumber());
@ -209,6 +210,7 @@ public class HsOfficeCoopAssetsTransactionController implements HsOfficeCoopAsse
});
};
// TODO.refa: this logic needs to get extracted to a service
final BiConsumer<HsOfficeCoopAssetsTransactionInsertResource, HsOfficeCoopAssetsTransactionEntity> RESOURCE_TO_ENTITY_POSTMAPPER = (resource, entity) -> {
if (resource.getMembershipUuid() != null) {

View File

@ -65,9 +65,11 @@ class HsOfficeCoopAssetsTransactionControllerRestTest {
.memberNumberSuffix(suffixOf(AVAILABLE_TARGET_MEMBER_NUMBER))
.build();
// the following refs might change if impl changes
// The following refs depend on the implementation of the respective implementation and might change if it changes.
// The same TestUuidGenerator.ref(#) does NOT mean the UUIDs refer to the same entity,
// its rather coincidence because different test-cases have different execution paths in the production code.
private static final UUID NEW_EXPLICITLY_CREATED_REVERSAL_ASSET_TX_UUID = TestUuidGenerator.ref(4);
private static final UUID NEW_EXPLICITLY_CREATED_TRANSFER_ASSET_TX_UUID = TestUuidGenerator.ref(5);
private static final UUID NEW_EXPLICITLY_CREATED_TRANSFER_ASSET_TX_UUID = TestUuidGenerator.ref(4);
private static final UUID SOME_EXISTING_LOSS_ASSET_TX_UUID = TestUuidGenerator.use(3);
public final HsOfficeCoopAssetsTransactionEntity SOME_EXISTING_LOSS_ASSET_TX_ENTITY = HsOfficeCoopAssetsTransactionEntity.builder()