Compare commits
2 Commits
24225862f2
...
924219a992
Author | SHA1 | Date | |
---|---|---|---|
|
924219a992 | ||
|
c08bddacda |
@ -43,14 +43,6 @@ public class BookingItemCreatedEventEntity {
|
|||||||
@Column(name = "statusmessage")
|
@Column(name = "statusmessage")
|
||||||
private String statusMessage;
|
private String statusMessage;
|
||||||
|
|
||||||
@Setter
|
|
||||||
@Column
|
|
||||||
private boolean completed;
|
|
||||||
|
|
||||||
public void setBookingItem(HsBookingItemRealEntity bookingItem) {
|
|
||||||
this.bookingItem = bookingItem;
|
|
||||||
}
|
|
||||||
|
|
||||||
public BookingItemCreatedEventEntity(
|
public BookingItemCreatedEventEntity(
|
||||||
@NotNull final HsBookingItemRealEntity newBookingItem,
|
@NotNull final HsBookingItemRealEntity newBookingItem,
|
||||||
final String assetJson) {
|
final String assetJson) {
|
||||||
|
@ -33,8 +33,12 @@ public class HsBookingItemCreatedListener implements ApplicationListener<Booking
|
|||||||
case DOMAIN_SETUP -> new DomainSetupHostingAssetFactory(emw, newBookingItemRealEntity, asset, standardMapper);
|
case DOMAIN_SETUP -> new DomainSetupHostingAssetFactory(emw, newBookingItemRealEntity, asset, standardMapper);
|
||||||
};
|
};
|
||||||
if (factory != null) {
|
if (factory != null) {
|
||||||
event.getEntity().setStatusMessage(factory.performSaveProcess());
|
final var statusMessage = factory.performSaveProcess();
|
||||||
emw.persist(event.getEntity()); // TODO.impl: once we implement retry, we might need merge
|
// 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());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -40,8 +40,7 @@ create table if not exists hs_booking.item_created_event
|
|||||||
bookingItemUuid uuid unique references hs_booking.item (uuid),
|
bookingItemUuid uuid unique references hs_booking.item (uuid),
|
||||||
version int not null default 0,
|
version int not null default 0,
|
||||||
assetJson text,
|
assetJson text,
|
||||||
statusMessage text,
|
statusMessage text
|
||||||
completed boolean not null default false
|
|
||||||
);
|
);
|
||||||
--//
|
--//
|
||||||
|
|
||||||
|
@ -64,6 +64,7 @@ public class ArchitectureTest {
|
|||||||
"..hs.booking.item.validators",
|
"..hs.booking.item.validators",
|
||||||
"..hs.hosting.asset",
|
"..hs.hosting.asset",
|
||||||
"..hs.hosting.asset.validators",
|
"..hs.hosting.asset.validators",
|
||||||
|
"..hs.hosting.asset.factories",
|
||||||
"..errors",
|
"..errors",
|
||||||
"..mapper",
|
"..mapper",
|
||||||
"..ping",
|
"..ping",
|
||||||
|
@ -264,8 +264,7 @@ class HsBookingItemControllerAcceptanceTest extends ContextBasedTestWithCleanup
|
|||||||
.map(HsHostingAsset::getParentAsset)
|
.map(HsHostingAsset::getParentAsset)
|
||||||
.isEqualTo(domainSetupHostingAsset);
|
.isEqualTo(domainSetupHostingAsset);
|
||||||
final var event = bookingItemCreationEventRepo.findByBookingItem(newBookingItem);
|
final var event = bookingItemCreationEventRepo.findByBookingItem(newBookingItem);
|
||||||
assertThat(event.isCompleted());
|
assertThat(event).isNull();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
Loading…
Reference in New Issue
Block a user