diff --git a/src/main/java/net/hostsharing/hsadminng/hs/office/coopassets/HsOfficeCoopAssetsTransactionController.java b/src/main/java/net/hostsharing/hsadminng/hs/office/coopassets/HsOfficeCoopAssetsTransactionController.java index 8095c96e..4ab26f49 100644 --- a/src/main/java/net/hostsharing/hsadminng/hs/office/coopassets/HsOfficeCoopAssetsTransactionController.java +++ b/src/main/java/net/hostsharing/hsadminng/hs/office/coopassets/HsOfficeCoopAssetsTransactionController.java @@ -128,9 +128,9 @@ public class HsOfficeCoopAssetsTransactionController implements HsOfficeCoopAsse } final BiConsumer RESOURCE_TO_ENTITY_POSTMAPPER = (resource, entity) -> { - if ( resource.getReverseEntryUuid() != null ) { - entity.setRevertedAssetTx(coopAssetsTransactionRepo.findByUuid(resource.getReverseEntryUuid()) - .orElseThrow(() -> new EntityNotFoundException("ERROR: [400] reverseEntityUuid %s not found".formatted(resource.getReverseEntryUuid())))); + if ( resource.getRevertedAssetTxUuid() != null ) { + entity.setRevertedAssetTx(coopAssetsTransactionRepo.findByUuid(resource.getRevertedAssetTxUuid()) + .orElseThrow(() -> new EntityNotFoundException("ERROR: [400] reverseEntityUuid %s not found".formatted(resource.getRevertedAssetTxUuid())))); } }; }; diff --git a/src/main/resources/api-definition/hs-office/hs-office-coopassets-schemas.yaml b/src/main/resources/api-definition/hs-office/hs-office-coopassets-schemas.yaml index cb3a9eb5..30725a82 100644 --- a/src/main/resources/api-definition/hs-office/hs-office-coopassets-schemas.yaml +++ b/src/main/resources/api-definition/hs-office/hs-office-coopassets-schemas.yaml @@ -80,7 +80,7 @@ components: maxLength: 48 comment: type: string - reverseEntry.uuid: # FIXME: rename to revertedAssetTx + revertedAssetTx.uuid: type: string format: uuid required: diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/coopassets/HsOfficeCoopAssetsTransactionControllerAcceptanceTest.java b/src/test/java/net/hostsharing/hsadminng/hs/office/coopassets/HsOfficeCoopAssetsTransactionControllerAcceptanceTest.java index 53067d45..0caafbab 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/office/coopassets/HsOfficeCoopAssetsTransactionControllerAcceptanceTest.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/office/coopassets/HsOfficeCoopAssetsTransactionControllerAcceptanceTest.java @@ -243,7 +243,7 @@ class HsOfficeCoopAssetsTransactionControllerAcceptanceTest extends ContextBased "valueDate": "2022-10-30", "reference": "test ref reversal", "comment": "some coop assets reversal transaction", - "reverseEntry.uuid": "%s" + "revertedAssetTx.uuid": "%s" } """.formatted( givenMembership.getUuid(), diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/coopassets/HsOfficeCoopAssetsTransactionEntityUnitTest.java b/src/test/java/net/hostsharing/hsadminng/hs/office/coopassets/HsOfficeCoopAssetsTransactionEntityUnitTest.java index 0e6606c2..96a0edfb 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/office/coopassets/HsOfficeCoopAssetsTransactionEntityUnitTest.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/office/coopassets/HsOfficeCoopAssetsTransactionEntityUnitTest.java @@ -41,7 +41,7 @@ class HsOfficeCoopAssetsTransactionEntityUnitTest { } @Test - void toStringWithReverseEntryContainsReverseEntry() { + void toStringWithRevertedAssetTxContainsRevertedAssetTx() { givenCoopAssetTransaction.setRevertedAssetTx(givenCoopAssetReversalTransaction); final var result = givenCoopAssetTransaction.toString(); diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/coopshares/HsOfficeCoopSharesTransactionEntityUnitTest.java b/src/test/java/net/hostsharing/hsadminng/hs/office/coopshares/HsOfficeCoopSharesTransactionEntityUnitTest.java index 3ec158f4..6394a8d7 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/office/coopshares/HsOfficeCoopSharesTransactionEntityUnitTest.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/office/coopshares/HsOfficeCoopSharesTransactionEntityUnitTest.java @@ -40,7 +40,7 @@ class HsOfficeCoopSharesTransactionEntityUnitTest { } @Test - void toStringWithReverseEntryContainsReverseEntry() { + void toStringWithRevertedAssetTxContainsRevertedAssetTx() { givenCoopSharesTransaction.setRevertedShareTx(givenCoopShareReversalTransaction); final var result = givenCoopSharesTransaction.toString();