talentro-commons 0.19.18__py3-none-any.whl → 0.19.19__py3-none-any.whl

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.
@@ -6,6 +6,7 @@ from pydantic import BaseModel
6
6
  from talentro.acquisition.dataclasses import CampaignInfo, AdInfo
7
7
  from talentro.candidates.models import Application as ApplicationModel, Document as DocumentModel, \
8
8
  Candidate as CandidateModel, Source as SourceModel
9
+ from talentro.general.dataclasses import FileData
9
10
  from talentro.services.caching import CacheService
10
11
  from talentro.services.clients import MSClient
11
12
  from talentro.vacancies.dataclasses import VacancyInfo
@@ -142,6 +143,22 @@ class ApplicationInfo(BaseModel):
142
143
 
143
144
  documents: list[DocumentInfo]
144
145
 
146
+ @staticmethod
147
+ async def resolve_object(object_id: UUID, organization_id: UUID) -> "ApplicationInfo | None":
148
+ cache = CacheService()
149
+
150
+ cache_key = f"resolver:org:{organization_id}:application_id:{object_id}"
151
+
152
+ if value := await cache.get(cache_key):
153
+ return value
154
+
155
+ result = await MSClient.candidates().get(f"applications/{object_id}", headers={"X-Organization-ID": str(organization_id)})
156
+
157
+ if result.status_code != 200:
158
+ return None
159
+
160
+ return ApplicationInfo(**result.json())
161
+
145
162
  @classmethod
146
163
  async def from_model(cls: "ApplicationInfo", model: ApplicationModel) -> 'ApplicationInfo':
147
164
  if model.source:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: talentro-commons
3
- Version: 0.19.18
3
+ Version: 0.19.19
4
4
  Summary: This package contains all globally used code, services, models and data structures for Talentro
5
5
  License: Proprietary
6
6
  Author: Emiel van Essen
@@ -6,7 +6,7 @@ talentro/billing/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,
6
6
  talentro/billing/dataclasses.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
7
7
  talentro/billing/models.py,sha256=rbmcJh-FcU5I3oFRhnD413YqIade1nxvqvksvEtCvMs,825
8
8
  talentro/candidates/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
9
- talentro/candidates/dataclasses.py,sha256=cJNngEWxQeSupAMjVsbHarMWZiRcK_c74wgpq9YYTyM,5001
9
+ talentro/candidates/dataclasses.py,sha256=I8fCbVLPvL5KXBFw2lSl9tzEQRjAos3BDkAMQ-8pHtA,5599
10
10
  talentro/candidates/models.py,sha256=8HDywWUf0X0ckgl8t6vtkglVEIMEe5RJoKOr0-yn0C0,2396
11
11
  talentro/constants.py,sha256=08CuJ1qVbgi4IDZThw7CQt_D65jGwekGrkMEg8eDGZo,861
12
12
  talentro/event.py,sha256=Xie-nosLwEpg35Hir9yCKtJBXM-_R4O1fyknOtG_6IY,4595
@@ -39,6 +39,6 @@ talentro/vacancies/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuF
39
39
  talentro/vacancies/dataclasses.py,sha256=E6H5fsZH4IwtBFSLDolzF6u39tEIrANtWiNVoB65P0c,15074
40
40
  talentro/vacancies/models.py,sha256=GoXr71CNzU6csf8gdmv84etb3Rm-Cdfigp1yqPI_jjQ,4822
41
41
  talentro/vacancies/taxanomy.py,sha256=B6DMq9Wbs0aXFwD9aZveSlLwAC9eq1iCO_KM-FmrV7M,6384
42
- talentro_commons-0.19.18.dist-info/METADATA,sha256=aMovPE1E6JoJaFPAU_D8YL0vGJG-j4Tf3kQU_ar9QqQ,1508
43
- talentro_commons-0.19.18.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
44
- talentro_commons-0.19.18.dist-info/RECORD,,
42
+ talentro_commons-0.19.19.dist-info/METADATA,sha256=8BqF3Zjtiom_hUyeejv7eexlPWGUJJehUry1sQxCANM,1508
43
+ talentro_commons-0.19.19.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
44
+ talentro_commons-0.19.19.dist-info/RECORD,,