Issue #142 / Bilan #4 — server-side Modified Dietz wrapper. - New `src-tauri/src/commands/balance_commands.rs` with single command `compute_account_return(db_filename, account_id, period_start, period_end)`: - Opens the active profile DB via `rusqlite::Connection::open(app_data_dir / db_filename)` — matches `repair_migrations` / `delete_profile_db`. - Reads `value_start` (latest snapshot ≤ period_start) + `value_end` (latest snapshot ≤ period_end) via correlated SELECT. - Reads cash flows via JOIN `balance_account_transfers` ⨝ `transactions` filtered by `transaction_date BETWEEN`. Sign applied per direction (`in` → +, `out` → −). - Calls `return_calculator::modified_dietz`, returns typed `AccountReturn`. - Registered in `commands/mod.rs` (pub use) and in `lib.rs`' `tauri::generate_handler!` array. `cargo check` clean. `cargo test --lib` → 54 passed (including the 7 return_calculator + 7 migration_v9 tests). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| capabilities | ||
| icons | ||
| src | ||
| .gitignore | ||
| build.rs | ||
| Cargo.lock | ||
| Cargo.toml | ||
| tauri.conf.json | ||