ig_client/application/services/interfaces/
market.rs1use crate::application::models::market::{
2 HistoricalPricesResponse, MarketDetails, MarketSearchResult,
3};
4use crate::error::AppError;
5use crate::session::interface::IgSession;
6use async_trait::async_trait;
7
8#[async_trait]
10pub trait MarketService: Send + Sync {
11 async fn search_markets(
13 &self,
14 session: &IgSession,
15 search_term: &str,
16 ) -> Result<MarketSearchResult, AppError>;
17
18 async fn get_market_details(
20 &self,
21 session: &IgSession,
22 epic: &str,
23 ) -> Result<MarketDetails, AppError>;
24
25 async fn get_historical_prices(
27 &self,
28 session: &IgSession,
29 epic: &str,
30 resolution: &str,
31 from: &str,
32 to: &str,
33 ) -> Result<HistoricalPricesResponse, AppError>;
34}