Skip to content

Commit 61b4e7e

Browse files
authored
Merge pull request #24 from huntflow/INT-667_fix_models
[INT-667] - Fix models.
2 parents 72c5a44 + 2b05bb4 commit 61b4e7e

File tree

4 files changed

+16
-2
lines changed

4 files changed

+16
-2
lines changed

Diff for: huntflow_webhook_models/common_models/applicant.py

+1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ class ApplicantPDAgreement(BaseModel):
3737

3838
class VacancyApplicantStatus(BaseModel):
3939
id: int = Field(..., description="Status ID", examples=[1])
40+
name: str = Field(..., description="Status name", examples=["hired"])
4041

4142

4243
class ApplicantPhoto(AccountFile):

Diff for: huntflow_webhook_models/common_models/vacancy_request.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import datetime
2-
from typing import Any, Dict
2+
from typing import Any, Dict, Optional
33

44
from pydantic import BaseModel, Field
55

@@ -38,3 +38,8 @@ class VacancyRequestLog(BaseModel):
3838
description="Date time vacancy request log created",
3939
examples=[datetime.datetime(1970, 1, 1, 1, 1, 1)],
4040
)
41+
reason: Optional[str] = Field(
42+
None,
43+
description="Vacancy close/hold reason",
44+
examples=["All hired"],
45+
)

Diff for: huntflow_webhook_models/vacancy.py

+8
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from typing import Optional
2+
13
from pydantic import BaseModel, Field
24

35
from huntflow_webhook_models.base import BaseHuntflowWebhookRequest, WebhookMetaInfoBase
@@ -13,9 +15,15 @@ class VacancyHookRequestMeta(WebhookMetaInfoBase):
1315
)
1416

1517

18+
class User(BaseModel):
19+
id: int = Field(..., description="User ID", examples=[1])
20+
name: str = Field(..., description="User name", examples=["[email protected]"])
21+
22+
1623
class VacancyEvent(BaseModel):
1724
vacancy: Vacancy
1825
vacancy_log: VacancyLog
26+
user: Optional[User] = Field(None, description="Recruiter who joined or left a vacancy")
1927

2028

2129
class VacancyHookRequest(BaseHuntflowWebhookRequest):

Diff for: pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
[project]
33
name = "huntflow-webhook-models"
4-
version = "0.1.8"
4+
version = "0.1.9"
55
description = "Huntflow webhooks requests data models"
66
authors = [
77
{name = "Developers huntflow", email = "[email protected]"},

0 commit comments

Comments
 (0)