forked from blasthavers/blastmud
37 lines
893 B
Rust
37 lines
893 B
Rust
|
use serde::{Serialize, Deserialize};
|
||
|
use chrono::{DateTime, Utc};
|
||
|
|
||
|
#[derive(Serialize, Deserialize)]
|
||
|
pub enum ConsentType {
|
||
|
Fight,
|
||
|
Medicine,
|
||
|
Gifts,
|
||
|
Visit,
|
||
|
Sex
|
||
|
}
|
||
|
|
||
|
#[derive(Serialize, Deserialize)]
|
||
|
pub enum ConsentStatus {
|
||
|
PendingAdd, // Added but awaiting other party to ratify by giving matching consent.
|
||
|
Active, // Consent in force, no delete pending.
|
||
|
PendingDelete, // Pending cancellation but other party has to also disallow to ratify.
|
||
|
}
|
||
|
|
||
|
#[derive(Serialize, Deserialize)]
|
||
|
pub struct FightConsent {
|
||
|
status: ConsentStatus,
|
||
|
pending_change: Option<Box<Consent>>,
|
||
|
allow_pick: bool,
|
||
|
freely_revoke: bool,
|
||
|
}
|
||
|
|
||
|
#[derive(Serialize, Deserialize)]
|
||
|
pub struct Consent {
|
||
|
consent_type: ConsentType,
|
||
|
fight_consent: Option<FightConsent>,
|
||
|
expires: Option<DateTime<Utc>>,
|
||
|
only_in: Vec<String>,
|
||
|
allow_private: bool,
|
||
|
until_death: bool,
|
||
|
}
|