feat(prices): Rust Tauri command fetch_price + tests (#155) #165

Merged
maximus merged 1 commit from issue-155-rust-fetch-price into main 2026-04-28 01:06:40 +00:00
Owner

Summary

  • New Tauri command fetch_price(symbol, date) calling the /v1/prices endpoint of maximus-api
  • PriceResponse struct + FetchPriceError enum (Auth, PremiumRequired, SymbolNotFound, RateLimit{retry_after_s}, ProviderUnavailable, Network, Internal)
  • Renamed SIMPL_API_URLMAXIMUS_API_URL across src-tauri/ (consistency with renamed server repo)
  • Added mockito = 1.6 to dev-dependencies
  • Registered command in lib.rs::run() invoke_handler
  • Fixed pre-existing clippy warnings (doc_overindented_list_items in return_calculator.rs, is_multiple_of in profile_commands.rs)

Test plan

  • cargo test --lib balance_commands::tests green (7 tests)
  • cargo clippy --all-targets -- -D warnings clean
  • Privacy headers test: sent headers ⊆ {Authorization, Accept, User-Agent, Host}
  • No remaining SIMPL_API_URL references in src-tauri/
  • fetch_price_inner extracted for testability (no env-var races between concurrent tests)

Closes #155

Generated autonomously by /autopilot run of 2026-04-27

## Summary - New Tauri command `fetch_price(symbol, date)` calling the `/v1/prices` endpoint of maximus-api - `PriceResponse` struct + `FetchPriceError` enum (Auth, PremiumRequired, SymbolNotFound, RateLimit{retry_after_s}, ProviderUnavailable, Network, Internal) - Renamed `SIMPL_API_URL` → `MAXIMUS_API_URL` across `src-tauri/` (consistency with renamed server repo) - Added `mockito = 1.6` to dev-dependencies - Registered command in `lib.rs::run()` invoke_handler - Fixed pre-existing clippy warnings (`doc_overindented_list_items` in `return_calculator.rs`, `is_multiple_of` in `profile_commands.rs`) ## Test plan - [x] `cargo test --lib balance_commands::tests` green (7 tests) - [x] `cargo clippy --all-targets -- -D warnings` clean - [x] Privacy headers test: sent headers ⊆ {Authorization, Accept, User-Agent, Host} - [x] No remaining `SIMPL_API_URL` references in `src-tauri/` - [x] `fetch_price_inner` extracted for testability (no env-var races between concurrent tests) Closes #155 Generated autonomously by /autopilot run of 2026-04-27
maximus added 1 commit 2026-04-27 12:23:36 +00:00
feat(prices): Rust Tauri command fetch_price + tests
All checks were successful
PR Check / rust (push) Successful in 25m28s
PR Check / frontend (push) Successful in 2m33s
PR Check / rust (pull_request) Successful in 25m38s
PR Check / frontend (pull_request) Successful in 2m44s
531624bcb4
- Add fetch_price command with PriceResponse and FetchPriceError types
- Privacy-strict header policy (Authorization, Accept, User-Agent only)
- Rename SIMPL_API_URL -> MAXIMUS_API_URL across src-tauri
- 7+ mockito tests covering happy path, 401/403/404/429/5xx, and header allowlist
- Fix pre-existing clippy warnings (doc_overindented_list_items, is_multiple_of)

Closes #155
maximus added the
autopilot:pending-human
status:approved
type:feature
labels 2026-04-27 12:23:42 +00:00
maximus merged commit edd1a5cbe4 into main 2026-04-28 01:06:40 +00:00
maximus deleted branch issue-155-rust-fetch-price 2026-04-28 01:06:41 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: maximus/Simpl-Resultat#165
No description provided.