2021-11-07 21:23:18 +00:00
|
|
|
use crate::models::parameters::CommandRequest;
|
|
|
|
use crate::models::player::UserID;
|
|
|
|
use serde::{Deserialize, Serialize};
|
|
|
|
|
|
|
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
|
|
|
pub enum ItemSort {
|
|
|
|
Price,
|
|
|
|
Restock,
|
|
|
|
}
|
|
|
|
|
2021-11-14 23:28:55 +00:00
|
|
|
#[derive(Debug, Serialize, Deserialize, Clone, PartialEq)]
|
2021-11-07 21:23:18 +00:00
|
|
|
pub enum Order {
|
|
|
|
High,
|
|
|
|
Low,
|
|
|
|
}
|
|
|
|
|
|
|
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
|
|
|
pub struct SellingParams {
|
|
|
|
pub token: String,
|
|
|
|
pub query: String,
|
|
|
|
pub sort: Option<ItemSort>,
|
|
|
|
pub order: Option<Order>,
|
|
|
|
}
|
|
|
|
|
|
|
|
impl CommandRequest for SellingParams {
|
|
|
|
fn token(&self) -> String {
|
|
|
|
self.token.clone()
|
|
|
|
}
|
|
|
|
|
|
|
|
fn user_id(&self) -> Option<UserID> {
|
|
|
|
None
|
|
|
|
}
|
|
|
|
}
|