wait_human/
shared_types.rs

1// This file is auto-generated by build.rs from ../app/backend/src/shared_types.rs
2// Do not edit manually - changes will be overwritten
3
4use chrono::{DateTime, Utc};
5use serde::{Deserialize, Serialize};
6
7/// The structure stored in DB for question
8#[derive(Serialize, Deserialize, Clone, Debug)]
9pub struct ConfirmationQuestion {
10    pub method: QuestionMethod,
11    pub subject: String,
12    pub body: Option<String>,
13    pub answer_format: AnswerFormat,
14}
15
16/// The structure stored in DB for answers
17#[derive(Serialize, Deserialize, Clone, Debug)]
18pub struct ConfirmationAnswer {
19    pub answer_content: AnswerContent,
20}
21
22#[derive(Serialize, Deserialize, Clone, Debug)]
23#[serde(rename_all = "snake_case", tag = "type")]
24pub enum QuestionMethod {
25    Push,
26}
27
28#[derive(Serialize, Deserialize, Clone, Debug)]
29pub struct ConfirmationAnswerWithDate {
30    pub answer: ConfirmationAnswer,
31    pub answered_at: DateTime<Utc>,
32}
33
34#[derive(Serialize, Deserialize, Clone, Debug)]
35#[serde(rename_all = "snake_case", tag = "type")]
36pub enum AnswerFormat {
37    FreeText,
38    Options {
39        options: Vec<String>,
40        multiple: bool,
41    },
42}
43
44#[derive(Serialize, Deserialize, Clone, Debug)]
45#[serde(rename_all = "snake_case", tag = "type")]
46pub enum AnswerContent {
47    FreeText { text: String },
48    Options { selected_indexes: Vec<u32> },
49}