Skip to content

feat: add active and reactive power measurement to battery form#337

Merged
KoloMenek merged 2 commits into
mainfrom
marutk/feat/handle_battery_p_q_measurements_modification
May 21, 2026
Merged

feat: add active and reactive power measurement to battery form#337
KoloMenek merged 2 commits into
mainfrom
marutk/feat/handle_battery_p_q_measurements_modification

Conversation

@KoloMenek

Copy link
Copy Markdown
Member

PR Summary

@coderabbitai

coderabbitai Bot commented May 18, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 0cece53b-4d32-4b5d-87c0-656536a9a6f7

📥 Commits

Reviewing files that changed from the base of the PR and between b356054 and 33ac406.

📒 Files selected for processing (3)
  • src/main/java/org/gridsuite/network/map/dto/definition/battery/BatteryFormInfos.java
  • src/main/java/org/gridsuite/network/map/dto/mapper/BatteryInfosMapper.java
  • src/test/resources/batteries-map-data.json

📝 Walkthrough

Walkthrough

This PR extends battery form information to include power measurements. Two optional measurement fields (measurementP for active power, measurementQ for reactive power) are added to the DTO, mapped from extension data in the mapper, and validated through updated test resources.

Changes

Battery Power Measurements

Layer / File(s) Summary
Battery measurements contract
src/main/java/org/gridsuite/network/map/dto/definition/battery/BatteryFormInfos.java
MeasurementsInfos import is added, and two new optional fields measurementP and measurementQ are declared with @JsonInclude(NON_ABSENT) to include measurements only when present.
Measurement mapping and test validation
src/main/java/org/gridsuite/network/map/dto/mapper/BatteryInfosMapper.java, src/test/resources/batteries-map-data.json
Mapper populates measurementP from active power and measurementQ from reactive power via ExtensionUtils.toMeasurement(...). Test data is updated with sample measurement values (value/validity pairs) for BATTERY1 and BATTERY2.
🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ❓ Inconclusive The PR description is empty and provides no meaningful information about the changeset. Add a description explaining what was changed, why it was changed, and any relevant context for reviewers.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: adding active and reactive power measurement fields to the battery form DTO and mapper.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@KoloMenek KoloMenek requested a review from benrejebmoh May 20, 2026 07:35

@benrejebmoh benrejebmoh left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test OK
Code OK

@sonarqubecloud

Copy link
Copy Markdown

@KoloMenek KoloMenek merged commit f62b510 into main May 21, 2026
5 checks passed
@KoloMenek KoloMenek deleted the marutk/feat/handle_battery_p_q_measurements_modification branch May 21, 2026 09:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants