
    si                     X   d dl mZ d dlmZmZmZ d dlmZmZm	Z	m
Z
mZmZ d dlmZmZ ddlmZ  G d dej$                        Z G d	 d
ej$                        Z G d dej$                        Z G d dej$                        Z G d dej$                        Z G d dej$                        Z G d dej$                        Z G d dej$                        Z G d dej$                        Z G d dej$                        Z G d dej$                        Z G d dej$                        Zy)     )serializers)
DepartmentEmployeeTypeJobPosition)
ActiontypeDisciplinaryActionEmployeeEmployeeBankDetailsEmployeeWorkInformationPolicy)DocumentDocumentRequest   )get_next_badge_idc                        e Zd Z G d d      Zy)ActiontypeSerializerc                       e Zd ZeZg dZy)ActiontypeSerializer.Meta)idtitleaction_typeN)__name__
__module____qualname__r   modelfields     T/var/www/python-projects/worksol/horilla_api/api_serializers/employee/serializers.pyMetar      s    /r   r    Nr   r   r   r    r   r   r   r   r      s    0 0r   r   c                       e Zd Z ej                  dd      Z ej                  dd      Z ej                  dd      Z G d d      Zy)	EmployeeListSerializer/employee_work_info.job_position_id.job_positionTsource	read_onlyemployee_work_info.idemployee_bank_details.idc                       e Zd ZeZg dZy)EmployeeListSerializer.Meta)r   employee_first_nameemployee_last_nameemailjob_position_nameemployee_work_info_idemployee_profileemployee_bank_details_idNr   r   r   r	   r   r   r   r   r   r    r+   "   s    	
r   r    N)	r   r   r   r   	CharFieldr/   r0   r2   r    r   r   r   r#   r#      sX    ---@D 2K11&$  5{44)T 
 
r   r#   c                   "    e Zd Z ej                  dd      Z ej                  dd      Z ej                  dd      Z ej                  dd      Z ej                  dd      Z	 ej                  dd      Z
 G d	 d
      Z fdZ xZS )EmployeeSerializerz+employee_work_info.department_id.departmentTr%   z#employee_work_info.department_id.idr$   z%employee_work_info.job_position_id.idr(   r)   c                       e Zd ZeZdZy)EmployeeSerializer.Meta__all__Nr3   r   r   r   r    r8   D       r   r    c                 <    t               |d<   t        | 	  |      S )Nbadge_id)r   supercreate)selfvalidated_data	__class__s     r   r>   zEmployeeSerializer.createH   s    %6%8z"w~n--r   )r   r   r   r   r4   department_namedepartment_idr/   job_position_idr0   r2   r    r>   __classcell__)rA   s   @r   r6   r6   0   s    +k++<O *K))4M .--@D ,k++6$O 2K11&$  5{44)T  . .r   r6   c                      e Zd Z ej                  dd      Z ej                  dd      Z ej                  dd      Z ej                  dd      Z ej                  dd      Z	 ej                  dd      Z
 ej                  d	d      Z ej                  d
d      Z ej                         Zd Z G d d      Zy)!EmployeeWorkInformationSerializerzjob_position_id.job_positionTr%   zdepartment_id.departmentzshift_id.employee_shiftzemployee_type_id.employee_typez(reporting_manager_id.employee_first_namez'reporting_manager_id.employee_last_namezwork_type_id.work_typezcompany_id.companyc                     |j                   j                         D cg c]&  }|j                  |j                  |j                  d( c}S c c}w )N)r   r   color)tagsallr   r   rI   )r?   objtags      r   get_tagsz*EmployeeWorkInformationSerializer.get_tagsd   sA     xx||~
 66CII		B
 	
 
s   +Ac                       e Zd ZeZdZy)&EmployeeWorkInformationSerializer.Metar9   N)r   r   r   r   r   r   r   r   r   r    rP   j   s    'r   r    N)r   r   r   r   r4   r/   rB   
shift_nameemployee_type_namereporting_manager_first_namereporting_manager_last_namework_type_namecompany_nameSerializerMethodFieldrJ   rN   r    r   r   r   rG   rG   M   s    ---- ,k++)TO '&&.GSWXJ.../4 $9;#8#89T$  #8+"7"78D# +[**'4N );((0DPTUL,;,,.D
 r   rG   c                        e Zd Z G d d      Zy)EmployeeBankDetailsSerializerc                       e Zd ZeZdZy)"EmployeeBankDetailsSerializer.Metar9   N)r   r   r   r
   r   r   r   r   r   r    r[   p   s    #r   r    Nr!   r   r   r   rY   rY   o        r   rY   c                        e Zd Z G d d      Zy)EmployeeTypeSerializerc                       e Zd ZeZdZy)EmployeeTypeSerializer.Metar9   N)r   r   r   r   r   r   r   r   r   r    r`   v   s    r   r    Nr!   r   r   r   r^   r^   u   r\   r   r^   c                        e Zd Z G d d      Zy)EmployeeBulkUpdateSerializerc                       e Zd ZeZdgZy)!EmployeeBulkUpdateSerializer.Metar-   Nr3   r   r   r   r    rd   |   s      !
r   r    Nr!   r   r   r   rb   rb   {   s    
 
r   rb   c                        e Zd Z G d d      Zy)DisciplinaryActionSerializerc                       e Zd ZeZdZy)!DisciplinaryActionSerializer.Metar9   N)r   r   r   r   r   r   r   r   r   r    rh      s    "r   r    Nr!   r   r   r   rf   rf      r\   r   rf   c                        e Zd Z G d d      Zy)PolicySerializerc                       e Zd ZeZdZy)PolicySerializer.Metar9   N)r   r   r   r   r   r   r   r   r   r    rl      s    r   r    Nr!   r   r   r   rj   rj      r\   r   rj   c                        e Zd Z G d d      Zy)DocumentRequestSerializerc                       e Zd ZeZdZy)DocumentRequestSerializer.Metar9   N)r   r   r   r   r   r   r   r   r   r    rp      s    r   r    Nr!   r   r   r   rn   rn      r\   r   rn   c                        e Zd Z G d d      Zy)DocumentSerializerc                       e Zd ZeZdZy)DocumentSerializer.Metar9   N)r   r   r   r   r   r   r   r   r   r    rt      r:   r   r    Nr!   r   r   r   rr   rr      r\   r   rr   c                        e Zd Z G d d      Zy)EmployeeSelectorSerializerc                       e Zd ZeZg dZy)EmployeeSelectorSerializer.Meta)r   r,   r-   r<   r1   Nr3   r   r   r   r    rx      s    
r   r    Nr!   r   r   r   rv   rv      s    
 
r   rv   N)rest_frameworkr   base.modelsr   r   r   employee.modelsr   r   r	   r
   r   r   horilla_documents.modelsr   r   api_methods.employee.methodsr   ModelSerializerr   r#   r6   rG   rY   r^   rb   rf   rj   rn   rr   rv   r   r   r   <module>r      s    & = =  ? =0;66 0
[88 
2.44 .:(C(C DK$?$? [88 
;#>#> 
,;#>#> {22  ; ; 44 	
!<!< 	
r   