use chrono::{DateTime, Utc};
use serde::{Deserialize, Serialize};
#[derive(Serialize, Deserialize, Clone, Debug)]
pub struct ConfirmationQuestion {
pub method: QuestionMethod,
pub subject: String,
pub body: Option<String>,
pub answer_format: AnswerFormat,
}
#[derive(Serialize, Deserialize, Clone, Debug)]
pub struct ConfirmationAnswer {
pub answer_content: AnswerContent,
}
#[derive(Serialize, Deserialize, Clone, Debug)]
#[serde(rename_all = "snake_case", tag = "type")]
pub enum QuestionMethod {
Push,
}
#[derive(Serialize, Deserialize, Clone, Debug)]
pub struct ConfirmationAnswerWithDate {
pub answer: ConfirmationAnswer,
pub answered_at: DateTime<Utc>,
}
#[derive(Serialize, Deserialize, Clone, Debug)]
#[serde(rename_all = "snake_case", tag = "type")]
pub enum AnswerFormat {
FreeText,
Options {
options: Vec<String>,
multiple: bool,
},
}
#[derive(Serialize, Deserialize, Clone, Debug)]
#[serde(rename_all = "snake_case", tag = "type")]
pub enum AnswerContent {
FreeText { text: String },
Options { selected_indexes: Vec<u32> },
}