Skip to content

Fix SAC by Tank Role#274

Merged
ericgriffin merged 3 commits into
submersion-app:mainfrom
mgoodness:fix-sac-by-tank-role
May 20, 2026
Merged

Fix SAC by Tank Role#274
ericgriffin merged 3 commits into
submersion-app:mainfrom
mgoodness:fix-sac-by-tank-role

Conversation

@mgoodness
Copy link
Copy Markdown
Contributor

@mgoodness mgoodness commented Apr 30, 2026

Summary

Closes #160

Changes

  • Rename getSacByTankRole to getSacPressureByTankRole
  • Create getSacVolumeByTankRole
  • Use getSacPressureByTankRole or getSacVolumeByTankRole based on user preference

Test Plan

  • flutter test passes
  • flutter analyze passes
  • Manual testing on: MacOS

Screenshots

Screenshot 2026-04-30 at 09 32 59

Before:
Screenshot 2026-04-30 at 09 33 14

After:
Screenshot 2026-04-30 at 09 35 16

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 30, 2026

Codecov Report

❌ Patch coverage is 75.00000% with 4 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...s/presentation/providers/statistics_providers.dart 0.00% 4 Missing ⚠️

📢 Thoughts on this report? Let us know!

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.

Comment thread lib/features/statistics/data/repositories/statistics_repository.dart Outdated
mgoodness added 2 commits May 14, 2026 20:12
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
@mgoodness mgoodness force-pushed the fix-sac-by-tank-role branch from 0c6f970 to c405cca Compare May 15, 2026 01:53
Copy link
Copy Markdown
Member

@ericgriffin ericgriffin left a comment

Choose a reason for hiding this comment

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

👍

@ericgriffin ericgriffin merged commit cef3344 into submersion-app:main May 20, 2026
13 of 14 checks passed
@github-project-automation github-project-automation Bot moved this from Backlog to Done in Submersion Release Tracker May 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Statistics - Air Consumption - SAC by Tank Role

3 participants