44from pydantic import BaseModel , Field
55
66from huntflow_webhook_models .common_models .calendar_event import ApplicantLogCalendarEvent
7- from huntflow_webhook_models .common_models .hf_base import AccountFile
7+ from huntflow_webhook_models .common_models .hf_base import AccountFile , VacancyQuotaItem
88from huntflow_webhook_models .common_models .survey_questionary import SurveyQuestionary
99from huntflow_webhook_models .common_models .vacancy import Vacancy
1010from huntflow_webhook_models .consts import AgreementState , ApplicantLogType , SurveyType
@@ -37,13 +37,35 @@ class ApplicantPDAgreement(BaseModel):
3737
3838class VacancyApplicantStatus (BaseModel ):
3939 id : int = Field (..., description = "Status ID" , examples = [1 ])
40- name : str = Field (..., description = "Status name" , examples = ["hired" ])
4140
4241
4342class ApplicantPhoto (AccountFile ):
4443 pass
4544
4645
46+ class ApplicantExternalAccountSource (BaseModel ):
47+ id : int = Field (..., description = "Applicant external account source ID" , examples = [1 ])
48+ name : Optional [str ] = Field (
49+ ...,
50+ description = "Applicant external account source name" ,
51+ examples = ["Headhunter" ],
52+ )
53+
54+
55+ class ApplicantExternalAccount (BaseModel ):
56+ id : int = Field (..., description = "External ID" , examples = [1 ])
57+ auth_type : str = Field (..., description = "Authentication type" , examples = ["NATIVE" ])
58+ account_source : Optional [ApplicantExternalAccountSource ] = Field (
59+ None ,
60+ description = "Applicant external account source" ,
61+ )
62+ updated : Optional [datetime ] = Field (
63+ None ,
64+ description = "Date the applicant external account was modified" ,
65+ examples = [datetime (1970 , 1 , 1 , 1 , 1 , 1 )],
66+ )
67+
68+
4769class Applicant (BaseModel ):
4870 id : int = Field (..., description = "Applicant ID" , examples = [1 ])
4971 email : Optional [str ] = Field (
@@ -81,6 +103,7 @@ class Applicant(BaseModel):
81103 phone : Optional [str ] = Field (None , description = "Applicant's phone" , examples = ["+99999999" ])
82104 skype : Optional [str ] = Field (None , description = "Applicant's skype" , examples = ["test_skype" ])
83105 photo : Optional [ApplicantPhoto ] = Field (None , description = "Applicant's photo" )
106+ has_photo : bool = Field (..., description = "Does the applicant have a photo?" , examples = [False ])
84107 social : List [ApplicantSocial ] = Field ([], description = "Applicant social media list" )
85108 questionary : Optional [datetime ] = Field (
86109 None ,
@@ -96,6 +119,7 @@ class Applicant(BaseModel):
96119 description = "Additional fields" ,
97120 examples = [{"favorite_language" : "python" }],
98121 )
122+ externals : Optional [List [ApplicantExternalAccount ]] = None
99123
100124
101125class Respondent (BaseModel ):
@@ -191,6 +215,10 @@ class ApplicantLog(BaseModel):
191215 description = "Calendar event data" ,
192216 )
193217 vacancy : Optional [Vacancy ] = Field (None , description = "Vacancy data" )
218+ hired_in_fill_quota : Optional [VacancyQuotaItem ] = Field (
219+ None ,
220+ description = "Quota data by which applicant was hired" ,
221+ )
194222
195223
196224class ApplicantTag (BaseModel ):
0 commit comments