use std::collections::BTreeMap;
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
pub struct FulfillmentSnapshot {
pub counters: BTreeMap<String, i64>,
pub checklist: BTreeMap<String, bool>,
}
impl FulfillmentSnapshot {
#[must_use]
pub fn empty() -> Self {
Self::default()
}
#[must_use]
pub fn with_counter(mut self, key: impl Into<String>, value: i64) -> Self {
self.counters.insert(key.into(), value);
self
}
#[must_use]
pub fn with_check(mut self, key: impl Into<String>, complete: bool) -> Self {
self.checklist.insert(key.into(), complete);
self
}
}