24 lines
467 B
Rust
24 lines
467 B
Rust
use crate::GeoffreyDatabaseModel;
|
|
use serde::{Deserialize, Serialize};
|
|
use std::collections::HashSet;
|
|
|
|
#[derive(Serialize, Deserialize, Debug, Clone, Default)]
|
|
pub struct Market {
|
|
pub id: Option<u64>,
|
|
pub shops: HashSet<u64>,
|
|
}
|
|
|
|
impl GeoffreyDatabaseModel for Market {
|
|
fn id(&self) -> Option<u64> {
|
|
self.id
|
|
}
|
|
|
|
fn set_id(&mut self, id: u64) {
|
|
self.id = Some(id)
|
|
}
|
|
|
|
fn tree() -> String {
|
|
"market".to_string()
|
|
}
|
|
}
|