Compare commits
No commits in common. "323dd43c5b57a7892c2ad2cf3a61a8f7730877b0" and "13ea0619cdf554e58217bb178f19230e082e7189" have entirely different histories.
323dd43c5b
...
13ea0619cd
2
Cargo.lock
generated
2
Cargo.lock
generated
@ -2168,7 +2168,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "rustler-core"
|
||||
version = "0.4.1"
|
||||
version = "0.4.0"
|
||||
dependencies = [
|
||||
"async-stream",
|
||||
"async-trait",
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "rustler-core"
|
||||
version = "0.4.1"
|
||||
version = "0.4.0"
|
||||
edition = "2021"
|
||||
description = "🐎 » rustler-core market data extractor core functionality"
|
||||
authors = ["Lucas Colombo <lucas@lucode.ar>"]
|
||||
|
||||
@ -16,7 +16,6 @@ impl MigrationTrait for Migration {
|
||||
.col(ColumnDef::new(Ticker::Symbol).string().not_null())
|
||||
.col(ColumnDef::new(Ticker::QuoteSymbol).string().null())
|
||||
.col(ColumnDef::new(Ticker::MarketId).string().not_null())
|
||||
.col(ColumnDef::new(Ticker::Active).boolean().not_null().default(true))
|
||||
.foreign_key(
|
||||
ForeignKey::create()
|
||||
.name("fk_ticker_market_id")
|
||||
@ -52,6 +51,4 @@ enum Ticker {
|
||||
QuoteSymbol,
|
||||
/// Market ID
|
||||
MarketId,
|
||||
/// Active status of the ticker. This defines if quotes are generated for this ticker or not.
|
||||
Active,
|
||||
}
|
||||
|
||||
@ -11,7 +11,6 @@ pub struct Model {
|
||||
pub symbol: String,
|
||||
pub quote_symbol: Option<String>,
|
||||
pub market_id: String,
|
||||
pub active: bool,
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
|
||||
|
||||
@ -24,13 +24,6 @@ impl Service {
|
||||
Ok(tickers)
|
||||
}
|
||||
|
||||
/// 🐎 » get all active
|
||||
pub async fn get_all_active(&self) -> Result<Vec<TickerModel>, DbErr> {
|
||||
let tickers =
|
||||
Ticker::find().filter(ticker::Column::Active.eq(true)).all(&self.conn).await?;
|
||||
Ok(tickers)
|
||||
}
|
||||
|
||||
/// 🐎 » retrieves a ticker from the database, given its id
|
||||
pub async fn get(&self, id: String) -> Result<Option<TickerModel>, DbErr> {
|
||||
let ticker = Ticker::find_by_id(id).one(&self.conn).await?;
|
||||
|
||||
@ -23,7 +23,6 @@ message Ticker {
|
||||
string symbol = 2;
|
||||
optional string quote_symbol = 3;
|
||||
string market_id = 4;
|
||||
bool active = 5;
|
||||
}
|
||||
|
||||
message Tickers {
|
||||
|
||||
@ -22,7 +22,6 @@ impl Ticker {
|
||||
symbol: self.symbol,
|
||||
quote_symbol: self.quote_symbol,
|
||||
market_id: self.market_id,
|
||||
active: self.active,
|
||||
}
|
||||
}
|
||||
|
||||
@ -33,7 +32,6 @@ impl Ticker {
|
||||
symbol: model.symbol,
|
||||
quote_symbol: model.quote_symbol,
|
||||
market_id: model.market_id,
|
||||
active: model.active,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user