Skip to content

Feat/reporting family spending report#790

Merged
Baskarayelu merged 3 commits into
Remitwise-Org:mainfrom
Jumongweb:feat/reporting-family-spending-report
Jun 19, 2026
Merged

Feat/reporting family spending report#790
Baskarayelu merged 3 commits into
Remitwise-Org:mainfrom
Jumongweb:feat/reporting-family-spending-report

Conversation

@Jumongweb

Copy link
Copy Markdown
Contributor

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.

@Baskarayelu Baskarayelu merged commit db49f5a into Remitwise-Org:main Jun 19, 2026
3 of 6 checks passed
@Baskarayelu

Copy link
Copy Markdown
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 👍

@Baskarayelu Baskarayelu mentioned this pull request Jun 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants