add DomainSetup-HostingAssets for new BookingItem via created-event #111

Merged
hsh-michaelhoennig merged 31 commits from add-hsoting-asset-to-booking-item-resource-and-created-event into master 2024-10-08 11:48:35 +02:00
5 changed files with 7 additions and 18 deletions
Showing only changes of commit f132f4d293 - Show all commits

View File

@ -146,7 +146,7 @@ public class HsBookingItemController implements HsBookingItemsApi {
try {
final var bookingItemRealEntity = em.getReference(HsBookingItemRealEntity.class, saveProcessor.getEntity().getUuid());
applicationEventPublisher.publishEvent(new BookingItemCreatedAppEvent(
this, bookingItemRealEntity, jsonMapper.writeValueAsString(body.getAsset())));
this, bookingItemRealEntity, jsonMapper.writeValueAsString(body.getHostingAsset())));
} catch (JsonProcessingException e) {
throw new RuntimeException(e);
}

View File

@ -132,7 +132,7 @@ public class DomainSetupHostingAssetFactory extends HostingAssetFactory {
final var expectedSubAssetResource = new HsHostingAssetSubInsertResource();
expectedSubAssetResource.setType(givenSubAssetResource.getType());
if ( !convert.from(givenSubAssetResource).equals(convert.from(expectedSubAssetResource)) ) {
throw new ValidationException("sub asset " + givenSubAssetResource.getType() + " is over-specified, in compatibilty mode, only default values allowed");
throw new ValidationException("sub asset " + givenSubAssetResource.getType() + " is over-specified, in compatibility mode, only default values allowed");
hsh-michaelhoennig marked this conversation as resolved Outdated

i fehlt in compatibility mode

i fehlt in compatibility mode
}
}

View File

@ -62,17 +62,6 @@ components:
nullable: false
type:
$ref: '#/components/schemas/HsBookingItemType'
identifier:
type: string
minLength: 3
maxLength: 80
nullable: false
description: only used as a default value for automatically created hosting assets, not part of the booking item
assignedToHostingAssetUuid:
type: string
format: uuid
nullable: false
description: only used as a default value for automatically created hosting assets, not part of the booking item
caption:
hsh-michaelhoennig marked this conversation as resolved Outdated

identifier muss wieder raus

identifier muss wieder raus
type: string
minLength: 3
@ -84,7 +73,7 @@ components:
nullable: true
resources:
$ref: '#/components/schemas/BookingResources'
asset:
hostingAsset:
$ref: '../hs-hosting/hs-hosting-asset-schemas.yaml#/components/schemas/HsHostingAssetAutoInsert'
required:
- caption

View File

@ -208,7 +208,7 @@ class HsBookingItemControllerAcceptanceTest extends ContextBasedTestWithCleanup
"SSD": 25,
"Traffic": 250
},
"asset": {
"hostingAsset": {
"type": "MANAGED_WEBSPACE",
"identifier": "fir00"
}
@ -277,7 +277,7 @@ class HsBookingItemControllerAcceptanceTest extends ContextBasedTestWithCleanup
"domainName": "example.org",
"verificationCode": "just-a-fake-verification-code"
},
"asset": { // FIXME: rename to hostingAsset
"hostingAsset": {
"identifier": "example.org", // also as default for all subAssets
"subHostingAssets": [
{
@ -367,7 +367,7 @@ class HsBookingItemControllerAcceptanceTest extends ContextBasedTestWithCleanup
"domainName": "example.org",
"verificationCode": "just-a-fake-verification-code"
},
"asset": { // FIXME: rename to hostingAsset
"hostingAsset": {
"identifier": "example.org", // also as default for all subAssets
"subHostingAssets": [
{

View File

@ -502,7 +502,7 @@ public abstract class BaseOfficeDataImport extends CsvDataImport {
// this happens if a natural person is marked as 'contractual' for itself
final var idsToRemove = new HashSet<Integer>();
relations.forEach((id, r) -> {
if (r.getType() == HsOfficeRelationType.REPRESENTATIVE && r.getHolder() == r.getAnchor()) {
if (r.getHolder() == r.getAnchor()) {
hsh-michaelhoennig marked this conversation as resolved Outdated

revert, siehe zukünftiger PR

revert, siehe zukünftiger PR
idsToRemove.add(id);
}
});