Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion entities/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "entities"
version = "0.42.0"
version = "0.42.1"
edition = "2021"

[lib]
Expand Down
2 changes: 1 addition & 1 deletion entities/src/admin.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.11.3
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.1

use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
Expand Down
2 changes: 1 addition & 1 deletion entities/src/admin_increase_balance_receipt.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.11.3
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.1

use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
Expand Down
2 changes: 1 addition & 1 deletion entities/src/admin_trail.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.11.3
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.1

use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
Expand Down
4 changes: 2 additions & 2 deletions entities/src/balance.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.11.3
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.1

use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};

#[derive(Clone, Debug, Default, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)]
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)]
#[sea_orm(table_name = "balance")]
pub struct Model {
#[sea_orm(primary_key)]
Expand Down
2 changes: 1 addition & 1 deletion entities/src/increase_on_chain_balance_receipt.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.11.3
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.1

use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
Expand Down
11 changes: 3 additions & 8 deletions entities/src/login.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.11.3
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.1

use crate::serialization;
use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};

Expand All @@ -10,14 +9,10 @@ pub struct Model {
#[sea_orm(primary_key)]
pub id: u64,
#[sea_orm(column_type = "Binary(BlobSize::Blob(Some(16)))", unique)]
#[serde(
serialize_with = "serialization::uuid_as_ulid",
deserialize_with = "serialization::ulid_to_uuid"
)]
pub bearer_token: Uuid,
pub bearer_token: Vec<u8>,
pub user_id: u64,
pub expires_at: DateTimeUtc,
pub read_only: bool,
pub read_only: i8,
}

#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
Expand Down
3 changes: 1 addition & 2 deletions entities/src/mod.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.11.3
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.1

pub mod prelude;

Expand All @@ -17,7 +17,6 @@ pub mod rpc_accounting_v2;
pub mod rpc_key;
pub mod sea_orm_active_enums;
pub mod secondary_user;
pub mod serialization;
pub mod stripe_increase_balance_receipt;
pub mod user;
pub mod user_tier;
9 changes: 2 additions & 7 deletions entities/src/pending_login.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.11.3
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.1

use crate::serialization;
use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};

Expand All @@ -10,11 +9,7 @@ pub struct Model {
#[sea_orm(primary_key)]
pub id: u64,
#[sea_orm(column_type = "Binary(BlobSize::Blob(Some(16)))", unique)]
#[serde(
serialize_with = "serialization::uuid_as_ulid",
deserialize_with = "serialization::ulid_to_uuid"
)]
pub nonce: Uuid,
pub nonce: Vec<u8>,
#[sea_orm(column_type = "Text")]
pub message: String,
pub expires_at: DateTimeUtc,
Expand Down
2 changes: 1 addition & 1 deletion entities/src/prelude.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.11.3
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.1

pub use super::admin::Entity as Admin;
pub use super::admin_increase_balance_receipt::Entity as AdminIncreaseBalanceReceipt;
Expand Down
6 changes: 3 additions & 3 deletions entities/src/referee.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.11.3
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.1

use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
Expand All @@ -9,13 +9,13 @@ pub struct Model {
#[sea_orm(primary_key)]
pub id: i32,
#[sea_orm(column_type = "Decimal(Some((20, 10)))")]
pub one_time_bonus_applied_for_referee: Decimal,
#[sea_orm(column_type = "Decimal(Some((20, 10)))")]
pub credits_applied_for_referrer: Decimal,
pub referral_start_date: DateTime,
pub used_referral_code: i32,
#[sea_orm(unique)]
pub user_id: u64,
#[sea_orm(column_type = "Decimal(Some((20, 10)))")]
pub one_time_bonus_applied_for_referee: Decimal,
}

#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
Expand Down
2 changes: 1 addition & 1 deletion entities/src/referrer.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.11.3
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.1

use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
Expand Down
7 changes: 1 addition & 6 deletions entities/src/revert_log.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.11.3
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.1

use super::sea_orm_active_enums::Method;
use crate::serialization;
use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};

Expand All @@ -14,10 +13,6 @@ pub struct Model {
pub timestamp: DateTimeUtc,
pub method: Method,
#[sea_orm(column_type = "Binary(BlobSize::Blob(Some(20)))")]
#[serde(
serialize_with = "serialization::vec_as_address",
deserialize_with = "serialization::address_to_vec"
)]
pub to: Vec<u8>,
#[sea_orm(column_type = "Text", nullable)]
pub call_data: Option<String>,
Expand Down
6 changes: 3 additions & 3 deletions entities/src/rpc_accounting.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.11.3
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.1

