Skip to content

Commit 4985e1c

Browse files
committed
Add the NAD config uuid and the generation mode.
Signed-off-by: AAJELLAL <[email protected]>
1 parent 776424c commit 4985e1c

File tree

6 files changed

+22
-10
lines changed

6 files changed

+22
-10
lines changed

src/main/java/org/gridsuite/studyconfig/server/dto/NetworkAreaDiagramParamInfos.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,15 @@
77
package org.gridsuite.studyconfig.server.dto;
88

99
import io.swagger.v3.oas.annotations.media.Schema;
10+
import java.util.UUID;
1011

1112
/**
1213
* @author David BRAQUART <david.braquart at rte-france.com>
1314
*/
1415
@Schema(name = "NetworkAreaDiagramParamDto", description = "Network area diagram parameters")
1516
public record NetworkAreaDiagramParamInfos(
16-
17-
@Schema(description = "Initialize with geographical data")
18-
Boolean initNadWithGeoData
17+
@Schema(description = "The nad generation mode")
18+
String nadGenerationMode,
19+
@Schema(description = "The nad configuration uuid")
20+
UUID nadConfigUuid
1921
) { }

src/main/java/org/gridsuite/studyconfig/server/entities/NetworkVisualizationParamEntity.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
import lombok.Getter;
1313
import lombok.NoArgsConstructor;
1414
import lombok.Setter;
15+
1516
import java.util.UUID;
1617

1718
/**
@@ -58,6 +59,9 @@ public class NetworkVisualizationParamEntity {
5859
@Column(name = "component_library")
5960
private String componentLibrary = "";
6061

61-
@Column(name = "init_nad_with_geo_data")
62-
private Boolean initNadWithGeoData = true;
62+
@Column(name = "nad_generation_mode")
63+
private String nadGenerationMode = "GEOGRAPHICAL_COORDINATES";
64+
65+
@Column(name = "nad_config_uuid")
66+
private UUID nadConfigUuid;
6367
}

src/main/java/org/gridsuite/studyconfig/server/mapper/NetworkVisualizationParamMapper.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public static NetworkVisualizationParamInfos toDto(NetworkVisualizationParamEnti
3535
entity.getSubstationLayout(),
3636
entity.getComponentLibrary()
3737
),
38-
new NetworkAreaDiagramParamInfos(entity.getInitNadWithGeoData())
38+
new NetworkAreaDiagramParamInfos(entity.getNadGenerationMode(), entity.getNadConfigUuid())
3939
);
4040
}
4141

@@ -58,6 +58,7 @@ public static void updateEntity(NetworkVisualizationParamEntity entity, NetworkV
5858
entity.setSubstationLayout(dto.singleLineDiagramParameters().substationLayout());
5959
entity.setComponentLibrary(dto.singleLineDiagramParameters().componentLibrary());
6060
// NAD
61-
entity.setInitNadWithGeoData(dto.networkAreaDiagramParameters().initNadWithGeoData());
61+
entity.setNadConfigUuid(dto.networkAreaDiagramParameters().nadConfigUuid());
62+
entity.setNadGenerationMode(dto.networkAreaDiagramParameters().nadGenerationMode());
6263
}
6364
}

src/main/java/org/gridsuite/studyconfig/server/service/NetworkVisualizationsParamService.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ public UUID duplicateParameters(UUID id) {
5454
.substationLayout(entity.getSubstationLayout())
5555
.componentLibrary(entity.getComponentLibrary())
5656
// NAD
57-
.initNadWithGeoData(entity.getInitNadWithGeoData())
57+
.nadGenerationMode(entity.getNadGenerationMode())
58+
.nadConfigUuid(entity.getNadConfigUuid())
5859
.build();
5960
return repository.save(duplicate).getId();
6061
}

src/main/resources/db/changelog/db.changelog-master.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,3 +62,6 @@ databaseChangeLog:
6262
- include:
6363
file: changesets/changelog_20250619T162423Z.xml
6464
relativeToChangelogFile: true
65+
- include:
66+
file: changesets/changelog_20250723T155729Z.xml
67+
relativeToChangelogFile: true

src/test/java/org/gridsuite/studyconfig/server/NetworkVisualizationParamsIntegrationTest.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
class NetworkVisualizationParamsIntegrationTest {
3636

3737
private static final String URI_NETWORK_VISUALIZATION_PARAM_BASE = "/v1/network-visualizations-params";
38+
private static final String GEOGRAPHICAL_COORDINATES = "GEOGRAPHICAL_COORDINATES";
3839

3940
@Autowired
4041
private MockMvc mockMvc;
@@ -156,14 +157,14 @@ private NetworkVisualizationParamInfos createDto() {
156157
return new NetworkVisualizationParamInfos(null,
157158
new MapParamInfos(true, false, "flow", true, "base"),
158159
new SingleLineDiagramParamInfos(false, false, "layout", "lib"),
159-
new NetworkAreaDiagramParamInfos(true));
160+
new NetworkAreaDiagramParamInfos(GEOGRAPHICAL_COORDINATES, null));
160161
}
161162

162163
private NetworkVisualizationParamInfos createDtoForUpdate(UUID id) {
163164
return new NetworkVisualizationParamInfos(id,
164165
new MapParamInfos(false, true, "flow2", false, "base2"),
165166
new SingleLineDiagramParamInfos(true, true, "layout2", "lib2"),
166-
new NetworkAreaDiagramParamInfos(false));
167+
new NetworkAreaDiagramParamInfos(GEOGRAPHICAL_COORDINATES, null));
167168
}
168169

169170
private UUID saveAndReturnId(NetworkVisualizationParamInfos dto) {

0 commit comments

Comments
 (0)