use beteran_common_rust as bcr; use diesel::deserialize::QueryableByName; /// #[derive(PartialEq, Debug, Clone)] pub struct BettingHistoryModel { /// pub id: String, /// pub vendor_id: i64, /// pub vendor_name: String, /// pub game_id: i64, /// pub game_name: String, /// pub game_category: String, /// pub game_type: String, /// pub currency: String, /// pub cash: f64, /// pub before_cash: f64, /// pub after_cash: f64, /// pub group_key: Option, /// pub detail: Option, /// pub is_bonus: bool, /// pub is_promo: bool, /// pub is_jackpot: bool, /// pub site_username: String, /// pub key: String, /// pub ref_id: String, /// pub o_ref_id: String, /// pub betting_type: String, /// pub category: String, /// pub created_at: i64, /// pub utc_created_at: i64, } impl QueryableByName for BettingHistoryModel { fn build>(row: &R) -> diesel::deserialize::Result { Ok(BettingHistoryModel { id: row.get("akbh_id")?, vendor_id: row.get("akbh_vendor_id")?, vendor_name: row.get("akbh_vendor_name")?, game_id: row.get("akbh_game_id")?, game_name: row.get("akbh_game_name")?, game_category: row.get("akbh_game_category")?, game_type: row.get("akbh_game_type")?, currency: row.get("akbh_currency")?, cash: row.get("akbh_cash")?, before_cash: row.get("akbh_before_cash")?, after_cash: row.get("akbh_after_cash")?, group_key: row.get("akbh_group_key")?, detail: row.get("akbh_detail")?, is_bonus: row.get("akbh_is_bonus")?, is_promo: row.get("akbh_is_promo")?, is_jackpot: row.get("akbh_is_jackpot")?, site_username: row.get("akbh_site_username")?, key: row.get("akbh_key")?, ref_id: row.get("akbh_ref_id")?, o_ref_id: row.get("akbh_o_ref_id")?, betting_type: row.get("akbh_betting_type")?, category: row.get("akbh_category")?, created_at: row.get("akbh_created_at")?, utc_created_at: row.get("akbh_utc_created_at")?, }) } } /// #[derive(Debug, Clone)] pub struct FindAllSearch { /// pub member_id: Option, /// pub vendor_id: Option, /// pub vendor_ids: Vec, /// pub vendor_name: Option, /// pub vendor_name_like: Option, /// pub game_id: Option, /// pub game_ids: Vec, /// pub game_name: Option, /// pub game_name_like: Option, /// pub game_category: Option, /// pub game_category_like: Option, /// pub game_type: Option, /// pub game_type_like: Option, /// pub currency: Option, /// pub currency_like: Option, /// pub key: Option, /// pub key_like: Option, /// pub ref_id: Option, /// pub ref_id_like: Option, /// pub o_ref_id: Option, /// pub o_ref_id_like: Option, /// pub group_key: Option, /// pub group_key_like: Option, /// pub is_bonus: Option, /// pub is_promo: Option, /// pub is_jackpot: Option, /// pub site_username: Option, /// pub site_username_like: Option, /// pub betting_type: Option, /// pub betting_type_like: Option, /// pub category: Option, /// pub category_like: Option, } /// #[derive(Debug, Clone)] pub struct FindAll { pub search: Option, /// pub pagination: Option, /// pub sorts: Option>, } /////////////////////////////// temparary definitions ///////////////////////////////////////////