talentro-commons 0.19.4__tar.gz → 0.19.5__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {talentro_commons-0.19.4 → talentro_commons-0.19.5}/PKG-INFO +1 -1
- {talentro_commons-0.19.4 → talentro_commons-0.19.5}/pyproject.toml +1 -1
- {talentro_commons-0.19.4 → talentro_commons-0.19.5}/src/talentro/acquisition/dataclasses.py +1 -1
- {talentro_commons-0.19.4 → talentro_commons-0.19.5}/src/talentro/candidates/dataclasses.py +58 -6
- {talentro_commons-0.19.4 → talentro_commons-0.19.5}/src/talentro/candidates/models.py +1 -1
- {talentro_commons-0.19.4 → talentro_commons-0.19.5}/README.md +0 -0
- {talentro_commons-0.19.4 → talentro_commons-0.19.5}/src/talentro/__init__.py +0 -0
- {talentro_commons-0.19.4 → talentro_commons-0.19.5}/src/talentro/acquisition/__init__.py +0 -0
- {talentro_commons-0.19.4 → talentro_commons-0.19.5}/src/talentro/acquisition/models.py +0 -0
- {talentro_commons-0.19.4 → talentro_commons-0.19.5}/src/talentro/billing/__init__.py +0 -0
- {talentro_commons-0.19.4 → talentro_commons-0.19.5}/src/talentro/billing/dataclasses.py +0 -0
- {talentro_commons-0.19.4 → talentro_commons-0.19.5}/src/talentro/billing/models.py +0 -0
- {talentro_commons-0.19.4 → talentro_commons-0.19.5}/src/talentro/candidates/__init__.py +0 -0
- {talentro_commons-0.19.4 → talentro_commons-0.19.5}/src/talentro/constants.py +0 -0
- {talentro_commons-0.19.4 → talentro_commons-0.19.5}/src/talentro/event.py +0 -0
- {talentro_commons-0.19.4 → talentro_commons-0.19.5}/src/talentro/exceptions.py +0 -0
- {talentro_commons-0.19.4 → talentro_commons-0.19.5}/src/talentro/general/__init__.py +0 -0
- {talentro_commons-0.19.4 → talentro_commons-0.19.5}/src/talentro/general/dataclasses.py +0 -0
- {talentro_commons-0.19.4 → talentro_commons-0.19.5}/src/talentro/general/models.py +0 -0
- {talentro_commons-0.19.4 → talentro_commons-0.19.5}/src/talentro/iam/__init__.py +0 -0
- {talentro_commons-0.19.4 → talentro_commons-0.19.5}/src/talentro/iam/dataclasses.py +0 -0
- {talentro_commons-0.19.4 → talentro_commons-0.19.5}/src/talentro/iam/models.py +0 -0
- {talentro_commons-0.19.4 → talentro_commons-0.19.5}/src/talentro/iam/types.py +0 -0
- {talentro_commons-0.19.4 → talentro_commons-0.19.5}/src/talentro/integrations/__init__.py +0 -0
- {talentro_commons-0.19.4 → talentro_commons-0.19.5}/src/talentro/integrations/dataclasses.py +0 -0
- {talentro_commons-0.19.4 → talentro_commons-0.19.5}/src/talentro/integrations/models.py +0 -0
- {talentro_commons-0.19.4 → talentro_commons-0.19.5}/src/talentro/services/__init__.py +0 -0
- {talentro_commons-0.19.4 → talentro_commons-0.19.5}/src/talentro/services/billing.py +0 -0
- {talentro_commons-0.19.4 → talentro_commons-0.19.5}/src/talentro/services/caching.py +0 -0
- {talentro_commons-0.19.4 → talentro_commons-0.19.5}/src/talentro/services/clients.py +0 -0
- {talentro_commons-0.19.4 → talentro_commons-0.19.5}/src/talentro/services/db.py +0 -0
- {talentro_commons-0.19.4 → talentro_commons-0.19.5}/src/talentro/services/google_storage.py +0 -0
- {talentro_commons-0.19.4 → talentro_commons-0.19.5}/src/talentro/services/rabbitmq.py +0 -0
- {talentro_commons-0.19.4 → talentro_commons-0.19.5}/src/talentro/util/__init__.py +0 -0
- {talentro_commons-0.19.4 → talentro_commons-0.19.5}/src/talentro/util/attributes.py +0 -0
- {talentro_commons-0.19.4 → talentro_commons-0.19.5}/src/talentro/util/enum.py +0 -0
- {talentro_commons-0.19.4 → talentro_commons-0.19.5}/src/talentro/util/files.py +0 -0
- {talentro_commons-0.19.4 → talentro_commons-0.19.5}/src/talentro/util/singleton.py +0 -0
- {talentro_commons-0.19.4 → talentro_commons-0.19.5}/src/talentro/util/string.py +0 -0
- {talentro_commons-0.19.4 → talentro_commons-0.19.5}/src/talentro/util/vacancy.py +0 -0
- {talentro_commons-0.19.4 → talentro_commons-0.19.5}/src/talentro/vacancies/__init__.py +0 -0
- {talentro_commons-0.19.4 → talentro_commons-0.19.5}/src/talentro/vacancies/dataclasses.py +0 -0
- {talentro_commons-0.19.4 → talentro_commons-0.19.5}/src/talentro/vacancies/models.py +0 -0
- {talentro_commons-0.19.4 → talentro_commons-0.19.5}/src/talentro/vacancies/taxanomy.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[tool.poetry]
|
|
2
2
|
name = "talentro-commons"
|
|
3
|
-
version = "0.19.
|
|
3
|
+
version = "0.19.5"
|
|
4
4
|
description = "This package contains all globally used code, services, models and data structures for Talentro"
|
|
5
5
|
authors = ["Emiel van Essen <emiel@marksmen.nl>"]
|
|
6
6
|
license = "Proprietary"
|
|
@@ -120,7 +120,7 @@ class AdInfo(ResolvableCompanyModel):
|
|
|
120
120
|
campaign: CampaignInfo
|
|
121
121
|
|
|
122
122
|
@staticmethod
|
|
123
|
-
async def resolve_object(object_id: UUID, organization_id:
|
|
123
|
+
async def resolve_object(object_id: UUID, organization_id: UUID) -> "AdInfo | None":
|
|
124
124
|
cache = CacheService()
|
|
125
125
|
|
|
126
126
|
cache_key = f"resolver:org:{organization_id}:ad_id:{object_id}"
|
|
@@ -3,9 +3,11 @@ from typing import Optional
|
|
|
3
3
|
from uuid import UUID
|
|
4
4
|
|
|
5
5
|
from pydantic import BaseModel
|
|
6
|
-
from talentro.acquisition.dataclasses import CampaignInfo
|
|
6
|
+
from talentro.acquisition.dataclasses import CampaignInfo, AdInfo
|
|
7
7
|
from talentro.candidates.models import Application as ApplicationModel, Document as DocumentModel, \
|
|
8
|
-
Candidate as CandidateModel
|
|
8
|
+
Candidate as CandidateModel, Source as SourceModel
|
|
9
|
+
from talentro.services.caching import CacheService
|
|
10
|
+
from talentro.services.clients import MSClient
|
|
9
11
|
from talentro.vacancies.dataclasses import VacancyInfo
|
|
10
12
|
|
|
11
13
|
|
|
@@ -75,6 +77,56 @@ class DocumentInfo(BaseModel):
|
|
|
75
77
|
)
|
|
76
78
|
|
|
77
79
|
|
|
80
|
+
class SourceInfo(BaseModel):
|
|
81
|
+
id: UUID
|
|
82
|
+
created_at: datetime
|
|
83
|
+
updated_at: Optional[datetime]
|
|
84
|
+
organization: UUID
|
|
85
|
+
|
|
86
|
+
campaign: Optional[CampaignInfo]
|
|
87
|
+
ad: Optional[AdInfo]
|
|
88
|
+
|
|
89
|
+
application_count: Optional[int]
|
|
90
|
+
|
|
91
|
+
@classmethod
|
|
92
|
+
async def from_model(cls: "SourceInfo", model: SourceModel, application_count: int) -> 'SourceInfo':
|
|
93
|
+
if model.campaign_id:
|
|
94
|
+
campaign = await CampaignInfo.resolve_object(model.campaign_id, model.organization)
|
|
95
|
+
else:
|
|
96
|
+
campaign = None
|
|
97
|
+
|
|
98
|
+
if model.ad_id:
|
|
99
|
+
ad = await AdInfo.resolve_object(model.ad_id, model.organization)
|
|
100
|
+
else:
|
|
101
|
+
ad = None
|
|
102
|
+
|
|
103
|
+
return SourceInfo(
|
|
104
|
+
id=model.id,
|
|
105
|
+
created_at=model.created_at,
|
|
106
|
+
updated_at=model.updated_at,
|
|
107
|
+
organization=model.organization,
|
|
108
|
+
campaign=campaign,
|
|
109
|
+
ad=ad,
|
|
110
|
+
application_count=application_count,
|
|
111
|
+
)
|
|
112
|
+
|
|
113
|
+
@staticmethod
|
|
114
|
+
async def resolve_object(object_id: UUID, organization_id: UUID) -> "SourceInfo | None":
|
|
115
|
+
cache = CacheService()
|
|
116
|
+
|
|
117
|
+
cache_key = f"resolver:org:{organization_id}:source_id:{object_id}"
|
|
118
|
+
|
|
119
|
+
if value := await cache.get(cache_key):
|
|
120
|
+
return value
|
|
121
|
+
|
|
122
|
+
result = await MSClient.candidates().get(f"sources/{object_id}/resolve", headers={"X-Organization-ID": str(organization_id)})
|
|
123
|
+
|
|
124
|
+
if result.status_code != 200:
|
|
125
|
+
return None
|
|
126
|
+
|
|
127
|
+
return SourceInfo(**result.json())
|
|
128
|
+
|
|
129
|
+
|
|
78
130
|
class ApplicationInfo(BaseModel):
|
|
79
131
|
id: UUID
|
|
80
132
|
created_at: datetime
|
|
@@ -84,8 +136,8 @@ class ApplicationInfo(BaseModel):
|
|
|
84
136
|
status: str
|
|
85
137
|
screening_answers: dict
|
|
86
138
|
|
|
139
|
+
source: Optional[SourceInfo]
|
|
87
140
|
vacancy: Optional[VacancyInfo]
|
|
88
|
-
campaign: Optional[CampaignInfo]
|
|
89
141
|
candidate: Optional[CandidateInfo]
|
|
90
142
|
|
|
91
143
|
documents: list[DocumentInfo]
|
|
@@ -93,9 +145,9 @@ class ApplicationInfo(BaseModel):
|
|
|
93
145
|
@classmethod
|
|
94
146
|
async def from_model(cls: "ApplicationInfo", model: ApplicationModel) -> 'ApplicationInfo':
|
|
95
147
|
if model.source:
|
|
96
|
-
|
|
148
|
+
source = await SourceInfo.resolve_object(model.source.id, model.organization)
|
|
97
149
|
else:
|
|
98
|
-
|
|
150
|
+
source = None
|
|
99
151
|
|
|
100
152
|
if model.vacancy_id:
|
|
101
153
|
vacancy = await VacancyInfo.resolve_object(model.vacancy_id, model.organization)
|
|
@@ -116,8 +168,8 @@ class ApplicationInfo(BaseModel):
|
|
|
116
168
|
screening_answers=model.screening_answers,
|
|
117
169
|
status=model.status,
|
|
118
170
|
|
|
171
|
+
source=source,
|
|
119
172
|
vacancy=vacancy,
|
|
120
|
-
campaign=campaign,
|
|
121
173
|
candidate=candidate,
|
|
122
174
|
|
|
123
175
|
documents=[await DocumentInfo.from_model(document) for document in model.documents],
|
|
@@ -57,7 +57,7 @@ class Application(CandidatesOrganizationModel, table=True):
|
|
|
57
57
|
|
|
58
58
|
class Source(CandidatesOrganizationModel, table=True):
|
|
59
59
|
source: str = Field(index=True)
|
|
60
|
-
event_id: Optional[str] = Field(index=True)
|
|
61
60
|
campaign_id: Optional[UUID] = Field(index=True)
|
|
61
|
+
ad_id: Optional[UUID] = Field(index=True, nullable=True)
|
|
62
62
|
|
|
63
63
|
applications: list["Application"] = Relationship(back_populates="source")
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{talentro_commons-0.19.4 → talentro_commons-0.19.5}/src/talentro/integrations/dataclasses.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|