//! Server state

const STATE_VERSION: u64 = 1;

use crate::models;
use crate::models::Wall;
use serde::Deserialize;
use serde::Serialize;
use smart_default::SmartDefault;
use std::collections::BTreeSet;

#[derive(Serialize, Deserialize, Clone, Debug, SmartDefault)]
pub struct PersistentState {
    /// State schema version
    #[default(STATE_VERSION)]
    pub version: u64,

    pub wall: Wall,
    pub problems: Problems,
}

#[derive(Serialize, Deserialize, Clone, Debug, Default)]
pub struct Problems {
    pub problems: BTreeSet<models::Problem>,
}
