ó
    ¾«i«
  ã                   ó8   • S SK Jr  S SKJrJrJr   " S S5      rg)é    )ÚOptional)ÚEmployeeMappingÚProjectMappingÚPayrollIntegrationc            	       ó¬   • \ rS rSrSr\S\S\S\\   4S j5       r	\S\S\S\\   4S j5       r
\S\S\S	\S\4S
 j5       r\S\S\S\S\4S j5       rSrg)ÚMappingServiceé   z2Service for handling employee and project mappingsÚuser_idÚpayroll_integrationÚreturnc                 óŽ   •  [         R                  R                  U USS9nUR                  $ ! [         R                   a     gf = f)z°
Get external employee ID for a user

Args:
    user_id: Internal user UUID
    payroll_integration: PayrollIntegration instance
    
Returns:
    External employee ID or None
T)r
   r   Ú	is_activeN)r   ÚobjectsÚgetÚexternal_employee_idÚDoesNotExist)r
   r   Úmappings      Ú1D:\TimeStamps\payroll\services\mapping_service.pyÚget_employee_mappingÚ#MappingService.get_employee_mapping   sQ   € ð	Ü%×-Ñ-×1Ñ1ØØ$7Øð 2ð ˆGð
 ×/Ñ/Ð/øÜ×+Ñ+ó 	Ùð	úó   ‚*- ­AÁAÚ
project_idc                 óŽ   •  [         R                  R                  U USS9nUR                  $ ! [         R                   a     gf = f)z»
Get external project code for a project

Args:
    project_id: Internal project UUID
    payroll_integration: PayrollIntegration instance
    
Returns:
    External project code or None
T)r   r   r   N)r   r   r   Úexternal_project_coder   )r   r   r   s      r   Úget_project_mappingÚ"MappingService.get_project_mapping   sQ   € ð	Ü$×,Ñ,×0Ñ0Ø%Ø$7Øð 1ð ˆGð
 ×0Ñ0Ð0øÜ×*Ñ*ó 	Ùð	úr   r   c                 óN   • [         R                  R                  U UUSS.S9u  p4U$ )z!Create or update employee mappingT)r   r   )r
   r   Údefaults)r   r   Úupdate_or_create)r
   r   r   r   Úcreateds        r   Úcreate_employee_mappingÚ&MappingService.create_employee_mapping4   s;   € ô +×2Ñ2×CÑCØØ 3à(<Ø!ñð Dð 
Ñˆð ˆó    r   c                 óN   • [         R                  R                  U UUSS.S9u  p4U$ )z Create or update project mappingT)r   r   )r   r   r   )r   r   r   )r   r   r   r   r    s        r   Úcreate_project_mappingÚ%MappingService.create_project_mappingE   s;   € ô *×1Ñ1×BÑBØ!Ø 3à)>Ø!ñð Cð 
Ñˆð ˆr#   © N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__ÚstaticmethodÚstrr   r   r   r   r   r!   r   r%   Ú__static_attributes__r'   r#   r   r   r      sÕ   † Ù<àð cð Ð@Rð ÐW_Ð`cÑWdó ó ðð* ð¨ð ÐBTð ÐYaÐbeÑYfó ó ðð* ðØðà/ðð "ðð 
ó	ó ðð  ðØðà/ðð  #ðð 
ó	ó ór#   r   N)Útypingr   Úpayroll.modelsr   r   r   r   r'   r#   r   Ú<module>r2      s   ðÝ ß NÑ N÷Oò Or#   