fix: add department_id to ReqClazz and ReqClazzRepeat structs
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:
2026-05-03 09:45:57 +08:00
parent fa14a5ca8c
commit 63bd9cd8ff
3 changed files with 16 additions and 0 deletions
+2
View File
@@ -862,6 +862,7 @@ async fn raw_create_clazz_with_repeat(
is_notified: in_kecheng.is_notified.clone(), is_notified: in_kecheng.is_notified.clone(),
completed_at: None, completed_at: None,
org_id: in_kecheng.org_id.clone(), org_id: in_kecheng.org_id.clone(),
department_id: in_kecheng.department_id.clone(),
}; };
if to_create_kecheng.org_id.is_none() { if to_create_kecheng.org_id.is_none() {
to_create_kecheng.org_id = current_org_id.clone(); 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(), repeat_status: kecheng_repeat_copy.repeat_status.clone(),
latest_clazz_created_at: kecheng_repeat_copy.latest_clazz_created_at.clone(), latest_clazz_created_at: kecheng_repeat_copy.latest_clazz_created_at.clone(),
org_id: kecheng_repeat_copy.org_id.clone(), org_id: kecheng_repeat_copy.org_id.clone(),
department_id: kecheng_repeat_copy.department_id.clone(),
}) })
} }
+1
View File
@@ -72,6 +72,7 @@ async fn raw_create_clazz_repeat(
repeat_status: in_kecheng_repeat.repeat_status.clone(), repeat_status: in_kecheng_repeat.repeat_status.clone(),
latest_clazz_created_at: in_kecheng_repeat.latest_clazz_created_at.clone(), latest_clazz_created_at: in_kecheng_repeat.latest_clazz_created_at.clone(),
org_id: in_kecheng_repeat.org_id.clone(), org_id: in_kecheng_repeat.org_id.clone(),
department_id: in_kecheng_repeat.department_id.clone(),
}; };
let created_kecheng_repeat_result = ClazzRepeat::create( let created_kecheng_repeat_result = ClazzRepeat::create(
+13
View File
@@ -52,6 +52,7 @@ pub struct Clazz {
pub is_notified: Option<bool>, pub is_notified: Option<bool>,
pub completed_at: Option<NaiveDateTime>, pub completed_at: Option<NaiveDateTime>,
pub org_id: Option<String>, pub org_id: Option<String>,
pub department_id: Option<String>,
} }
// https://weinan.io/2024/02/23/rust-diesel.html // https://weinan.io/2024/02/23/rust-diesel.html
@@ -152,6 +153,7 @@ impl ReqClazzWithRepeat {
is_notified: None, is_notified: None,
completed_at: None, completed_at: None,
org_id: None, org_id: None,
department_id: None,
} }
}; };
@@ -169,6 +171,7 @@ impl ReqClazzWithRepeat {
repeat_status: None, repeat_status: None,
latest_clazz_created_at: None, latest_clazz_created_at: None,
org_id: None, org_id: None,
department_id: None,
} }
}; };
@@ -232,6 +235,7 @@ impl Clazz {
is_notified: self.is_notified.clone(), is_notified: self.is_notified.clone(),
completed_at: self.completed_at.clone(), completed_at: self.completed_at.clone(),
org_id: self.org_id.clone(), org_id: self.org_id.clone(),
department_id: self.department_id.clone(),
}; };
req_res req_res
} }
@@ -453,6 +457,7 @@ pub struct ClazzRepeat {
pub repeat_status: Option<String>, pub repeat_status: Option<String>,
pub latest_clazz_created_at: Option<NaiveDateTime>, pub latest_clazz_created_at: Option<NaiveDateTime>,
pub org_id: Option<String>, pub org_id: Option<String>,
pub department_id: Option<String>,
} }
impl ClazzRepeat { impl ClazzRepeat {
@@ -485,6 +490,7 @@ impl ClazzRepeat {
repeat_status: self.repeat_status.clone(), repeat_status: self.repeat_status.clone(),
latest_clazz_created_at: self.latest_clazz_created_at.clone(), latest_clazz_created_at: self.latest_clazz_created_at.clone(),
org_id: self.org_id.clone(), org_id: self.org_id.clone(),
department_id: self.department_id.clone(),
}; };
req_repeat req_repeat
} }
@@ -619,6 +625,7 @@ pub struct ReqClazz {
pub is_notified: Option<bool>, pub is_notified: Option<bool>,
pub completed_at: Option<NaiveDateTime>, pub completed_at: Option<NaiveDateTime>,
pub org_id: Option<String>, pub org_id: Option<String>,
pub department_id: Option<String>,
} }
impl ReqClazz { impl ReqClazz {
@@ -652,6 +659,7 @@ impl ReqClazz {
is_notified: None, is_notified: None,
completed_at: None, completed_at: None,
org_id: None, org_id: None,
department_id: None,
} }
}; };
@@ -689,6 +697,7 @@ impl ReqClazz {
is_notified: the_kecheng.is_notified, is_notified: the_kecheng.is_notified,
completed_at: the_kecheng.completed_at, completed_at: the_kecheng.completed_at,
org_id: the_kecheng.org_id, 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 repeat_status: Option<String>,
pub latest_clazz_created_at: Option<NaiveDateTime>, pub latest_clazz_created_at: Option<NaiveDateTime>,
pub org_id: Option<String>, pub org_id: Option<String>,
pub department_id: Option<String>,
} }
#[derive(Serialize, Deserialize, Debug, Clone)] #[derive(Serialize, Deserialize, Debug, Clone)]
@@ -1167,6 +1177,7 @@ pub struct ClazzAttendance {
pub created_by: Option<String>, pub created_by: Option<String>,
pub is_delete: Option<bool>, pub is_delete: Option<bool>,
pub org_id: Option<String>, pub org_id: Option<String>,
pub department_id: Option<String>,
} }
#[derive(Insertable, Clone, Debug)] #[derive(Insertable, Clone, Debug)]
@@ -1184,6 +1195,7 @@ pub struct NewClazzAttendance {
pub created_by: Option<String>, pub created_by: Option<String>,
pub is_delete: Option<bool>, pub is_delete: Option<bool>,
pub org_id: Option<String>, pub org_id: Option<String>,
pub department_id: Option<String>,
} }
#[derive(Serialize, Deserialize, Debug, Clone)] #[derive(Serialize, Deserialize, Debug, Clone)]
@@ -1524,6 +1536,7 @@ impl ClazzAttendance {
created_by: operator_id.clone(), created_by: operator_id.clone(),
is_delete: Some(false), is_delete: Some(false),
org_id: None, org_id: None,
department_id: None,
}) })
.collect(); .collect();