Compare commits

...

2 Commits

Author SHA1 Message Date
Michael Hoennig
924219a992 remove completed flag from hs_booking.item_created_event 2024-10-01 10:57:49 +02:00
Michael Hoennig
c08bddacda fix architecture test 2024-10-01 10:30:41 +02:00
5 changed files with 9 additions and 14 deletions

View File

@ -43,14 +43,6 @@ public class BookingItemCreatedEventEntity {
@Column(name = "statusmessage")
private String statusMessage;
@Setter
@Column
private boolean completed;
public void setBookingItem(HsBookingItemRealEntity bookingItem) {
this.bookingItem = bookingItem;
}
public BookingItemCreatedEventEntity(
@NotNull final HsBookingItemRealEntity newBookingItem,
final String assetJson) {

View File

@ -33,8 +33,12 @@ public class HsBookingItemCreatedListener implements ApplicationListener<Booking
case DOMAIN_SETUP -> new DomainSetupHostingAssetFactory(emw, newBookingItemRealEntity, asset, standardMapper);
};
if (factory != null) {
event.getEntity().setStatusMessage(factory.performSaveProcess());
emw.persist(event.getEntity()); // TODO.impl: once we implement retry, we might need merge
final var statusMessage = factory.performSaveProcess();
// TODO.impl: once we implement retry, we need to amend this code (persist/merge/delete)
if (statusMessage != null) {
event.getEntity().setStatusMessage(statusMessage);
emw.persist(event.getEntity());
}
}
}
}

View File

@ -40,8 +40,7 @@ create table if not exists hs_booking.item_created_event
bookingItemUuid uuid unique references hs_booking.item (uuid),
version int not null default 0,
assetJson text,
statusMessage text,
completed boolean not null default false
statusMessage text
);
--//

View File

@ -64,6 +64,7 @@ public class ArchitectureTest {
"..hs.booking.item.validators",
"..hs.hosting.asset",
"..hs.hosting.asset.validators",
"..hs.hosting.asset.factories",
"..errors",
"..mapper",
"..ping",

View File

@ -264,8 +264,7 @@ class HsBookingItemControllerAcceptanceTest extends ContextBasedTestWithCleanup
.map(HsHostingAsset::getParentAsset)
.isEqualTo(domainSetupHostingAsset);
final var event = bookingItemCreationEventRepo.findByBookingItem(newBookingItem);
assertThat(event.isCompleted());
assertThat(event).isNull();
}
@Test