mirror of
https://github.com/danbulant/Portfolio
synced 2026-06-17 13:31:12 +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 details_filled: bool,
|
||||
pub encrypted_by: Option<i32>,
|
||||
pub field_of_study: String,
|
||||
}
|
||||
|
||||
/// Create candidate (admin endpoint)
|
||||
|
|
@ -97,6 +98,7 @@ impl NewCandidateResponse {
|
|||
private_key: &String,
|
||||
c: candidate::Model,
|
||||
) -> Result<Self, ServiceError> {
|
||||
let field_of_study = FieldOfStudy::from(current_application).into();
|
||||
let id_number = EncryptedString::from(c.personal_identification_number.to_owned())
|
||||
.decrypt(private_key)
|
||||
.await?;
|
||||
|
|
@ -109,6 +111,7 @@ impl NewCandidateResponse {
|
|||
personal_id_number: id_number,
|
||||
details_filled: encrypted_details.is_filled(),
|
||||
encrypted_by: c.encrypted_by_id,
|
||||
field_of_study,
|
||||
})
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue