Compware/src/models/item.rs

20 lines
618 B
Rust
Raw Normal View History

/// Represents an Item in CompareWare.
/// Each item has metadata and key-value tags for categorization.
2024-12-06 14:45:14 +03:00
use serde::{Deserialize, Serialize};
2024-12-16 19:06:33 +03:00
pub struct Review {
pub user_id: String,
pub title: String,
pub content: String,
pub timestamp: i64,
}
2024-12-06 14:45:14 +03:00
#[derive(Serialize, Deserialize, Debug, Clone)]
pub struct Item {
pub id: String, // Unique ID for the item
pub name: String, // Item name
pub description: String, // Short description of the item
pub tags: Vec<(String, String)>, // Key-value tags (e.g., "type" -> "software")
2024-12-16 19:06:33 +03:00
pub reviews: Vec<Review>, // Reviews
2024-12-06 14:45:14 +03:00
}