Files
greasemonkey_scripts/ebay_storage/rust/src/item.rs

46 lines
1.3 KiB
Rust

// src/item.rs
use chrono::{DateTime, Utc};
use serde::Serialize;
#[derive(Serialize, Debug)]
pub struct EbayItem {
pub title: String,
#[serde(rename = "itemId")]
pub item_id: String,
#[serde(rename = "dateFound")]
pub date_found: DateTime<Utc>,
#[serde(rename = "currentBidPrice")]
pub current_bid_price: Option<f64>,
#[serde(rename = "buyItNowPrice", skip_serializing_if = "Option::is_none")]
pub buy_it_now_price: Option<f64>,
#[serde(rename = "hasBestOffer")]
pub has_best_offer: bool,
#[serde(skip_serializing_if = "Option::is_none")]
pub image_url: Option<String>,
pub parsed: ParsedItemData,
}
#[derive(Serialize, Debug)]
pub struct ParsedItemData {
#[serde(rename = "itemCount")]
pub item_count: i32,
#[serde(rename = "sizePerItemTB")]
pub size_per_item_tb: Option<f64>,
#[serde(rename = "totalTB")]
pub total_tb: Option<f64>,
#[serde(rename = "costPerTB")]
pub cost_per_tb: Option<f64>,
#[serde(rename = "needed_description_check")]
pub needed_description_check: bool,
#[serde(rename = "parser_engine")]
pub parser_engine: i32,
}
#[derive(Debug)]
pub struct SizeQuantityInfo {
pub total_tb: f64,
pub quantity: i32,
pub individual_size_tb: f64,
pub needed_description_check: bool,
}