fix: add department_id to ReqClazz and ReqClazzRepeat structs
Rust Backend CI / check (push) Failing after 13m19s
Rust Backend CI / check (push) Failing after 13m19s
Completes the department_id field addition across all Clazz-related structs and initializers after schema migration added the column. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -862,6 +862,7 @@ async fn raw_create_clazz_with_repeat(
|
||||
is_notified: in_kecheng.is_notified.clone(),
|
||||
completed_at: None,
|
||||
org_id: in_kecheng.org_id.clone(),
|
||||
department_id: in_kecheng.department_id.clone(),
|
||||
};
|
||||
if to_create_kecheng.org_id.is_none() {
|
||||
to_create_kecheng.org_id = current_org_id.clone();
|
||||
@@ -887,6 +888,7 @@ async fn raw_create_clazz_with_repeat(
|
||||
repeat_status: kecheng_repeat_copy.repeat_status.clone(),
|
||||
latest_clazz_created_at: kecheng_repeat_copy.latest_clazz_created_at.clone(),
|
||||
org_id: kecheng_repeat_copy.org_id.clone(),
|
||||
department_id: kecheng_repeat_copy.department_id.clone(),
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -72,6 +72,7 @@ async fn raw_create_clazz_repeat(
|
||||
repeat_status: in_kecheng_repeat.repeat_status.clone(),
|
||||
latest_clazz_created_at: in_kecheng_repeat.latest_clazz_created_at.clone(),
|
||||
org_id: in_kecheng_repeat.org_id.clone(),
|
||||
department_id: in_kecheng_repeat.department_id.clone(),
|
||||
};
|
||||
|
||||
let created_kecheng_repeat_result = ClazzRepeat::create(
|
||||
|
||||
@@ -52,6 +52,7 @@ pub struct Clazz {
|
||||
pub is_notified: Option<bool>,
|
||||
pub completed_at: Option<NaiveDateTime>,
|
||||
pub org_id: Option<String>,
|
||||
pub department_id: Option<String>,
|
||||
}
|
||||
|
||||
// https://weinan.io/2024/02/23/rust-diesel.html
|
||||
@@ -152,6 +153,7 @@ impl ReqClazzWithRepeat {
|
||||
is_notified: None,
|
||||
completed_at: None,
|
||||
org_id: None,
|
||||
department_id: None,
|
||||
}
|
||||
};
|
||||
|
||||
@@ -169,6 +171,7 @@ impl ReqClazzWithRepeat {
|
||||
repeat_status: None,
|
||||
latest_clazz_created_at: None,
|
||||
org_id: None,
|
||||
department_id: None,
|
||||
}
|
||||
};
|
||||
|
||||
@@ -232,6 +235,7 @@ impl Clazz {
|
||||
is_notified: self.is_notified.clone(),
|
||||
completed_at: self.completed_at.clone(),
|
||||
org_id: self.org_id.clone(),
|
||||
department_id: self.department_id.clone(),
|
||||
};
|
||||
req_res
|
||||
}
|
||||
@@ -453,6 +457,7 @@ pub struct ClazzRepeat {
|
||||
pub repeat_status: Option<String>,
|
||||
pub latest_clazz_created_at: Option<NaiveDateTime>,
|
||||
pub org_id: Option<String>,
|
||||
pub department_id: Option<String>,
|
||||
}
|
||||
|
||||
impl ClazzRepeat {
|
||||
@@ -485,6 +490,7 @@ impl ClazzRepeat {
|
||||
repeat_status: self.repeat_status.clone(),
|
||||
latest_clazz_created_at: self.latest_clazz_created_at.clone(),
|
||||
org_id: self.org_id.clone(),
|
||||
department_id: self.department_id.clone(),
|
||||
};
|
||||
req_repeat
|
||||
}
|
||||
@@ -619,6 +625,7 @@ pub struct ReqClazz {
|
||||
pub is_notified: Option<bool>,
|
||||
pub completed_at: Option<NaiveDateTime>,
|
||||
pub org_id: Option<String>,
|
||||
pub department_id: Option<String>,
|
||||
}
|
||||
|
||||
impl ReqClazz {
|
||||
@@ -652,6 +659,7 @@ impl ReqClazz {
|
||||
is_notified: None,
|
||||
completed_at: None,
|
||||
org_id: None,
|
||||
department_id: None,
|
||||
}
|
||||
};
|
||||
|
||||
@@ -689,6 +697,7 @@ impl ReqClazz {
|
||||
is_notified: the_kecheng.is_notified,
|
||||
completed_at: the_kecheng.completed_at,
|
||||
org_id: the_kecheng.org_id,
|
||||
department_id: the_kecheng.department_id.clone(),
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -705,6 +714,7 @@ pub struct ReqClazzRepeat {
|
||||
pub repeat_status: Option<String>,
|
||||
pub latest_clazz_created_at: Option<NaiveDateTime>,
|
||||
pub org_id: Option<String>,
|
||||
pub department_id: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug, Clone)]
|
||||
@@ -1167,6 +1177,7 @@ pub struct ClazzAttendance {
|
||||
pub created_by: Option<String>,
|
||||
pub is_delete: Option<bool>,
|
||||
pub org_id: Option<String>,
|
||||
pub department_id: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Insertable, Clone, Debug)]
|
||||
@@ -1184,6 +1195,7 @@ pub struct NewClazzAttendance {
|
||||
pub created_by: Option<String>,
|
||||
pub is_delete: Option<bool>,
|
||||
pub org_id: Option<String>,
|
||||
pub department_id: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug, Clone)]
|
||||
@@ -1524,6 +1536,7 @@ impl ClazzAttendance {
|
||||
created_by: operator_id.clone(),
|
||||
is_delete: Some(false),
|
||||
org_id: None,
|
||||
department_id: None,
|
||||
})
|
||||
.collect();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user