hosting-asset-data-migration #79

Merged
hsh-michaelhoennig merged 22 commits from hosting-asset-data-migration into master 2024-07-22 11:30:34 +02:00
2 changed files with 11 additions and 3 deletions
Showing only changes of commit 7daf57513e - Show all commits

View File

@ -253,7 +253,7 @@ class Record {
Integer getInteger(final String columnName) {
final String value = getString(columnName);
return isNotBlank(value) ? Integer.parseInt(value.trim()) : 0;
return isNotBlank(value) ? Integer.parseInt(value.trim()) : null;
}
BigDecimal getBigDecimal(final String columnName) {

View File

@ -353,8 +353,12 @@ public class ImportHostingAssets extends ImportOfficeData {
final var created = rec.getLocalDate("created");
final var cancelled = rec.getLocalDate("cancelled");
final var cur_inet_addr_id = rec.getInteger("cur_inet_addr_id");
final var old_inet_addr_id = rec.getInteger("old_inet_addr_id"); // FIXME: assert that null
final var free = rec.getBoolean("free"); // FIXME: assert that "free webspace => in customer managed server", otherwise ignore
final var old_inet_addr_id = rec.getInteger("old_inet_addr_id");
final var free = rec.getBoolean("free");
assertThat(old_inet_addr_id)
.as("packet.old_inet_addr_id not supported, but is not null for " + packet_name)
.isNull();
final var biType = determineBiType(basepacket_code);
final var bookingItem = HsBookingItemEntity.builder()
@ -366,6 +370,10 @@ public class ImportHostingAssets extends ImportOfficeData {
bookingItems.put(PACKET_ID_OFFSET + packet_id, bookingItem);
final var haType = determineHaType(basepacket_code);
assertThat(!free || haType == MANAGED_WEBSPACE || bookingItem.getRelatedProject().getDebitor().getDefaultPrefix().equals("hsh"))
.as("packet.free only supported for Hostsharing-Assets and ManagedWebspace in customer-ManagedServer, but is set for " + packet_name)
.isTrue();
final var asset = HsHostingAssetEntity.builder()
.isLoaded(haType == MANAGED_WEBSPACE) // this turns off identifier validation to accept former default prefixes
.type(haType)