[BE] Alter person table

This commit is contained in:
Araozu 2023-09-27 10:57:51 -05:00
parent 02e903469d
commit 6270bafb62
2 changed files with 5 additions and 1 deletions

View File

@ -26,6 +26,7 @@ pub async fn get_by_dni(dni: i32) -> (Status, Json<Person>) {
person_names: row.person_names, person_names: row.person_names,
person_paternal_surname: row.person_paternal_surname, person_paternal_surname: row.person_paternal_surname,
person_maternal_surname: row.person_maternal_surname, person_maternal_surname: row.person_maternal_surname,
person_classroom_id: None,
}; };
return (Status::Ok, Json(person)); return (Status::Ok, Json(person));

View File

@ -22,6 +22,8 @@ pub struct Person {
/// ///
/// Example: `Gomez` /// Example: `Gomez`
pub person_maternal_surname: String, pub person_maternal_surname: String,
/// Id of the online classroom user id linked to this user
pub person_classroom_id: Option<i32>
} }
impl Person { impl Person {
@ -32,6 +34,7 @@ impl Person {
person_names: "".to_string(), person_names: "".to_string(),
person_paternal_surname: "".to_string(), person_paternal_surname: "".to_string(),
person_maternal_surname: "".to_string(), person_maternal_surname: "".to_string(),
person_classroom_id: None,
} }
} }
@ -63,7 +66,7 @@ impl PersonCreate {
self.person_dni, self.person_dni,
self.person_names, self.person_names,
self.person_paternal_surname, self.person_paternal_surname,
self.person_maternal_surname self.person_maternal_surname,
) )
.execute(db) .execute(db)
.await?; .await?;