feat(balance): add chrono dep + Modified Dietz return_calculator with tests
Issue #142 / Bilan #4 — TDD step 1.
- Added `chrono = "0.4"` (default-features off, `serde` + `std` features)
to `src-tauri/Cargo.toml` for day-precision date arithmetic.
- New private module `src-tauri/src/commands/return_calculator.rs`:
- `pub(crate) fn modified_dietz(value_start, value_end, cash_flows,
period_start, period_end) -> AccountReturn`
- `AccountReturn { value_start, value_end, net_contributions, return_pct,
annualized_pct, is_partial, has_no_transfers_warning }` (Serialize)
- Edge cases handled: missing start/end snapshot (`is_partial = true`,
`return_pct = None`), no transfers (collapses to simple return + warn
flag), zero-length period (skips annualization), V_start = 0 with first
flow > 0 (account-created mid-period), depleted-then-refilled (no
panic, finite output).
- 7 co-located TDD tests covering nominal + every edge case above.
- Module declared `pub(crate)` in `commands/mod.rs` (kept out of the
wildcard re-export — only `balance_commands.rs` will consume it).
`cargo test --lib commands::return_calculator` → 7 passed.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>