mirror of
https://github.com/danbulant/Portfolio
synced 2026-07-05 02:50:47 +00:00
feat: field of study in NewCandidateResponse
This commit is contained in:
parent
0b28b8d5aa
commit
f05045a799
1 changed files with 3 additions and 0 deletions
|
|
@ -44,6 +44,7 @@ pub struct NewCandidateResponse {
|
||||||
pub personal_id_number: String,
|
pub personal_id_number: String,
|
||||||
pub details_filled: bool,
|
pub details_filled: bool,
|
||||||
pub encrypted_by: Option<i32>,
|
pub encrypted_by: Option<i32>,
|
||||||
|
pub field_of_study: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Create candidate (admin endpoint)
|
/// Create candidate (admin endpoint)
|
||||||
|
|
@ -97,6 +98,7 @@ impl NewCandidateResponse {
|
||||||
private_key: &String,
|
private_key: &String,
|
||||||
c: candidate::Model,
|
c: candidate::Model,
|
||||||
) -> Result<Self, ServiceError> {
|
) -> Result<Self, ServiceError> {
|
||||||
|
let field_of_study = FieldOfStudy::from(current_application).into();
|
||||||
let id_number = EncryptedString::from(c.personal_identification_number.to_owned())
|
let id_number = EncryptedString::from(c.personal_identification_number.to_owned())
|
||||||
.decrypt(private_key)
|
.decrypt(private_key)
|
||||||
.await?;
|
.await?;
|
||||||
|
|
@ -109,6 +111,7 @@ impl NewCandidateResponse {
|
||||||
personal_id_number: id_number,
|
personal_id_number: id_number,
|
||||||
details_filled: encrypted_details.is_filled(),
|
details_filled: encrypted_details.is_filled(),
|
||||||
encrypted_by: c.encrypted_by_id,
|
encrypted_by: c.encrypted_by_id,
|
||||||
|
field_of_study,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
Reference in a new issue