assignmentlib/dto/
question_request.rsuse common::enums::status::Status;
use serde::{Deserialize, Serialize};
use uuid::Uuid;
use crate::enums::question_simplicity_type::QuestionSimplicityType;
use crate::enums::question_type::QuestionType;
use crate::jsonb::question_option_group::QuestionOptionGroup;
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq)]
#[serde(rename_all = "camelCase")]
pub struct QuestionRequest {
pub id: Option<Uuid>,
#[serde(rename = "question")]
pub question_body: String,
pub value: f32,
pub ver: Option<i32>,
pub marking_comment: Option<String>,
pub picture_path: Option<String>,
pub video_path: Option<String>,
pub file_path: Option<String>,
#[serde(rename = "type")]
pub question_type: QuestionType,
pub options_groups: Option<Vec<QuestionOptionGroup>>,
pub description: Option<String>,
pub banks: Option<Vec<Uuid>>,
pub audio_path: Option<String>,
pub copyright_license: Option<String>,
pub copyright_author: Option<String>,
pub status: Option<Status>,
pub hint: Option<String>,
pub tags: Option<Vec<String>>,
pub name: Option<String>,
}
impl QuestionRequest {
pub fn equal(&self, other: &QuestionRequest) -> bool {
let mut eq = true;
eq &= self.id == other.id;
eq &= self.question_body == other.question_body;
eq &= self.value == other.value;
eq &= self.ver == other.ver;
eq &= self.marking_comment == other.marking_comment;
eq &= self.picture_path == other.picture_path;
eq &= self.video_path == other.video_path;
eq &= self.file_path == other.file_path;
eq &= self.question_type == other.question_type;
eq &= self.description == other.description;
eq &= self.audio_path == other.audio_path;
eq &= self.copyright_license == other.copyright_license;
eq &= self.copyright_author == other.copyright_author;
eq &= self.status == other.status;
eq &= self.hint == other.hint;
eq &= self.tags == other.tags;
eq &= self.name == other.name;
eq
}
}