28 lines
506 B
Rust
28 lines
506 B
Rust
use std::collections::HashSet;
|
|
|
|
use serde::{Deserialize, Serialize};
|
|
|
|
use crate::GeoffreyDatabaseModel;
|
|
use crate::models::item::ItemListing;
|
|
|
|
#[derive(Serialize, Deserialize, Debug, Clone)]
|
|
pub struct Shop {
|
|
id: Option<u64>,
|
|
pub item_listings: HashSet<ItemListing>,
|
|
}
|
|
|
|
impl GeoffreyDatabaseModel for Shop {
|
|
fn id(&self) -> Option<u64> {
|
|
self.id
|
|
}
|
|
|
|
fn set_id(&mut self, id: u64) {
|
|
self.id = Some(id);
|
|
}
|
|
|
|
fn tree() -> String {
|
|
"shop".to_string()
|
|
}
|
|
}
|
|
|