movie detail page + importer architecture fix
This commit is contained in:
@@ -1,20 +1,31 @@
|
||||
use chrono::NaiveDateTime;
|
||||
use crate::value_objects::{ImportSessionId, UserId};
|
||||
use crate::{
|
||||
models::{AnnotatedRow, FieldMapping, ParsedFile},
|
||||
value_objects::{ImportSessionId, UserId},
|
||||
};
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct ImportSession {
|
||||
pub id: ImportSessionId,
|
||||
pub user_id: UserId,
|
||||
pub parsed_data: String,
|
||||
pub field_mappings: Option<String>,
|
||||
pub row_results: Option<String>,
|
||||
pub parsed_file: Option<ParsedFile>,
|
||||
pub field_mappings: Option<Vec<FieldMapping>>,
|
||||
pub row_results: Option<Vec<AnnotatedRow>>,
|
||||
pub created_at: NaiveDateTime,
|
||||
pub expires_at: NaiveDateTime,
|
||||
}
|
||||
|
||||
impl ImportSession {
|
||||
pub fn new(id: ImportSessionId, user_id: UserId, parsed_data: String, created_at: NaiveDateTime) -> Self {
|
||||
pub fn new(id: ImportSessionId, user_id: UserId, created_at: NaiveDateTime) -> Self {
|
||||
let expires_at = created_at + chrono::Duration::hours(24);
|
||||
Self { id, user_id, parsed_data, field_mappings: None, row_results: None, created_at, expires_at }
|
||||
Self {
|
||||
id,
|
||||
user_id,
|
||||
parsed_file: None,
|
||||
field_mappings: None,
|
||||
row_results: None,
|
||||
created_at,
|
||||
expires_at,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user