Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions huntflow_api_client/models/request/applicants.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ class ApplicantSocial(BaseModel):
value: str = Field(..., description="Value")


class ApplicantSite(BaseModel):
site_type: Literal["MAX"] = Field(..., description="Type")
value: str = Field(..., description="Value")


class ApplicantCreateRequest(Applicant, JsonRequestModel):
birthday: Optional[date] = Field(None, description="Date of birth")
externals: Optional[List[ApplicantResumeCreate]] = Field(
Expand All @@ -43,6 +48,11 @@ class ApplicantCreateRequest(Applicant, JsonRequestModel):
max_length=1,
description="List of applicant's social accounts",
)
site: List[ApplicantSite] = Field(
[],
max_length=1,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

max_items=1 why?

description="List of applicant's sites",
)


class ApplicantUpdateRequest(Applicant, JsonRequestModel):
Expand All @@ -52,6 +62,11 @@ class ApplicantUpdateRequest(Applicant, JsonRequestModel):
max_length=1,
description="List of applicant's social accounts",
)
site: Optional[List[ApplicantSite]] = Field(
None,
max_length=1,
description="List of applicant's sites",
)


class ApplicantEvent(BaseModel):
Expand Down
8 changes: 8 additions & 0 deletions huntflow_api_client/models/response/applicants.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,12 @@ class ApplicantSocial(BaseModel):
verification_date: Optional[datetime] = Field(None, description="Verification date")


class ApplicantSite(BaseModel):
id: PositiveInt = Field(..., description="Site ID")
site_type: str = Field(..., description="Type")
value: str = Field(..., description="Value")


class ApplicantItem(Applicant):
id: int = Field(..., description="Applicant ID")
account: int = Field(..., description="Organization ID")
Expand All @@ -87,6 +93,7 @@ class ApplicantItem(Applicant):
)
doubles: List[ApplicantDouble] = Field(..., description="List of duplicates")
social: List[ApplicantSocial] = Field(..., description="List of applicant's social accounts")
site: List[ApplicantSite] = Field(..., description="List of applicant's sites")


class ApplicantListResponse(PaginatedResponse):
Expand All @@ -112,6 +119,7 @@ class ApplicantCreateResponse(Applicant):
)
external: List[ApplicantResume] = Field(..., description="Applicant's resume")
social: List[ApplicantSocial] = Field(..., description="List of applicant's social accounts")
site: List[ApplicantSite] = Field(..., description="List of applicant's sites")


class ApplicantSearchItem(BaseModel):
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

[project]
name = "huntflow-api-client"
version = "2.13.3"
version = "2.13.4"
description = "Huntflow API Client for Python"
authors = [
{name = "Developers huntflow", email = "developer@huntflow.ru"},
Expand Down
23 changes: 23 additions & 0 deletions tests/test_entities/test_applicants.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
"agreement": None,
"doubles": [],
"social": [],
"site": [],
},
{
"first_name": "Test",
Expand Down Expand Up @@ -96,6 +97,7 @@
"agreement": {"state": None, "decision_date": None},
"doubles": [],
"social": [],
"site": [],
},
],
}
Expand Down Expand Up @@ -144,6 +146,13 @@
"verification_date": "2020-01-01T00:00:00+03:00",
},
],
"site": [
{
"id": 1,
"site_type": "MAX",
"value": "https://max.ru/u/1xBeccJnjIvmlJflCNJjZOVtCJXNzrciOTWpebTSQLPspjUoBgj",
},
],
}
APPLICANT_CREATE_REQUEST: Dict[str, Any] = {
"first_name": "John",
Expand All @@ -166,6 +175,12 @@
},
],
"social": [{"social_type": "TELEGRAM", "value": "TelegramUsername"}],
"site": [
{
"site_type": "MAX",
"value": "https://max.ru/u/1xBeccJnjIvmlJflCNJjZOVtCJXNzrciOTWpebTSQLPspjUoBgj",
},
],
}
APPLICANT_CREATE_RESPONSE: Dict[str, Any] = {
"first_name": "John",
Expand Down Expand Up @@ -201,6 +216,13 @@
"verification_date": "2020-01-01T00:00:00+03:00",
},
],
"site": [
{
"id": 1,
"site_type": "MAX",
"value": "https://max.ru/u/1xBeccJnjIvmlJflCNJjZOVtCJXNzrciOTWpebTSQLPspjUoBgj",
},
],
}
APPLICANT_PATCH_REQUEST: Dict[str, Any] = {"first_name": "Newname", "social": []}
APPLICANT_PATCH_RESPONSE: Dict[str, Any] = {
Expand Down Expand Up @@ -248,6 +270,7 @@
"verification_date": "2020-01-01T00:00:00+03:00",
},
],
"site": [],
}

APPLICANT_SEARCH_BY_CURSOR_RESPONSE = {
Expand Down
Loading