ryanw-mobile / OctoMeter

🔥Kotlin Multiplatform Desktop/Android/iOS Energy Tracker app
Other
126 stars 10 forks source link

(#79) Enable repository to handle paging and full data-set download #225

Closed ryanw-mobile closed 3 months ago

ryanw-mobile commented 3 months ago

The API returns up to 100 records per request Right now we are not using anything up to that page limit, but to facilitate future tickets, we improved the repository to accept either requesting a particular page number, or to automatically retrieve the entire data set, by having the repository to automatically loop through the requests until the backend says there is no more next page.

Although not related, added some repository unit tests as a starting point. This is not done now because the upcoming tickets will incorporate database caching which we are going to change the repository behaviour quite a lot.

The loading screen also updated, so that the animated icon now becomes smaller.

codacy-production[bot] commented 3 months ago

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
:white_check_mark: -0.03% (target: -1.00%) :white_check_mark: 14.29%
Coverage variation details | | Coverable lines | Covered lines | Coverage | | ------------- | ------------- | ------------- | ------------- | | Common ancestor commit (cadb3c3830ca0d95db5b3e245f16e5820e9410b5) | 1825 | 974 | 53.37% | | | Head commit (84ae628951712e2f739dba5e693c5d1e3517eeb2) | 1826 (+1) | 974 (+0) | 53.34% (**-0.03%**) | **Coverage variation** is the difference between the coverage for the head and common ancestor commits of the pull request branch: ` - `
Diff coverage details | | Coverable lines | Covered lines | Diff coverage | | ------------- | ------------- | ------------- | ------------- | | Pull request (#225) | 49 | 7 | **14.29%** | **Diff coverage** is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: `/ * 100%`

See your quality gate settings    Change summary preferences


:rocket: Don’t miss a bit, follow what’s new on Codacy.

Codacy stopped sending the deprecated coverage status on June 5th, 2024. Learn more

codecov[bot] commented 3 months ago

Codecov Report

Attention: Patch coverage is 11.62791% with 38 lines in your changes missing coverage. Please review.

Project coverage is 49.53%. Comparing base (cadb3c3) to head (7a678cd).

:exclamation: Current head 7a678cd differs from pull request most recent head 84ae628

Please upload reports for the commit 84ae628 to get more accurate results.

Files Patch % Lines
...nigami/data/repository/OctopusRestApiRepository.kt 0.00% 34 Missing :warning:
...bi/kunigami/domain/repository/RestApiRepository.kt 0.00% 2 Missing :warning:
...a/source/network/ElectricityMeterPointsEndpoint.kt 50.00% 0 Missing and 1 partial :warning:
...i/kunigami/data/source/network/ProductsEndpoint.kt 80.00% 0 Missing and 1 partial :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #225 +/- ## ========================================== + Coverage 49.40% 49.53% +0.13% ========================================== Files 98 98 Lines 1755 1738 -17 Branches 251 244 -7 ========================================== - Hits 867 861 -6 + Misses 810 799 -11 Partials 78 78 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.