coop-shares-transaction-reverse-entry #40

Merged
hsh-marcsandlus merged 3 commits from coop-shares-transaction-reverse-entry into master 2024-04-12 11:29:27 +02:00
4 changed files with 9 additions and 9 deletions
Showing only changes of commit 0fda68e01b - Show all commits

View File

@ -136,9 +136,9 @@ public class HsOfficeCoopSharesTransactionController implements HsOfficeCoopShar
} }
final BiConsumer<HsOfficeCoopSharesTransactionInsertResource, HsOfficeCoopSharesTransactionEntity> RESOURCE_TO_ENTITY_POSTMAPPER = (resource, entity) -> { final BiConsumer<HsOfficeCoopSharesTransactionInsertResource, HsOfficeCoopSharesTransactionEntity> RESOURCE_TO_ENTITY_POSTMAPPER = (resource, entity) -> {
if ( resource.getReverseEntryUuid() != null ) { if ( resource.getAdjustedShareTxUuid() != null ) {
entity.setAdjustedShareTx(coopSharesTransactionRepo.findByUuid(resource.getReverseEntryUuid()) entity.setAdjustedShareTx(coopSharesTransactionRepo.findByUuid(resource.getAdjustedShareTxUuid())
.orElseThrow(() -> new EntityNotFoundException("ERROR: [400] reverseEntityUuid %s not found".formatted(resource.getReverseEntryUuid())))); .orElseThrow(() -> new EntityNotFoundException("ERROR: [400] adjustedShareTxUuid %s not found".formatted(resource.getAdjustedShareTxUuid()))));
} }
}; };
} }

View File

@ -73,7 +73,7 @@ components:
maxLength: 48 maxLength: 48
comment: comment:
type: string type: string
reverseEntryUuid: adjustedShareTxUuid:

adjustedShareTxUuid
auch bei Asset schauen

adjustedShareTxUuid auch bei Asset schauen
type: string type: string
format: uuid format: uuid
required: required:

View File

@ -227,7 +227,7 @@ class HsOfficeCoopSharesTransactionControllerAcceptanceTest extends ContextBased
"valueDate": "2022-10-30", "valueDate": "2022-10-30",
"reference": "test ref adjustment", "reference": "test ref adjustment",
"comment": "some coop shares adjustment transaction", "comment": "some coop shares adjustment transaction",
"reverseEntryUuid": "%s" "adjustedShareTxUuid": "%s"
} }
""".formatted( """.formatted(
givenMembership.getUuid(), givenMembership.getUuid(),

View File

@ -51,23 +51,23 @@ class HsOfficeCoopSharesTransactionEntityUnitTest {
} }
@Test @Test
void toShortStringContainsOnlyMemberNumberAndShareCountOnly() { void toShortStringContainsOnlyAbbreviatedString() {
final var result = givenCoopSharesTransaction.toShortString(); final var result = givenCoopSharesTransaction.toShortString();
assertThat(result).isEqualTo("M-1000101+4"); assertThat(result).isEqualTo("M-1000101:SUB:+4");
} }
@Test @Test
void toStringEmptyTransactionDoesNotThrowException() { void toStringEmptyTransactionDoesNotThrowException() {
final var result = givenEmptyCoopSharesTransaction.toString(); final var result = givenEmptyCoopSharesTransaction.toString();
assertThat(result).isEqualTo("CoopShareTransaction(0)"); assertThat(result).isEqualTo("CoopShareTransaction(null: 0)");
} }
@Test @Test
void toShortStringEmptyTransactionDoesNotThrowException() { void toShortStringEmptyTransactionDoesNotThrowException() {
final var result = givenEmptyCoopSharesTransaction.toShortString(); final var result = givenEmptyCoopSharesTransaction.toShortString();
assertThat(result).isEqualTo("null+0"); assertThat(result).isEqualTo("null:nul:+0");
} }
} }