Feat/reporting family spending report#790
Merged
Baskarayelu merged 3 commits intoJun 19, 2026
Merged
Conversation
Closed
5 tasks
Contributor
|
merged the FamilySpendingReport aggregation - rebased onto main and favored the already-merged reporting changes where they overlapped, so a couple of the bundled bits may want a small follow-up. good feature work @Jumongweb 👍 |
Closed
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.
closes #782
closes #783
Implemented the family-spending path end to end.
In reporting/src/lib.rs, FamilySpendingReport now includes a per-member breakdown and report-level DataAvailability, plus a new get_family_spending_report endpoint that:
pages member addresses from the configured family_wallet
fetches each member’s SpendingTracker
dedupes members defensively
marks Complete, Partial, or Missing without hard-failing on dependency issues
clamps overflow safely with saturating_add after a checked_add failure
To support that production path, family_wallet/src/lib.rs now exposes a read-only paginated get_member_addresses_page view. I also added focused coverage in reporting/src/tests.rs for complete, partial, missing, zero-member, overflow, and auth behavior, plus a short note in docs/reporting-family-spending.md.
Verification: cargo test -p reporting family_spending -- --nocapture passes. cargo fmt --all ran cleanly. cargo clippy -p reporting --lib --tests -- -D warnings still fails, but on pre-existing issues in reporting/tests/gas_bench.rs unrelated to this feature (unused import and too_many_arguments).
Added the bootstrap-guard suite in insurance/src/test.rs, wired it into insurance/src/lib.rs, and documented the behavior in docs/insurance-bootstrap-guards.md.
The contract now also matches the requested safe pre-init read behavior: get_policy returns None, get_active_policies returns an empty page, and get_total_monthly_premium returns 0 before init. The tests cover single-shot init, pre-init rejection for every mutator, current init auth behavior, and post-init owner-only privilege enforcement.
Verification:
cargo test -p insurance --lib -- --nocapture passed
cargo clippy -p insurance --lib -- -D warnings passed
I also checked the package-wide command. cargo test -p insurance -- --nocapture is still failing, but from pre-existing stale integration tests under insurance/tests/ that reference APIs and constants this contract no longer exposes, not from the new bootstrap work.