diff --git a/src/main/java/org/gridsuite/studyconfig/server/dto/SpreadsheetConfigInfos.java b/src/main/java/org/gridsuite/studyconfig/server/dto/SpreadsheetConfigInfos.java index 981a2fa..6a8397d 100644 --- a/src/main/java/org/gridsuite/studyconfig/server/dto/SpreadsheetConfigInfos.java +++ b/src/main/java/org/gridsuite/studyconfig/server/dto/SpreadsheetConfigInfos.java @@ -33,5 +33,8 @@ public record SpreadsheetConfigInfos( List columns, @Schema(description = "Global filters") - List globalFilters + List globalFilters, + + @Schema(description = "List of node aliases") + List nodeAliases ) { } diff --git a/src/main/java/org/gridsuite/studyconfig/server/entities/SpreadsheetConfigEntity.java b/src/main/java/org/gridsuite/studyconfig/server/entities/SpreadsheetConfigEntity.java index aa9309d..7bbd872 100644 --- a/src/main/java/org/gridsuite/studyconfig/server/entities/SpreadsheetConfigEntity.java +++ b/src/main/java/org/gridsuite/studyconfig/server/entities/SpreadsheetConfigEntity.java @@ -49,4 +49,7 @@ public class SpreadsheetConfigEntity { @Builder.Default private List globalFilters = new ArrayList<>(); + @ElementCollection(fetch = FetchType.EAGER) + @CollectionTable(name = "config_node_aliases", foreignKey = @ForeignKey(name = "fk_spreadsheet_config_node_aliases")) + private List nodeAliases; } diff --git a/src/main/java/org/gridsuite/studyconfig/server/mapper/SpreadsheetConfigMapper.java b/src/main/java/org/gridsuite/studyconfig/server/mapper/SpreadsheetConfigMapper.java index 1c008ff..2cabc9d 100644 --- a/src/main/java/org/gridsuite/studyconfig/server/mapper/SpreadsheetConfigMapper.java +++ b/src/main/java/org/gridsuite/studyconfig/server/mapper/SpreadsheetConfigMapper.java @@ -14,6 +14,8 @@ import org.gridsuite.studyconfig.server.entities.GlobalFilterEntity; import org.gridsuite.studyconfig.server.entities.SpreadsheetConfigEntity; +import java.util.ArrayList; + /** * @author Achour BERRAHMA */ @@ -32,7 +34,8 @@ public static SpreadsheetConfigInfos toDto(SpreadsheetConfigEntity entity) { .toList(), entity.getGlobalFilters().stream() .map(SpreadsheetConfigMapper::toGlobalFilterDto) - .toList() + .toList(), + entity.getNodeAliases() ); } @@ -45,7 +48,9 @@ public static SpreadsheetConfigEntity toEntity(SpreadsheetConfigInfos dto) { .name(dto.name()) .sheetType(dto.sheetType()) .build(); - + if (dto.nodeAliases() != null) { + entity.setNodeAliases(new ArrayList<>(dto.nodeAliases())); + } if (dto.columns() != null) { entity.setColumns(dto.columns().stream() .map(SpreadsheetConfigMapper::toColumnEntity) diff --git a/src/main/java/org/gridsuite/studyconfig/server/service/SpreadsheetConfigService.java b/src/main/java/org/gridsuite/studyconfig/server/service/SpreadsheetConfigService.java index 6018c24..15feb10 100644 --- a/src/main/java/org/gridsuite/studyconfig/server/service/SpreadsheetConfigService.java +++ b/src/main/java/org/gridsuite/studyconfig/server/service/SpreadsheetConfigService.java @@ -63,6 +63,9 @@ private SpreadsheetConfigEntity duplicateSpreadsheetConfigEntity(UUID id) { .name(entity.getName()) .sheetType(entity.getSheetType()) .build(); + if (entity.getNodeAliases() != null) { + duplicate.setNodeAliases(new ArrayList<>(entity.getNodeAliases())); + } List columns = entity.getColumns().stream() .map(column -> ColumnEntity.builder() .name(column.getName()) @@ -123,6 +126,9 @@ public void updateSpreadsheetConfig(UUID id, SpreadsheetConfigInfos dto) { entity.setSheetType(dto.sheetType()); entity.setName(dto.name()); + if (dto.nodeAliases() != null) { + entity.setNodeAliases(new ArrayList<>(dto.nodeAliases())); + } entity.getColumns().clear(); if (dto.columns() != null) { entity.getColumns().addAll(dto.columns().stream() @@ -176,6 +182,8 @@ public UUID createSpreadsheetConfigCollectionFromConfigs(List configUuids) return clone; }) .toList()); + List allConfigsUniqueAliases = entity.getSpreadsheetConfigs().stream().map(SpreadsheetConfigEntity::getNodeAliases).flatMap(Collection::stream).collect(Collectors.toSet()).stream().toList(); + entity.setNodeAliases(new ArrayList<>(allConfigsUniqueAliases)); return spreadsheetConfigCollectionRepository.save(entity).getId(); } @@ -265,6 +273,9 @@ public UUID duplicateSpreadsheetConfigCollection(UUID id) { .name(config.getName()) .sheetType(config.getSheetType()) .build(); + if (config.getNodeAliases() != null) { + configDuplicate.setNodeAliases(new ArrayList<>(config.getNodeAliases())); + } configDuplicate.setColumns(config.getColumns().stream() .map(column -> ColumnEntity.builder() .name(column.getName()) diff --git a/src/main/resources/db/changelog/changesets/changelog_20250619T162423Z.xml b/src/main/resources/db/changelog/changesets/changelog_20250619T162423Z.xml new file mode 100644 index 0000000..11db7c2 --- /dev/null +++ b/src/main/resources/db/changelog/changesets/changelog_20250619T162423Z.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/src/main/resources/db/changelog/db.changelog-master.yaml b/src/main/resources/db/changelog/db.changelog-master.yaml index 176617f..5f2c487 100644 --- a/src/main/resources/db/changelog/db.changelog-master.yaml +++ b/src/main/resources/db/changelog/db.changelog-master.yaml @@ -59,3 +59,6 @@ databaseChangeLog: - include: file: changesets/changelog_20250616T090000Z.xml relativeToChangelogFile: true + - include: + file: changesets/changelog_20250619T162423Z.xml + relativeToChangelogFile: true diff --git a/src/test/java/org/gridsuite/studyconfig/server/DtoConverterTest.java b/src/test/java/org/gridsuite/studyconfig/server/DtoConverterTest.java index 5f09418..7a301db 100644 --- a/src/test/java/org/gridsuite/studyconfig/server/DtoConverterTest.java +++ b/src/test/java/org/gridsuite/studyconfig/server/DtoConverterTest.java @@ -109,7 +109,8 @@ void testConversionToEntityOfSpreadsheetConfig() { ), List.of( GlobalFilterInfos.builder().uuid(filterId).filterType("country").label("GlobalFilter1").recent(false).build() - ) + ), + List.of() ); SpreadsheetConfigEntity entity = SpreadsheetConfigMapper.toEntity(dto); diff --git a/src/test/java/org/gridsuite/studyconfig/server/SpreadsheetConfigCollectionIntegrationTest.java b/src/test/java/org/gridsuite/studyconfig/server/SpreadsheetConfigCollectionIntegrationTest.java index 987bcf6..f169744 100644 --- a/src/test/java/org/gridsuite/studyconfig/server/SpreadsheetConfigCollectionIntegrationTest.java +++ b/src/test/java/org/gridsuite/studyconfig/server/SpreadsheetConfigCollectionIntegrationTest.java @@ -26,6 +26,7 @@ import org.springframework.test.web.servlet.MvcResult; import java.util.*; +import java.util.stream.Collectors; import static org.assertj.core.api.Assertions.assertThat; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.*; @@ -233,18 +234,31 @@ void testDuplicateCollection() throws Exception { @Test void testMergeModelsIntoNewCollection() throws Exception { - // create a first collection with 2 configs - SpreadsheetConfigCollectionInfos collectionToCreate = new SpreadsheetConfigCollectionInfos(null, createSpreadsheetConfigs(), null); - UUID collectionUuid = postSpreadsheetConfigCollection(collectionToCreate); - List configIds = getSpreadsheetConfigCollection(collectionUuid).spreadsheetConfigs().stream().map(SpreadsheetConfigInfos::id).toList(); - assertThat(configIds).hasSize(2); - // create a second collection duplicating + merging these existing Configs - UUID mergedCollectionUuid = postMergeSpreadsheetConfigsIntoCollection(configIds); - List duplicatedConfigIds = getSpreadsheetConfigCollection(mergedCollectionUuid).spreadsheetConfigs().stream().map(SpreadsheetConfigInfos::id).toList(); + // create a source collection to create N configs + SpreadsheetConfigCollectionInfos sourceCollection = new SpreadsheetConfigCollectionInfos(null, createSpreadsheetConfigsWithAliases(), List.of("sourceAlias")); + UUID collectionUuid = postSpreadsheetConfigCollection(sourceCollection); + List sourceConfigs = getSpreadsheetConfigCollection(collectionUuid).spreadsheetConfigs(); + List configIds = sourceConfigs.stream().map(SpreadsheetConfigInfos::id).toList(); + // create a second collection, duplicating and merging these N source Configs + UUID mergedCollectionUuid = postMergeSpreadsheetConfigsIntoCollection(configIds); assertThat(mergedCollectionUuid).isNotEqualTo(collectionUuid); + + SpreadsheetConfigCollectionInfos mergedCollection = getSpreadsheetConfigCollection(mergedCollectionUuid); + List duplicatedConfigIds = mergedCollection.spreadsheetConfigs().stream().map(SpreadsheetConfigInfos::id).toList(); assertThat(duplicatedConfigIds).hasSameSizeAs(configIds); assertThat(duplicatedConfigIds.stream().sorted().toList()).isNotEqualTo(configIds.stream().sorted().toList()); + + // dont compare aliases, merged collection aliases are computed + assertThat(mergedCollection) + .usingRecursiveComparison() + .ignoringFields("id", "nodeAliases", "spreadsheetConfigs.columns.uuid", "spreadsheetConfigs.id") + .ignoringExpectedNullFields() + .isEqualTo(sourceCollection); + + // merged aliases must be unique + List expectedUniqueAliases = sourceConfigs.stream().map(SpreadsheetConfigInfos::nodeAliases).flatMap(Collection::stream).collect(Collectors.toSet()).stream().toList(); + assertThat(mergedCollection.nodeAliases()).isEqualTo(expectedUniqueAliases); } @Test @@ -267,7 +281,7 @@ void testAddSpreadsheetConfigToCollection() throws Exception { List columnInfos = List.of( new ColumnInfos(null, "new_col", ColumnType.NUMBER, 1, "formula", "[\"dep\"]", "idNew", null, null, null, null, true) ); - SpreadsheetConfigInfos newConfig = new SpreadsheetConfigInfos(null, "NewSheet", SheetType.BATTERY, columnInfos, null); + SpreadsheetConfigInfos newConfig = new SpreadsheetConfigInfos(null, "NewSheet", SheetType.BATTERY, columnInfos, null, List.of()); String newConfigJson = mapper.writeValueAsString(newConfig); MvcResult mvcResult = mockMvc.perform(post(URI_SPREADSHEET_CONFIG_COLLECTION_BASE + "/" + collectionUuid + "/spreadsheet-configs") @@ -305,7 +319,7 @@ void testRemoveSpreadsheetConfigFromCollection() throws Exception { @Test void testAddSpreadsheetConfigToNonExistentCollection() throws Exception { UUID nonExistentUuid = UUID.randomUUID(); - SpreadsheetConfigInfos newConfig = new SpreadsheetConfigInfos(null, "TestSheet", SheetType.GENERATOR, List.of(), null); + SpreadsheetConfigInfos newConfig = new SpreadsheetConfigInfos(null, "TestSheet", SheetType.GENERATOR, List.of(), null, List.of()); String newConfigJson = mapper.writeValueAsString(newConfig); mockMvc.perform(post(URI_SPREADSHEET_CONFIG_COLLECTION_BASE + "/" + nonExistentUuid + "/spreadsheet-configs") @@ -400,6 +414,21 @@ void testReplaceAllSpreadsheetConfigs() throws Exception { .hasSize(sourceConfigIds.size()); } + private List createSpreadsheetConfigsWithAliases() { + List columnInfos = Arrays.asList( + new ColumnInfos(null, "cust_a", ColumnType.NUMBER, 1, "cust_b + cust_c", "[\"cust_b\", \"cust_c\"]", "idA", null, null, null, null, true), + new ColumnInfos(null, "cust_b", ColumnType.TEXT, null, "var_minP + 1", null, "idB", null, null, null, null, true) + ); + + return List.of( + new SpreadsheetConfigInfos(null, "TestSheet", SheetType.GENERATOR, columnInfos, null, List.of("a1", "a2")), + new SpreadsheetConfigInfos(null, "TestSheet1", SheetType.GENERATOR, columnInfos, null, List.of("a1", "a2", "a3")), + new SpreadsheetConfigInfos(null, "TestSheet2", SheetType.GENERATOR, columnInfos, null, List.of("a2", "a4")), + new SpreadsheetConfigInfos(null, "TestSheet3", SheetType.GENERATOR, columnInfos, null, List.of()), + new SpreadsheetConfigInfos(null, "TestSheet4", SheetType.GENERATOR, columnInfos, null, List.of("alias")) + ); + } + private List createSpreadsheetConfigs() { List columnInfos = Arrays.asList( new ColumnInfos(null, "cust_a", ColumnType.NUMBER, 1, "cust_b + cust_c", "[\"cust_b\", \"cust_c\"]", "idA", null, null, null, null, true), @@ -407,8 +436,8 @@ private List createSpreadsheetConfigs() { ); return List.of( - new SpreadsheetConfigInfos(null, "TestSheet", SheetType.GENERATOR, columnInfos, null), - new SpreadsheetConfigInfos(null, "TestSheet1", SheetType.GENERATOR, columnInfos, null) + new SpreadsheetConfigInfos(null, "TestSheet", SheetType.GENERATOR, columnInfos, null, List.of()), + new SpreadsheetConfigInfos(null, "TestSheet1", SheetType.GENERATOR, columnInfos, null, List.of()) ); } @@ -443,8 +472,8 @@ private List createSpreadsheetConfigsWithFilters() { ); return List.of( - new SpreadsheetConfigInfos(null, "TestSheet", SheetType.GENERATOR, columnsConfig1, globalFiltersConfig1), - new SpreadsheetConfigInfos(null, "TestSheet2", SheetType.LOAD, columnsConfig2, globalFiltersConfig2) + new SpreadsheetConfigInfos(null, "TestSheet", SheetType.GENERATOR, columnsConfig1, globalFiltersConfig1, List.of()), + new SpreadsheetConfigInfos(null, "TestSheet2", SheetType.LOAD, columnsConfig2, globalFiltersConfig2, List.of()) ); } @@ -457,9 +486,9 @@ private List createUpdatedSpreadsheetConfigs() { ); return List.of( - new SpreadsheetConfigInfos(null, "Generator", SheetType.GENERATOR, columnInfos, null), - new SpreadsheetConfigInfos(null, "TestSheet", SheetType.GENERATOR, columnInfos, null), - new SpreadsheetConfigInfos(null, "TestSheet (1)", SheetType.BATTERY, columnInfos, null) + new SpreadsheetConfigInfos(null, "Generator", SheetType.GENERATOR, columnInfos, null, List.of()), + new SpreadsheetConfigInfos(null, "TestSheet", SheetType.GENERATOR, columnInfos, null, List.of()), + new SpreadsheetConfigInfos(null, "TestSheet (1)", SheetType.BATTERY, columnInfos, null, List.of()) ); } @@ -500,9 +529,9 @@ private List createUpdatedSpreadsheetConfigsWithFilters( ); return List.of( - new SpreadsheetConfigInfos(null, "Updated1", SheetType.BATTERY, columnsConfig1, globalFiltersConfig1), - new SpreadsheetConfigInfos(null, "Updated2", SheetType.LINE, columnsConfig2, globalFiltersConfig2), - new SpreadsheetConfigInfos(null, "Added3", SheetType.BUS, columnsConfig3, globalFiltersConfig3) + new SpreadsheetConfigInfos(null, "Updated1", SheetType.BATTERY, columnsConfig1, globalFiltersConfig1, List.of()), + new SpreadsheetConfigInfos(null, "Updated2", SheetType.LINE, columnsConfig2, globalFiltersConfig2, List.of()), + new SpreadsheetConfigInfos(null, "Added3", SheetType.BUS, columnsConfig3, globalFiltersConfig3, List.of()) ); } diff --git a/src/test/java/org/gridsuite/studyconfig/server/SpreadsheetConfigIntegrationTest.java b/src/test/java/org/gridsuite/studyconfig/server/SpreadsheetConfigIntegrationTest.java index 6a9423c..25bb9cc 100644 --- a/src/test/java/org/gridsuite/studyconfig/server/SpreadsheetConfigIntegrationTest.java +++ b/src/test/java/org/gridsuite/studyconfig/server/SpreadsheetConfigIntegrationTest.java @@ -63,7 +63,7 @@ void tearDown() { @Test void testCreate() throws Exception { - SpreadsheetConfigInfos configToCreate = new SpreadsheetConfigInfos(null, "Battery", SheetType.BATTERY, createColumnsWithFilters(), createGlobalFilters()); + SpreadsheetConfigInfos configToCreate = new SpreadsheetConfigInfos(null, "Battery", SheetType.BATTERY, createColumnsWithFilters(), createGlobalFilters(), List.of("alias1", "alias2")); UUID configUuid = postSpreadsheetConfig(configToCreate); SpreadsheetConfigInfos createdConfig = getSpreadsheetConfig(configUuid); @@ -77,7 +77,7 @@ void testCreate() throws Exception { @Test void testCreateWithInvalidData() throws Exception { - SpreadsheetConfigInfos invalidConfig = new SpreadsheetConfigInfos(null, "Battery", null, createColumns(), null); + SpreadsheetConfigInfos invalidConfig = new SpreadsheetConfigInfos(null, "Battery", null, createColumns(), null, List.of()); String invalidConfigJson = mapper.writeValueAsString(invalidConfig); @@ -89,7 +89,7 @@ void testCreateWithInvalidData() throws Exception { @Test void testRead() throws Exception { - SpreadsheetConfigInfos configToRead = new SpreadsheetConfigInfos(null, "Battery", SheetType.BUS, createColumnsWithFilters(), createGlobalFilters()); + SpreadsheetConfigInfos configToRead = new SpreadsheetConfigInfos(null, "Battery", SheetType.BUS, createColumnsWithFilters(), createGlobalFilters(), List.of("alias")); UUID configUuid = saveAndReturnId(configToRead); @@ -104,7 +104,7 @@ void testRead() throws Exception { @Test void testGetMetadata() throws Exception { - SpreadsheetConfigInfos configToRead = new SpreadsheetConfigInfos(null, "Battery", SheetType.BUS, createColumnsWithFilters(), createGlobalFilters()); + SpreadsheetConfigInfos configToRead = new SpreadsheetConfigInfos(null, "Battery", SheetType.BUS, createColumnsWithFilters(), createGlobalFilters(), List.of()); UUID configUuid = saveAndReturnId(configToRead); @@ -137,11 +137,11 @@ void testReadNonExistent() throws Exception { @Test void testUpdateWithInvalidData() throws Exception { - SpreadsheetConfigInfos configToUpdate = new SpreadsheetConfigInfos(null, "Battery", SheetType.BATTERY, createColumnsWithFilters(), createGlobalFilters()); + SpreadsheetConfigInfos configToUpdate = new SpreadsheetConfigInfos(null, "Battery", SheetType.BATTERY, createColumnsWithFilters(), createGlobalFilters(), List.of()); UUID configUuid = saveAndReturnId(configToUpdate); - SpreadsheetConfigInfos invalidUpdate = new SpreadsheetConfigInfos(configUuid, "Test", null, createUpdatedColumns(), null); + SpreadsheetConfigInfos invalidUpdate = new SpreadsheetConfigInfos(configUuid, "Test", null, createUpdatedColumns(), null, List.of()); String invalidUpdateJson = mapper.writeValueAsString(invalidUpdate); @@ -153,11 +153,11 @@ void testUpdateWithInvalidData() throws Exception { @Test void testUpdate() throws Exception { - SpreadsheetConfigInfos configToUpdate = new SpreadsheetConfigInfos(null, "Battery", SheetType.BATTERY, createColumnsWithFilters(), createGlobalFilters()); + SpreadsheetConfigInfos configToUpdate = new SpreadsheetConfigInfos(null, "Battery", SheetType.BATTERY, createColumnsWithFilters(), createGlobalFilters(), List.of("alias1")); UUID configUuid = saveAndReturnId(configToUpdate); - SpreadsheetConfigInfos updatedConfig = new SpreadsheetConfigInfos(configUuid, "Bus", SheetType.BUS, createUpdatedColumnsWithFilters(), createUpdatedGlobalFilters()); + SpreadsheetConfigInfos updatedConfig = new SpreadsheetConfigInfos(configUuid, "Bus", SheetType.BUS, createUpdatedColumnsWithFilters(), createUpdatedGlobalFilters(), List.of("newAlias")); String updatedConfigJson = mapper.writeValueAsString(updatedConfig); @@ -176,7 +176,7 @@ void testUpdate() throws Exception { @Test void testDelete() throws Exception { - SpreadsheetConfigInfos configToDelete = new SpreadsheetConfigInfos(null, "Battery", SheetType.BATTERY, createColumnsWithFilters(), createGlobalFilters()); + SpreadsheetConfigInfos configToDelete = new SpreadsheetConfigInfos(null, "Battery", SheetType.BATTERY, createColumnsWithFilters(), createGlobalFilters(), List.of()); UUID configUuid = saveAndReturnId(configToDelete); @@ -198,8 +198,8 @@ void testDeleteNonExistent() throws Exception { @Test void testGetAll() throws Exception { - SpreadsheetConfigInfos config1 = new SpreadsheetConfigInfos(null, "Battery", SheetType.BATTERY, createColumnsWithFilters(), createGlobalFilters()); - SpreadsheetConfigInfos config2 = new SpreadsheetConfigInfos(null, "Bus", SheetType.BUS, createUpdatedColumnsWithFilters(), createUpdatedGlobalFilters()); + SpreadsheetConfigInfos config1 = new SpreadsheetConfigInfos(null, "Battery", SheetType.BATTERY, createColumnsWithFilters(), createGlobalFilters(), List.of()); + SpreadsheetConfigInfos config2 = new SpreadsheetConfigInfos(null, "Bus", SheetType.BUS, createUpdatedColumnsWithFilters(), createUpdatedGlobalFilters(), List.of()); saveAndReturnId(config1); saveAndReturnId(config2); @@ -211,7 +211,7 @@ void testGetAll() throws Exception { @Test void testDuplicate() throws Exception { - SpreadsheetConfigInfos configToCreate = new SpreadsheetConfigInfos(null, "Battery", SheetType.BATTERY, createColumnsWithFilters(), createGlobalFilters()); + SpreadsheetConfigInfos configToCreate = new SpreadsheetConfigInfos(null, "Battery", SheetType.BATTERY, createColumnsWithFilters(), createGlobalFilters(), List.of("alias1,", "alias2")); UUID configUuid = postSpreadsheetConfig(configToCreate); UUID duplicatedConfigUuid = duplicateSpreadsheetConfig(configUuid); @@ -235,7 +235,7 @@ void testDuplicateNonExistent() throws Exception { @Test void testCreateColumn() throws Exception { - SpreadsheetConfigInfos config = new SpreadsheetConfigInfos(null, "Battery", SheetType.BATTERY, List.of(), null); + SpreadsheetConfigInfos config = new SpreadsheetConfigInfos(null, "Battery", SheetType.BATTERY, List.of(), null, List.of()); UUID configId = saveAndReturnId(config); ColumnInfos columnToCreate = new ColumnInfos(null, "new_column", ColumnType.NUMBER, 2, "x + 1", "[\"x\"]", "newId", null, null, null, null, true); @@ -274,7 +274,7 @@ void testCreateColumn() throws Exception { @Test void testUpdateColumn() throws Exception { - SpreadsheetConfigInfos config = new SpreadsheetConfigInfos(null, "Battery", SheetType.BATTERY, createColumns(), null); + SpreadsheetConfigInfos config = new SpreadsheetConfigInfos(null, "Battery", SheetType.BATTERY, createColumns(), null, List.of()); UUID configId = saveAndReturnId(config); SpreadsheetConfigInfos savedConfig = getSpreadsheetConfig(configId); @@ -294,7 +294,7 @@ void testUpdateColumn() throws Exception { @Test void testDeleteColumn() throws Exception { - SpreadsheetConfigInfos config = new SpreadsheetConfigInfos(null, "Battery", SheetType.BATTERY, createColumns(), null); + SpreadsheetConfigInfos config = new SpreadsheetConfigInfos(null, "Battery", SheetType.BATTERY, createColumns(), null, List.of()); UUID configId = saveAndReturnId(config); SpreadsheetConfigInfos savedConfig = getSpreadsheetConfig(configId); @@ -312,7 +312,7 @@ void testDeleteColumn() throws Exception { @Test void testGetColumn() throws Exception { - SpreadsheetConfigInfos config = new SpreadsheetConfigInfos(null, "Battery", SheetType.BATTERY, createColumns(), null); + SpreadsheetConfigInfos config = new SpreadsheetConfigInfos(null, "Battery", SheetType.BATTERY, createColumns(), null, List.of()); UUID configId = saveAndReturnId(config); SpreadsheetConfigInfos savedConfig = getSpreadsheetConfig(configId); @@ -325,7 +325,7 @@ void testGetColumn() throws Exception { @Test void testReorderColumns() throws Exception { - SpreadsheetConfigInfos config = new SpreadsheetConfigInfos(null, "ReorderTest", SheetType.BATTERY, createColumns(), null); + SpreadsheetConfigInfos config = new SpreadsheetConfigInfos(null, "ReorderTest", SheetType.BATTERY, createColumns(), null, List.of()); UUID configId = saveAndReturnId(config); // get the saved config to retrieve column UUIDs @@ -365,7 +365,7 @@ void testUpdateColumnStates() throws Exception { new ColumnInfos(null, "col3", ColumnType.BOOLEAN, null, "formula3", null, "id3", null, null, null, null, false) ); - SpreadsheetConfigInfos config = new SpreadsheetConfigInfos(null, "TestConfig", SheetType.BATTERY, columns, null); + SpreadsheetConfigInfos config = new SpreadsheetConfigInfos(null, "TestConfig", SheetType.BATTERY, columns, null, List.of()); UUID configId = saveAndReturnId(config); // Get the saved config to retrieve column UUIDs @@ -409,7 +409,7 @@ void testUpdateColumnStates() throws Exception { @Test void testUpdateColumnStatesInvalidColumn() throws Exception { - SpreadsheetConfigInfos config = new SpreadsheetConfigInfos(null, "TestConfig", SheetType.BATTERY, createColumns(), null); + SpreadsheetConfigInfos config = new SpreadsheetConfigInfos(null, "TestConfig", SheetType.BATTERY, createColumns(), null, List.of()); UUID configId = saveAndReturnId(config); UUID nonExistentColumnId = UUID.randomUUID(); @@ -438,7 +438,7 @@ void testUpdateColumnStatesNonExistentConfig() throws Exception { @Test void testUpdateColumnStatesWithInvalidData() throws Exception { - SpreadsheetConfigInfos config = new SpreadsheetConfigInfos(null, "TestConfig", SheetType.BATTERY, createColumns(), null); + SpreadsheetConfigInfos config = new SpreadsheetConfigInfos(null, "TestConfig", SheetType.BATTERY, createColumns(), null, List.of()); UUID configId = saveAndReturnId(config); // Missing required fields (columnId and visible are null) @@ -452,7 +452,7 @@ void testUpdateColumnStatesWithInvalidData() throws Exception { @Test void testRenameSpreadsheetConfig() throws Exception { - SpreadsheetConfigInfos configToRename = new SpreadsheetConfigInfos(null, "OriginalName", SheetType.BATTERY, createColumns(), List.of()); + SpreadsheetConfigInfos configToRename = new SpreadsheetConfigInfos(null, "OriginalName", SheetType.BATTERY, createColumns(), List.of(), List.of()); UUID configUuid = saveAndReturnId(configToRename); String newName = "RenamedConfig"; @@ -483,7 +483,7 @@ void testRenameNonExistentSpreadsheetConfig() throws Exception { void testSetGlobalFiltersForSpreadsheetConfig() throws Exception { // Create a spreadsheet config with existing global filters SpreadsheetConfigInfos configWithFilters = new SpreadsheetConfigInfos( - null, "ConfigWithFilters", SheetType.BATTERY, createColumns(), createGlobalFilters()); + null, "ConfigWithFilters", SheetType.BATTERY, createColumns(), createGlobalFilters(), List.of()); UUID configId = saveAndReturnId(configWithFilters); // Initial config should have two filters