use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
Expand All @@ -11,7 +11,7 @@ pub struct Model {
pub rpc_key_id: Option<u64>,
pub chain_id: u64,
pub method: Option<String>,
pub error_response: bool,
pub error_response: i8,
pub period_datetime: DateTimeUtc,
pub frontend_requests: u64,
pub backend_requests: u64,
Expand Down Expand Up @@ -41,7 +41,7 @@ pub struct Model {
pub p90_response_bytes: u64,
pub p99_response_bytes: u64,
pub max_response_bytes: u64,
pub archive_request: bool,
pub archive_request: i8,
pub origin: Option<String>,
pub migrated: Option<DateTimeUtc>,
}
Expand Down
23 changes: 4 additions & 19 deletions entities/src/rpc_accounting_v2.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.11.3
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.1

use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
Expand All @@ -11,8 +11,8 @@ pub struct Model {
pub rpc_key_id: Option<u64>,
pub chain_id: u64,
pub period_datetime: DateTimeUtc,
pub archive_needed: bool,
pub error_response: bool,
pub archive_needed: i8,
pub error_response: i8,
pub frontend_requests: u64,
pub backend_requests: u64,
pub backend_retries: u64,
Expand All @@ -29,21 +29,6 @@ pub struct Model {
}

#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
pub enum Relation {
#[sea_orm(
belongs_to = "super::rpc_key::Entity",
from = "Column::RpcKeyId",
to = "super::rpc_key::Column::Id",
on_update = "NoAction",
on_delete = "NoAction"
)]
RpcKey,
}

impl Related<super::rpc_key::Entity> for Entity {
fn to() -> RelationDef {
Relation::RpcKey.def()
}
}
pub enum Relation {}

impl ActiveModelBehavior for ActiveModel {}
23 changes: 6 additions & 17 deletions entities/src/rpc_key.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.11.3
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.1

use crate::serialization;
use super::sea_orm_active_enums::LogLevel;
use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};

Expand All @@ -11,14 +11,10 @@ pub struct Model {
pub id: u64,
pub user_id: u64,
#[sea_orm(column_type = "Binary(BlobSize::Blob(Some(16)))", unique)]
#[serde(
serialize_with = "serialization::uuid_as_ulid",
deserialize_with = "serialization::ulid_to_uuid"
)]
pub secret_key: Uuid,
pub secret_key: Vec<u8>,
pub description: Option<String>,
pub private_txs: bool,
pub active: bool,
pub private_txs: i8,
pub active: i8,
#[sea_orm(column_type = "Text", nullable)]
pub allowed_ips: Option<String>,
#[sea_orm(column_type = "Text", nullable)]
Expand All @@ -29,6 +25,7 @@ pub struct Model {
pub allowed_user_agents: Option<String>,
#[sea_orm(column_type = "Double")]
pub log_revert_chance: f64,
pub log_level: LogLevel,
}

#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
Expand All @@ -37,8 +34,6 @@ pub enum Relation {
RevertLog,
#[sea_orm(has_many = "super::rpc_accounting::Entity")]
RpcAccounting,
#[sea_orm(has_many = "super::rpc_accounting_v2::Entity")]
RpcAccountingV2,
#[sea_orm(has_many = "super::secondary_user::Entity")]
SecondaryUser,
#[sea_orm(
Expand All @@ -63,12 +58,6 @@ impl Related<super::rpc_accounting::Entity> for Entity {
}
}

impl Related<super::rpc_accounting_v2::Entity> for Entity {
fn to() -> RelationDef {
Relation::RpcAccountingV2.def()
}
}

impl Related<super::secondary_user::Entity> for Entity {
fn to() -> RelationDef {
Relation::SecondaryUser.def()
Expand Down
12 changes: 11 additions & 1 deletion entities/src/sea_orm_active_enums.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.11.3
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.1

use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};

#[derive(Debug, Clone, PartialEq, Eq, EnumIter, DeriveActiveEnum, Serialize, Deserialize)]
#[sea_orm(rs_type = "String", db_type = "Enum", enum_name = "log_level")]
pub enum LogLevel {
#[sea_orm(string_value = "none")]
None,
#[sea_orm(string_value = "aggregated")]
Aggregated,
#[sea_orm(string_value = "detailed")]
Detailed,
}
#[derive(Debug, Clone, PartialEq, Eq, EnumIter, DeriveActiveEnum, Serialize, Deserialize)]
#[sea_orm(rs_type = "String", db_type = "Enum", enum_name = "method")]
pub enum Method {
Expand Down
2 changes: 1 addition & 1 deletion entities/src/secondary_user.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.11.3
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.1

use super::sea_orm_active_enums::Role;
use sea_orm::entity::prelude::*;
Expand Down
2 changes: 1 addition & 1 deletion entities/src/stripe_increase_balance_receipt.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.11.3
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.1

use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
Expand Down
9 changes: 2 additions & 7 deletions entities/src/user.rs
Original file line number Diff line number Diff line change
@@ -1,19 +1,14 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.11.3
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.1

use crate::serialization;
use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};

#[derive(Clone, Debug, Hash, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)]
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)]
#[sea_orm(table_name = "user")]
pub struct Model {
#[sea_orm(primary_key)]
pub id: u64,
#[sea_orm(column_type = "Binary(BlobSize::Blob(Some(20)))", unique)]
#[serde(
serialize_with = "serialization::vec_as_address",
deserialize_with = "serialization::address_to_vec"
)]
pub address: Vec<u8>,
pub description: Option<String>,
pub email: Option<String>,
Expand Down
2 changes: 1 addition & 1 deletion entities/src/user_tier.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.11.3
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.1

use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
Expand Down