Fix SAC by Tank Role#274
Merged
Merged
Conversation
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes the “SAC by Tank Role” statistic so it returns values in the unit implied by the user’s SAC setting (L/min vs bar/min), resolving the units mismatch described in #160.
Changes:
- Renamed the tank-role SAC method into a pressure-specific variant (
getSacPressureByTankRole). - Added a new volume-based tank-role SAC method (
getSacVolumeByTankRole). - Updated the stats provider and tests to use the correct method based on
sacUnit.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| test/features/statistics/data/repositories/statistics_repository_sac_test.dart | Splits SAC-by-role tests into volume-based and pressure-based coverage; volume tests now provide tank volume. |
| test/features/statistics/data/repositories/statistics_repository_error_test.dart | Updates error-handling expectations to include both new SAC-by-role methods returning safe defaults. |
| lib/features/statistics/presentation/providers/statistics_providers.dart | Chooses volume vs pressure SAC-by-role query based on sacUnitProvider. |
| lib/features/statistics/data/repositories/statistics_repository.dart | Introduces getSacVolumeByTankRole, renames/clarifies pressure-based method, and updates logging/messages. |
SAC in L/min - Add filter AND t.volume > 0 in getSacVolumeByTankRole to exclude tanks with zero volume - Update the SAC units/documentation comment to indicate L/min - Add test to verify zero-volume tanks are excluded in statistics_repository_sac_test.dart - Update mocks across tests to include new/updateDisplayName and updateUrlAndDisplayName methods used by updated APIs
0c6f970 to
c405cca
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #160
Changes
getSacByTankRoletogetSacPressureByTankRolegetSacVolumeByTankRolegetSacPressureByTankRoleorgetSacVolumeByTankRolebased on user preferenceTest Plan
flutter testpassesflutter analyzepassesScreenshots
Before:

After:
