
    oi?                        S SK Jr  S SK7  S SK7  S SKrS SKrS SKJr  S SKJ	r	  S SK
J
r
  S rS rS	 rS
 rS rS rS rS r " S S\R&                  5      r " S S\R&                  5      r " S S\R&                  5      r " S S\R&                  5      r " S S\R&                  5      r " S S\R&                  5      r " S S\R&                  5      r " S S\R&                  5      r " S S \R&                  5      r " S! S"\R&                  5      r " S# S$\R&                  5      r " S% S&\R&                  5      r " S' S(\R&                  5      r  " S) S*\R&                  5      r! " S+ S,\R&                  5      r" " S- S.\R&                  5      r# " S/ S0\R&                  5      r$ " S1 S2\R&                  5      r% " S3 S4\R&                  5      r& " S5 S6\R&                  5      r' " S7 S8\R&                  5      r( " S9 S:\R&                  5      r) " S; S<\R&                  5      r* " S= S>\R&                  5      r+ " S? S@\R&                  5      r, " SA SB\R&                  5      r- " SC SD\R&                  5      r. " SE SF\R&                  5      r/ " SG SH\R&                  5      r0 " SI SJ\R&                  5      r1 " SK SL\R&                  5      r2 " SM SN\R&                  5      r3 " SO SP\R&                  5      r4 " SQ SR\R&                  5      r5 " SS ST\Rl                  5      r7 " SU SV\R&                  5      r8 " SW SX\R&                  5      r9 " SY SZ\R&                  5      r: " S[ S\\R&                  5      r; " S] S^\R&                  5      r< " S_ S`\R&                  5      r= " Sa Sb\R&                  5      r> " Sc Sd\R&                  5      r? " Se Sf\R&                  5      r@ " Sg Sh\R&                  5      rA " Si Sj\R&                  5      rB " Sk Sl\R&                  5      rC " Sm Sn\R&                  5      rD " So Sp\R&                  5      rE " Sq Sr\R&                  5      rF " Ss St\R&                  5      rGg)u    )serializers)*N)JsonResponse)languageKey)datetimec                 L    [        U 5      S:H  =(       a    U R                  5       $ )N   )lenisdigit)passwords    y/Users/waleedhassanin/Documents/snowflake_co_dev_github/snow_flake_back_end_deploy/mama_care_api/mama_care/serializers.pyvalidatePasswordr      s    x=A4("2"2"44    c                 2    [         R                  " U 5      nU$ N)secrets	token_hex)r
   tokens     r   generateTokenr      s    c"ELr   c                     U R                   R                  S5      (       a+  U R                   S   R                  R                  SS 5      nU$ g )NrequestparentId)context__contains__query_paramsget)selfr   s     r   getParentIdr      sB    ||  ++<<	*77;;JM ,r   c                     Sn[        U 5      nUb  Ub  U[        U5      :X  a  gSnOSnOSn[        U5      S:  a  [        R                  " SU/05      eg)N TzParent Id is not matchedzParent Id is Requiredr   errorF)r   intr
   r   ValidationError)r   parentIdDataerrorMessageparentIdRequests       r   validateParentIdr'      sd    L!$'O"#s?3392L.
<1))7L>*BCCr   c                 H   U R                   R                  S5      (       Ga  U R                   S   R                  R                  SS 5      nU R                   S   R                  R                  SS 5      nU R                   S   R                  R                  SS 5      nSnUc  SnOUc  SnOUc  Sn[	        U5      S	:  a  [
        R                  " S
U/05      e[        R                  R                  US9R                  5       nUS:X  a  [        R                  R                  US9nUR                  R                  [        U5      :X  a  [        R                  R                  US9R                  5       nUS:X  ay  [        R                  R                  US9n	U	R                  R                  [        U5      :X  a6  U	R                  R                  [        U5      :X  a  U[        U5      :X  a  gSnOSnOSnOSnOSn[	        U5      S	:  a  [
        R                  " S
U/05      eg)Nr   r   childIdparentProfileIdr    zParent Id is requiredzChild Id is requiredzParent Profile Id is requiredr   r!   idTr)   zInvalid Parent Profile Idz Parent Profile Id does not existzInvalid Parent IdzChild Id does not exits)r   r   r   r   r
   r   r#   Childobjectsfilterexistsr   r,   r"   ParentProfiler)   )
r   selectedParentProfileIdr   r)   r*   r%   isExistChildselectedChildisExistParentProfileselectedParentProfiles
             r   isValidDatar8   2   s   ||  ++<<	*77;;JM,,y)66::9dK,,y1>>BBCTVZ[2L_1L$:L|q --w~.FGG}}+++9@@B4!MM--7-;M%%((CM9'4'<'<'C'Cg'C'V']']'_$'4/,9,A,A,E,EPW,E,X),44773w<GLaLiLiLlLlps  uD  qE  ME2c/6JJ#'+FL'B#EL24L|q --w~.FGGr   c                    U R                   R                  S5      (       a+  U R                   S   R                  R                  SS 5      nU$ U R                   R                  S5      (       a  U R                   S   nU$ S nU$ )Nr   isDashboard)r   r   headersr   )r   r:   s     r   getIsDashboardr<   `   sz    ||  ++ll9-5599-N
 	 
	"	"=	1	1ll=1  r   c                 ~    U b:  [         R                  R                  U S9nUR                  (       a  UR                  $ g )Nr+   )Languager/   r   	isEnabledr,   )
languageIdselectedLanguages     r   getLanguageRecordrB   j   s:    #++//:/>%%#&&&r   c                 (   U R                   R                  S5      (       a.  U R                   S   R                  R                  [        S 5      nO:U R                   R                  [        5      (       a  U R                   [           nOS n[        U5      $ )Nr   )r   r   r;   r   r   rB   )r   r@   s     r   getLanguagerD   r   sk    ||  ++\\),4488dK
		"	";	/	/\\+.

Z((r   c                   (    \ rS rSr " S S5      rSrg)TokenTypeSerializer   c                        \ rS rSr\r/ SQrSrg)TokenTypeSerializer.Meta   )r,   keyNametokenTypeLencreatedDateupdatedDate N)__name__
__module____qualname____firstlineno__	TokenTypemodelfields__static_attributes__rO   r   r   MetarI      s    
r   rX   rO   NrP   rQ   rR   rS   rX   rW   rO   r   r   rF   rF          
 
r   rF   c                   (    \ rS rSr " S S5      rSrg)DeviceOSTypeSerializer   c                        \ rS rSr\r/ SQrSrg)DeviceOSTypeSerializer.Meta   )r,   rK   rM   rN   rO   N)rP   rQ   rR   rS   DeviceOSTyperU   rV   rW   rO   r   r   rX   r_      s    
r   rX   rO   NrY   rO   r   r   r\   r\          
 
r   r\   c                   (    \ rS rSr " S S5      rSrg)LanguageSerializer   c                        \ rS rSr\r/ SQrSrg)LanguageSerializer.Meta   )r,   namecountryCoder?   languageCoderM   rN   rO   N)rP   rQ   rR   rS   r>   rU   rV   rW   rO   r   r   rX   rg      s    
r   rX   rO   NrY   rO   r   r   rd   rd      s    

 

r   rd   c                   P    \ rS rSr\R
                  " 5       r " S S5      rS rSr	g)GenderSerializer   c                        \ rS rSr\r/ SQrSrg)GenderSerializer.Meta   r,   rK   ri   rO   N)rP   rQ   rR   rS   GenderrU   rV   rW   rO   r   r   rX   rp      s    *r   rX   c                     [        U 5      nUba  [        R                  R                  [	        UR
                  5      S9R                  US9nUR                  5       S:  a  US   R                  $ g g )N)genderIdr@   r   )rD   GenderLanguager/   r0   strr,   __len__ri   )r   instancer@   genderLanguageLists       r   get_nameGenderSerializer.get_name   sv     &
!!/!7!7!>!>X[[) "? "f
f+  "))+a/)!,111 0	 "r   rO   N
rP   rQ   rR   rS   r   SerializerMethodFieldri   rX   r|   rW   rO   r   r   rm   rm      s    ,,.D+ +2r   rm   c                   (    \ rS rSr " S S5      rSrg)GenderLanguageSerializer   c                   $    \ rS rSr\rSSS\/rSrg)GenderLanguageSerializer.Meta   r,   ri   ru   rO   N)	rP   rQ   rR   rS   rw   rU   r   rV   rW   rO   r   r   rX   r      s    
K8r   rX   rO   NrY   rO   r   r   r   r      s    9 9r   r   c                   P    \ rS rSr\R
                  " 5       r " S S5      rS rSr	g)ChildTypeSerializer   c                        \ rS rSr\r/ SQrSrg)ChildTypeSerializer.Meta   rr   rO   N)rP   rQ   rR   rS   	ChildTyperU   rV   rW   rO   r   r   rX   r      s    *r   rX   c                     [        U 5      nUba  [        R                  R                  [	        UR
                  5      S9R                  US9nUR                  5       S:  a  US   R                  $ g g )N)childTypeIdrv   r   )rD   ChildTypeLanguager/   r0   rx   r,   ry   ri   )r   rz   r@   childTypeLanguageLists       r   r|   ChildTypeSerializer.get_name   sw     &
!$5$=$=$D$D, %E %f
f+ " %,,.2,Q/444 3	 "r   rO   Nr~   rO   r   r   r   r      s    ,,.D+ +5r   r   c                   (    \ rS rSr " S S5      rSrg)ChildTypeLanguageSerializer   c                   $    \ rS rSr\rSSS\/rSrg) ChildTypeLanguageSerializer.Meta   r,   ri   r   rO   N)	rP   rQ   rR   rS   r   rU   r   rV   rW   rO   r   r   rX   r      s    !{;r   rX   rO   NrY   rO   r   r   r   r      s    < <r   r   c                   P    \ rS rSr\R
                  " 5       r " S S5      rS rSr	g)SymptomTypeSerializer   c                        \ rS rSr\r/ SQrSrg)SymptomTypeSerializer.Meta   )r,   rK   imagerM   rN   ri   rO   N)rP   rQ   rR   rS   SymptomTyperU   rV   rW   rO   r   r   rX   r          
r   rX   c                     [        U 5      nUba  [        R                  R                  [	        UR
                  5      S9R                  US9nUR                  5       S:  a  US   R                  $ g g )N)symptomTypeIdrv   r   )rD   SymptomTypeLanguager/   r0   rx   r,   ry   ri   )r   rz   r@   symptomTypeLanguageLists       r   r|   SymptomTypeSerializer.get_name   w     &
!&9&A&A&H&H!(++. 'I 'f
f+ $ '..014.q1666 5	 "r   rO   Nr~   rO   r   r   r   r      s    ,,.D	
 	
7r   r   c                   (    \ rS rSr " S S5      rSrg)SymptomTypeLanguageSerializer   c                   $    \ rS rSr\rSSS\/rSrg)"SymptomTypeLanguageSerializer.Meta   r,   ri   r   rO   N)	rP   rQ   rR   rS   r   rU   r   rV   rW   rO   r   r   rX   r          #	
r   rX   rO   NrY   rO   r   r   r   r      rb   r   r   c                   P    \ rS rSr\R
                  " 5       r " S S5      rS rSr	g)KickTrackerStatusSerializer   c                        \ rS rSr\r/ SQrSrg) KickTrackerStatusSerializer.Metai  )r,   rK   countcolorrM   rN   ri   rO   N)rP   rQ   rR   rS   KickTrackerStatusrU   rV   rW   rO   r   r   rX   r         !
r   rX   c                     [        U 5      nUba  [        R                  R                  [	        UR
                  5      S9R                  US9nUR                  5       S:  a  US   R                  $ g g )N)kickTrackerStatusIdrv   r   )rD   KickTrackerStatusLanguager/   r0   rx   r,   ry   ri   )r   rz   r@   kickTrackerStatusLanguageLists       r   r|   $KickTrackerStatusSerializer.get_name  w     &
!,E,M,M,T,T$'$4 -U -f
f+ * -446:4Q7<<< ;	 "r   rO   Nr~   rO   r   r   r   r      s    ,,.D

 

=r   r   c                   (    \ rS rSr " S S5      rSrg)#KickTrackerStatusLanguageSerializeri  c                   &    \ rS rSr\rSSSS\/rSrg)(KickTrackerStatusLanguageSerializer.Metai  r,   ri   descriptionr   rO   N)	rP   rQ   rR   rS   r   rU   r   rV   rW   rO   r   r   rX   r     s    )!
r   rX   rO   NrY   rO   r   r   r   r     rZ   r   r   c                   x    \ rS rSr\R
                  " 5       r\R
                  " 5       r " S S5      rS r	S r
Srg)BMICaseTypeSerializeri%  c                        \ rS rSr\r/ SQrSrg)BMICaseTypeSerializer.Metai)  )r,   rK   rM   rN   ri   caseListrO   N)rP   rQ   rR   rS   BMICaseTyperU   rV   rW   rO   r   r   rX   r   )  r   r   rX   c                     [        U 5      nUba  [        R                  R                  [	        UR
                  5      S9R                  US9nUR                  5       S:  a  US   R                  $ g g )NbmiCaseTypeIdrv   r   )rD   BMICaseTypeLanguager/   r0   rx   r,   ry   ri   )r   rz   r@   BMICaseTypeLanguageLists       r   r|   BMICaseTypeSerializer.get_name4  r   r   c                     [        U 5      n[        R                  R                  UR                  S9n[        U[        U0SS9R                  $ )Nr   Tr   many)rD   BMICaser/   r0   r,   BMICaseSerializerr   data)r   rz   r@   bmiCaseLists       r   get_caseList"BMICaseTypeSerializer.get_caseList=  sE     &
oo,,8;;,G +z!:

$	r   rO   N)rP   rQ   rR   rS   r   r   ri   r   rX   r|   r   rW   rO   r   r   r   r   %  s2    ,,.D002H	
 	
7r   r   c                   (    \ rS rSr " S S5      rSrg)BMICaseTypeLanguageSerializeriE  c                   $    \ rS rSr\rSSS\/rSrg)"BMICaseTypeLanguageSerializer.MetaiF  r,   ri   r   rO   N)	rP   rQ   rR   rS   r   rU   r   rV   rW   rO   r   r   rX   r   F  r   r   rX   rO   NrY   rO   r   r   r   r   E  rb   r   r   c                       \ rS rSr\R
                  " 5       r\R
                  " 5       r\R
                  " 5       r " S S5      r	S r
S rS rSrg)	r   iP  c                        \ rS rSr\r/ SQrSrg)BMICaseSerializer.MetaiU  )
r,   rK   minmaxrM   rN   r   ri   	rangeTypeweightGainListrO   N)rP   rQ   rR   rS   r   rU   rV   rW   rO   r   r   rX   r   U  s    
r   rX   c                     [        U 5      nUba  [        R                  R                  [	        UR
                  5      S9R                  US9nUR                  5       S:  a  US   R                  $ g g )N	bmiCaseIdrv   r   )rD   BMICaseLanguager/   r0   rx   r,   ry   ri   )r   rz   r@   BMICaseLanguageLists       r   r|   BMICaseSerializer.get_named  sw     &
!"1"9"9"@"@hkk* #A #f
f+   #**,q0*1-222 1	 "r   c                 V    SnUR                   S:X  a  SnU$ UR                  S:X  a  SnU$ )Nr         )r   r   )r   rz   vals      r   get_rangeTypeBMICaseSerializer.get_rangeTypem  s7    <<1C 
 \\QC
r   c                 x    [         R                  R                  UR                  S9n[	        USS9R
                  $ )Nr   T)r   )BMICaseWeightGainr/   r0   r,   BMICaseWeightGainSerializerr   )r   rz   r   s      r   get_weightGainList$BMICaseSerializer.get_weightGainListu  s2    *2299HKK9P*>EJJJr   rO   N)rP   rQ   rR   rS   r   r   ri   r   r   rX   r|   r   r   rW   rO   r   r   r   r   P  sF    ,,.D113I 668N
 
3Kr   r   c                   (    \ rS rSr " S S5      rSrg)BMICaseLanguageSerializeriz  c                   $    \ rS rSr\rSSS\/rSrg)BMICaseLanguageSerializer.Metai{  r,   ri   r   rO   N)	rP   rQ   rR   rS   r   rU   r   rV   rW   rO   r   r   rX   r   {  s    	
r   rX   rO   NrY   rO   r   r   r   r   z  rb   r   r   c                   (    \ rS rSr " S S5      rSrg)r   i  c                        \ rS rSr\r/ SQrSrg) BMICaseWeightGainSerializer.Metai  )r,   r   r   r   rM   rN   rO   N)rP   rQ   rR   rS   r   rU   rV   rW   rO   r   r   rX   r     s    !
r   rX   rO   NrY   rO   r   r   r   r         	
 	
r   r   c                   P    \ rS rSr\R
                  " 5       r " S S5      rS rSr	g)CalculationMethodSerializeri  c                        \ rS rSr\r/ SQrSrg) CalculationMethodSerializer.Metai  )r,   rK   rM   rN   ri   rO   N)rP   rQ   rR   rS   CalculationMethodrU   rV   rW   rO   r   r   rX   r     s    !
r   rX   c                     [        U 5      nUba  [        R                  R                  [	        UR
                  5      S9R                  US9nUR                  5       S:  a  US   R                  $ g g )N)calculationMethodIdrv   r   )rD   CalculationMethodLanguager/   r0   rx   r,   ry   ri   )r   rz   r@   calculationMethodLanguageLists       r   r|   $CalculationMethodSerializer.get_name  r   r   rO   Nr~   rO   r   r   r   r     s    ,,.D
 
=r   r   c                   (    \ rS rSr " S S5      rSrg)#CalculationMethodLanguageSerializeri  c                   $    \ rS rSr\rSSS\/rSrg)(CalculationMethodLanguageSerializer.Metai  r,   ri   r  rO   N)	rP   rQ   rR   rS   r  rU   r   rV   rW   rO   r   r   rX   r    s    )!	
r   rX   rO   NrY   rO   r   r   r  r    rb   r   r  c                   x    \ rS rSr\R
                  " 5       r\R
                  " 5       r " S S5      rS r	S r
Srg)PregnancyWeekBasicSerializeri  c                        \ rS rSr\r/ SQrSrg)!PregnancyWeekBasicSerializer.Metai  )r,   r   fetalDevelopmentbabySizerO   NrP   rQ   rR   rS   PregnancyWeekrU   rV   rW   rO   r   r   rX   r    s    
r   rX   c                     [        U 5      nUba  [        R                  R                  [	        UR
                  5      S9R                  US9nUR                  5       S:  a  US   R                  $ g g NpregnancyWeekIdrv   r   rD   PregnancyWeekLanguager/   r0   rx   r,   ry   r  r   rz   r@   pregnancyWeekLanguageLists       r   get_fetalDevelopment1PregnancyWeekBasicSerializer.get_fetalDevelopment  w     &
!(=(E(E(L(L #HKK 0 )M )f
f+ & )002Q603DDD 7	 "r   c                     [        U 5      n[        R                  R                  UR                  S9nUR                  5       S:  a  [        US   [        U0S9R                  $ g Nr  r   r   )	rD   PregnancyBabySizer/   r0   r,   ry    PregnancyBabySizeBasicSerializerr   r   r   rz   r@   dataLists       r   get_babySize)PregnancyWeekBasicSerializer.get_babySize  sZ     &
$,,33hkk3R!3HQKV`Habgggr   rO   N)rP   rQ   rR   rS   r   r   r  r  rX   r  r#  rW   rO   r   r   r
  r
    s4    "88:002H
 
Er   r
  c                      \ rS rSr\R
                  " 5       r\R
                  " 5       r\R
                  " 5       r\R
                  " 5       r	\R
                  " 5       r
\R
                  " 5       r " S S5      rS rS rS rS rS rS	 rS
rg)PregnancyWeekDetailSerializeri  c                        \ rS rSr\r/ SQrSrg)"PregnancyWeekDetailSerializer.Metai  )r,   rK   
weekNumber	trimesterr   rM   rN   r  r  symptomList	checkListnutritionList
monthlyTiprO   Nr  rO   r   r   rX   r(    s    
r   rX   c                     [        U 5      nUba  [        R                  R                  [	        UR
                  5      S9R                  US9nUR                  5       S:  a  US   R                  $ g g r  r  r  s       r   r  2PregnancyWeekDetailSerializer.get_fetalDevelopment  r  r   c                     [        U 5      n[        R                  R                  UR                  S9nUR                  5       S:  a  [        US   [        U0S9R                  $ g r  )	rD   r  r/   r0   r,   ry   !PregnancyBabySizeDetailSerializerr   r   r!  s       r   r#  *PregnancyWeekDetailSerializer.get_babySize  sZ     &
$,,33hkk3R!4Xa[+WaIbchhhr   c                     [        U 5      n[        R                  R                  UR                  S9n[        U[        U0SS9R                  $ Nr  Tr   )rD   PregnancySymptomr/   r0   r,   PregnancySymptomSerializerr   r   r!  s       r   get_symptomList-PregnancyWeekDetailSerializer.get_symptomList  sD     &
#++22X[[2Q)(K;TZ^_dddr   c                     [        U 5      n[        R                  R                  UR                  S9n[        U[        U0SS9R                  $ r5  )rD   PregnancyCheckListr/   r0   r,   PregnancyCheckListSerializerr   r   r!  s       r   get_checkList+PregnancyWeekDetailSerializer.get_checkList  D     &
%--44x{{4S+Hk:=V\`afffr   c                     [        U 5      n[        R                  R                  UR                  S9n[        U[        U0SS9R                  $ r5  )rD   PregnancyNutritionr/   r0   r,   PregnancyNutritionSerializerr   r   r!  s       r   get_nutritionList/PregnancyWeekDetailSerializer.get_nutritionList  r?  r   c                    [        U 5      nSnUR                  S::  a  SnOUR                  S::  a  SnOtUR                  S::  a  SnOaUR                  S::  a  SnONUR                  S	::  a  S
nO;UR                  S::  a  SnO(UR                  S::  a  SnOUR                  S::  a  SnOSn[        R                  R	                  US9nUR                  5       S:  a  [        US   [        U0S9R                  $ g )Nr      r      r                     r	         #   	   )monthNumberr  )	rD   r)  
MonthlyTipr/   r0   ry   MonthlyTipSerializerr   r   )r   rz   r@   monthselecteds        r   get_monthlyTip,PregnancyWeekDetailSerializer.get_monthlyTip  s     &
!#E  A%E  B&E  B&E  B&E  B&E  B&E  B&EE%%,,5,A!'[*<UV[[[r   rO   N)rP   rQ   rR   rS   r   r   r  r  r+  r,  r-  r.  rX   r  r#  r8  r=  rC  rW  rW   rO   r   r   r&  r&    s    "88:002H335K113I557M224J
 
$Ee
g
g
r   r&  c                   (    \ rS rSr " S S5      rSrg)PregnancyWeekLanguageSerializeri&  c                   (    \ rS rSr\rSSSSS\/rSrg)	$PregnancyWeekLanguageSerializer.Metai'  r,   r  rM   rN   r  rO   N)	rP   rQ   rR   rS   r  rU   r   rV   rW   rO   r   r   rX   r\  '  s     %
r   rX   rO   NrY   rO   r   r   rZ  rZ  &  r   r   rZ  c                   P    \ rS rSr\R
                  " 5       r " S S5      rS rSr	g)r   i4  c                        \ rS rSr\rSS/rSrg)%PregnancyBabySizeBasicSerializer.Metai6  r   r   rO   NrP   rQ   rR   rS   r  rU   rV   rW   rO   r   r   rX   r_  6  s    !
r   rX   c                     [        U 5      nUba  [        R                  R                  [	        UR
                  5      S9R                  US9nUR                  5       S:  a  US   R                  $ g g N)pregnancyBabySizeIdrv   r   rD   PregnancyBabySizeLanguager/   r0   rx   r,   ry   r   r   rz   r@   pregnancyBabySizeLanguages       r   get_description0PregnancyBabySizeBasicSerializer.get_description<  w     &
!(A(I(I(P(P$'$4 )Q )f
f+ & )002Q603??? 7	 "r   rO   N
rP   rQ   rR   rS   r   r   r   rX   rh  rW   rO   r   r   r   r   4  s     335K
 
@r   r   c                   P    \ rS rSr\R
                  " 5       r " S S5      rS rSr	g)r2  iF  c                        \ rS rSr\r/ SQrSrg)&PregnancyBabySizeDetailSerializer.MetaiH  )r,   rK   r   rM   rN   r  r   rO   Nr`  rO   r   r   rX   rn  H  r   r   rX   c                     [        U 5      nUba  [        R                  R                  [	        UR
                  5      S9R                  US9nUR                  5       S:  a  US   R                  $ g g rb  rd  rf  s       r   rh  1PregnancyBabySizeDetailSerializer.get_descriptionS  rj  r   rO   Nrk  rO   r   r   r2  r2  F  s     335K

 

@r   r2  c                   (    \ rS rSr " S S5      rSrg)#PregnancyBabySizeLanguageSerializeri]  c                   (    \ rS rSr\rSSSSS\/rSrg)	(PregnancyBabySizeLanguageSerializer.Metai^  r,   r   rM   rN   rc  rO   N)	rP   rQ   rR   rS   re  rU   r   rV   rW   rO   r   r   rX   rt  ^  s     )!
r   rX   rO   NrY   rO   r   r   rr  rr  ]  r   r   rr  c                   P    \ rS rSr\R
                  " 5       r " S S5      rS rSr	g)r7  ik  c                        \ rS rSr\r/ SQrSrg)PregnancySymptomSerializer.Metaim  r,   rM   rN   r  r   rO   N)rP   rQ   rR   rS   r6  rU   rV   rW   rO   r   r   rX   rw  m  s     
r   rX   c                     [        U 5      nUba  [        R                  R                  [	        UR
                  5      S9R                  US9nUR                  5       S:  a  US   R                  $ g g )N)pregnancySymptomIdrv   r   )rD   PregnancySymptomLanguager/   r0   rx   r,   ry   r   )r   rz   r@   pregnancySymptomLanguages       r   rh  *PregnancySymptomSerializer.get_descriptionv  sw     &
!'?'G'G'N'N#&x{{#3 (O (f
f+ % (//1A5/2>>> 6	 "r   rO   Nrk  rO   r   r   r7  r7  k  s    335K
 
?r   r7  c                   (    \ rS rSr " S S5      rSrg)"PregnancySymptomLanguageSerializeri  c                   (    \ rS rSr\rSSSSS\/rSrg)	'PregnancySymptomLanguageSerializer.Metai  r,   r   rM   rN   rz  rO   N)	rP   rQ   rR   rS   r{  rU   r   rV   rW   rO   r   r   rX   r    s     ( 
r   rX   rO   NrY   rO   r   r   r  r    r   r   r  c                   P    \ rS rSr\R
                  " 5       r " S S5      rS rSr	g)r<  i  c                        \ rS rSr\r/ SQrSrg)!PregnancyCheckListSerializer.Metai  rx  rO   N)rP   rQ   rR   rS   r;  rU   rV   rW   rO   r   r   rX   r        "
r   rX   c                     [        U 5      nUba  [        R                  R                  [	        UR
                  5      S9R                  US9nUR                  5       S:  a  US   R                  $ g g )N)pregnancyCheckListIdrv   r   )rD   PregnancyCheckListLanguager/   r0   rx   r,   ry   r   )r   rz   r@   pregnancyCheckListLanguages       r   rh  ,PregnancyCheckListSerializer.get_description  w     &
!)C)K)K)R)R%(%5 *S *f
f+ ' *113a71!4@@@ 8	 "r   rO   Nrk  rO   r   r   r<  r<         335K
 
Ar   r<  c                   (    \ rS rSr " S S5      rSrg)$PregnancyCheckListLanguageSerializeri  c                   (    \ rS rSr\rSSSSS\/rSrg)	)PregnancyCheckListLanguageSerializer.Metai  r,   r   rM   rN   r  rO   N)	rP   rQ   rR   rS   r  rU   r   rV   rW   rO   r   r   rX   r         *"
r   rX   rO   NrY   rO   r   r   r  r    r   r   r  c                   P    \ rS rSr\R
                  " 5       r " S S5      rS rSr	g)rB  i  c                        \ rS rSr\r/ SQrSrg)!PregnancyNutritionSerializer.Metai  )r,   r  rM   rN   r   rO   N)rP   rQ   rR   rS   rA  rU   rV   rW   rO   r   r   rX   r    r  r   rX   c                     [        U 5      nUba  [        R                  R                  [	        UR
                  5      S9R                  US9nUR                  5       S:  a  US   R                  $ g g )N)pregnancyNutritionIdrv   r   )rD   PregnancyNutritionLanguager/   r0   rx   r,   ry   r   )r   rz   r@   pregnancyNutritionLanguages       r   rh  ,PregnancyNutritionSerializer.get_description  r  r   rO   Nrk  rO   r   r   rB  rB    r  r   rB  c                   (    \ rS rSr " S S5      rSrg)$PregnancyNutritionLanguageSerializeri  c                   (    \ rS rSr\rSSSSS\/rSrg)	)PregnancyNutritionLanguageSerializer.Metai  r,   r   rM   rN   r  rO   N)	rP   rQ   rR   rS   r  rU   r   rV   rW   rO   r   r   rX   r    r  r   rX   rO   NrY   rO   r   r   r  r    r   r   r  c                       \ rS rSr\R
                  " 5       r\R
                  " 5       r\R
                  " 5       r\R
                  " 5       r	 " S S5      r
S rS rS rS rSrg	)
rT  i  c                        \ rS rSr\r/ SQrSrg)MonthlyTipSerializer.Metai  )r,   rR  rM   rN   titler   inspirationtipListrO   N)rP   rQ   rR   rS   rS  rU   rV   rW   rO   r   r   rX   r    s    	
r   rX   c                     [        U 5      nUba  [        R                  R                  [	        UR
                  5      S9R                  US9nUR                  5       S:  a  US   R                  $ g g NmonthlyTipIdrv   r   )rD   MonthlyTipLanguager/   r0   rx   r,   ry   r  r   rz   r@   monthlyTipLanguages       r   	get_titleMonthlyTipSerializer.get_title  sw     &
!!3!;!;!B!B - "C "f
f+  "))+a/)!,222 0	 "r   c                     [        U 5      nUba  [        R                  R                  [	        UR
                  5      S9R                  US9nUR                  5       S:  a  US   R                  $ g g r  )rD   r  r/   r0   rx   r,   ry   r   r  s       r   rh  $MonthlyTipSerializer.get_description  w     &
!!3!;!;!B!B - "C "f
f+  "))+a/)!,888 0	 "r   c                     [        U 5      nUba  [        R                  R                  [	        UR
                  5      S9R                  US9nUR                  5       S:  a  US   R                  $ g g r  )rD   r  r/   r0   rx   r,   ry   r  r  s       r   get_inspiration$MonthlyTipSerializer.get_inspiration  r  r   c                     [        U 5      n[        R                  R                  UR                  S9R                  US9n[        US[        U0S9R                  $ )Nr  )tip_tiplanguage__languageIdTr   r   )rD   Tipr/   r0   r,   TipSerializerr   r   )r   rz   r@   selectedLists       r   get_tipList MonthlyTipSerializer.get_tipList  sP     &
{{)))ELLkuLv\t[*<UV[[[r   rO   N)rP   rQ   rR   rS   r   r   r  r   r  r  rX   r  rh  r  r  rW   rO   r   r   rT  rT    sY    --/E335K335K//1G
 
399\r   rT  c                   (    \ rS rSr " S S5      rSrg)MonthlyTipLanguageSerializeri	  c                   ,    \ rS rSr\rSSSSSSS\/rS	rg
)!MonthlyTipLanguageSerializer.Metai
  r,   r  r   r  rM   rN   r  rO   N)	rP   rQ   rR   rS   r  rU   r   rV   rW   rO   r   r   rX   r  
  s&    "	
r   rX   rO   NrY   rO   r   r   r  r  	  s    
 
r   r  c                   P    \ rS rSr\R
                  " 5       r " S S5      rS rSr	g)r  i  c                        \ rS rSr\r/ SQrSrg)TipSerializer.Metai  )r,   r  rM   rN   r   rO   N)rP   rQ   rR   rS   r  rU   rV   rW   rO   r   r   rX   r    s    
r   rX   c                     [        U 5      nUba  [        R                  R                  [	        UR
                  5      S9R                  US9nUR                  5       S:  a  US   R                  $ g g )N)tipIdrv   r   )rD   TipLanguager/   r0   rx   r,   ry   r   )r   rz   r@   tipLanguages       r   rh  TipSerializer.get_description#  su     &
!%--44(++& 5 f
f+  ""$q("1~111 )	 "r   rO   Nrk  rO   r   r   r  r    s    335K
 
2r   r  c                   (    \ rS rSr " S S5      rSrg)TipLanguageSerializeri-  c                   (    \ rS rSr\rSSSSS\/rSrg)	TipLanguageSerializer.Metai.  r,   r   rM   rN   r  rO   N)	rP   rQ   rR   rS   r  rU   r   rV   rW   rO   r   r   rX   r  .  s     
r   rX   rO   NrY   rO   r   r   r  r  -  r   r   r  c                       \ rS rSr\R
                  " 5       r\R
                  " 5       r\R
                  " 5       r\R
                  " 5       r	\R
                  " SS9r
S rS rSrg) ForgetOrChangePasswordSerializeri:  r    )defaultc                    SnS nSU;   a  US   nOSnS nSU;   a  US   n[        U5      S:w  a  SnOSnS nSU;   a  US   nOS	nS nS nS
U;   a  US
   nUS:X  a  SU;   a  US   nOSnOSnXE:w  a  Sn[        R                  R                  US9nUR	                  5       S:  a!  US   n	US:X  a  Ub  U	R
                  U:w  a  SnOSn[        U5      S:  a  [        R                  " SU/05      eU$ )Nr    phonePhone is requirednewPasswordT)r  'Password must consists of 6 digits only)r  zNew Password is requiredconfirmPassword)r  zConfirm Password is requiredflagchangeoldPassword)r  zOld Password is requiredzFlag is required)r  zMismatch PasswordparentId__phoner   )OldPasswordzInvalid old Password)r  No records found by phoner!   )	r   ParentDetailr/   r0   ry   r   r
   r   r#   )
r   r   r%   r  r  r  r  r  parentDetailListrV  s
             r   validate)ForgetOrChangePasswordSerializer.validateA  s=   d?ME.LD }-K,4WDL$"#45OLLT><Dx D("&}"5K#LL-L)AL'//66u6M##%)'*Hx*((K7&K|?L|q --w~.FGGr   c                    SnUS   nUS   n[         R                  R                  US9nUR                  5       S:  a  US   nUb  XFl        UR                  5         OSn[        R                  " SU/05      e[        0 5      $ )Nr    r  r  r  r   r  r!   )	r  r/   r0   ry   r   saver   r#   r   )r   validated_datar%   r  r  r  rV  s          r   create'ForgetOrChangePasswordSerializer.createv  s    w'$]3'//66u6M##%)'*H#$/!6L--,(  Br   rO   N)rP   rQ   rR   rS   r   	CharFieldr  r  r  r  r  r  r  rW   rO   r   r   r  r  :  sU      "D!!#E'')K!++-O''3K3j r   r  c                       \ rS rSr\R
                  " 5       r\R
                  " 5       r " S S5      rS r	S r
S rS rS rS	rg
)ParentSerializeri  c                   ,    \ rS rSr\rSSSSS\SS/rS	rg
)ParentSerializer.Metai  r,   r  isTryingToBePregnantrM   rN   r   parentDetailrO   N)	rP   rQ   rR   rS   ParentrU   r   rV   rW   rO   r   r   rX   r    s&    "	
r   rX   c                     Sn [         R                  " US 5      nU(       a  [         R                  " W5      (       a  gg!   Sn N*= f)NTF)phonenumbersparseis_valid_number)r   r  isParsedparsed_numbers       r   validatePhoneParentSerializer.validatePhone  sF    	(..ud;M ++M::	Hs	   ? Ac                 h    [         R                  R                  US9R                  5       nUS:  a  gg)N)r  r   FT)r  r/   r0   r   )r   r  r   s      r   checkPhoneIsExists#ParentSerializer.checkPhoneIsExists  s/    %%E%288:19r   c                 B   U R                   R                  S5      nUR                  nSnSU;   aE  US   nU R                  U5      S:w  a  SnO*UR                  S:X  a  U R                  U5      S:w  a  SnOSn[        U5      S	:  a  [        R                  " S
U/05      eU$ )Nr   r    r  TzInvalid PhonePOST)r  zPhone is already registeredr  r   r!   )	r   r   r   r  methodr  r
   r   r#   )r   r   r   dataJsonr%   r  s         r   r  ParentSerializer.validate  s    ,,""9-<<hW%E!!%(D0.6)**51T9#IL.L|q --w~.FGGr   c                 \   [         R                  R                  UR                  S9nUR	                  5       S:  a  [        US   5      R                  $ [        R                  R                  SS9nUR	                  5       S:  a  0 n[        US   R                  5      US'   [        R                  " 5       US'   [        R                  " 5       US'   US   R                  US'   UR                  US	'   [        US
9nUR                  5       (       a  UR                  5         UR                  $ g )Nr   r   parent)rK   r   rM   rN   tokenTypeIdr   r   )ParentTokenr/   r0   r,   ry   ParentTokenSerializerr   rT   r   rL   r   nowis_validr  )r   rz   	tokenListr  parentTokenMapparentTokenSerializers         r   	get_tokenParentSerializer.get_token  s   ''...D	"(16;;;$,,33H3EL##%)!#*7Q8T8T*Uw'08}-08}-0<Q0B0B}--5[[z*(=>(R%(1133)..00555r   c                     [         R                  R                  UR                  S9R	                  5       nUS:X  a<  [         R                  R                  UR                  S9n[        U5      R                  $ g )Nr  T)r  r/   r0   r,   r1   r   ParentDetailSerializerr   )r   rz   isExistsrV  s       r   get_parentDetail!ParentSerializer.get_parentDetail  sa    ''..(++.FMMOt#++//8;;/GH)(3888r   rO   N)rP   rQ   rR   rS   r   r   r   r  rX   r  r  r  r  r  rW   rO   r   r   r  r    sA    --/E446L
 

*(r   r  c                   .    \ rS rSr " S S5      rS rSrg)r  i  c                       \ rS rSr\rS/rSrg)ParentDetailSerializer.Metai  r   rO   N)rP   rQ   rR   rS   r  rU   excluderW   rO   r   r   rX   r    s    r   rX   c                    U R                   R                  S5      nUR                  n/ nUR                  S:X  aL  SU;   a  US   n[	        U5      S:w  a  SnOXQS'   OSn[        W5      S:  a  [        R                  " SU/05      eU$ )	Nr   r  r   T)r   r  )r   zPassword is requiredr   r!   )r   r   r   r  r   r
   r   r#   )r   r   r   r  	errorListr   r%   s          r   r  ParentDetailSerializer.validate  s    ,,""9-<<	>>V#X%#J/#H-5#XL'/$A< 1$!117L>2JKK r   rO   NrP   rQ   rR   rS   rX   r  rW   rO   r   r   r  r    s     r   r  c                   (    \ rS rSr " S S5      rSrg)r  i  c                        \ rS rSr\r/ SQrSrg)ParentTokenSerializer.Metai  )r   r   rM   rN   r  rO   N)rP   rQ   rR   rS   r  rU   rV   rW   rO   r   r   rX   r    s    
r   rX   rO   NrY   rO   r   r   r  r    rZ   r   r  c                       \ rS rSr\R
                  " 5       r\R
                  " 5       r\R
                  " 5       r " S S5      r	S r
S rS rS rSrg	)
ChildSerializeri  c                        \ rS rSr\r/ SQrSrg)ChildSerializer.Metai  )r,   
isSelectedri   dateOfBirthweightlengthheadrM   rN   r   ru   r   	childTypegenderparentProfilerO   N)rP   rQ   rR   rS   r.   rU   rV   rW   rO   r   r   rX   r    s    
r   rX   c                     SnSU;   a  [        XS   R                  5      nOSnUS:X  a  U$ [        W5      S:  a  [        R                  " SU/05      eg )NFr   r   zParent Id does not exitTr   r!   r'   r,   r
   r   r#   )r   r   isCheckr%   s       r   r  ChildSerializer.validate   s_    &t,<,?,?@G@Ld?K"--w~.FGG #r   c                 :   [        U 5      n[        R                  R                  UR                  R
                  S9R                  5       nUS:X  aK  [        R                  R                  UR                  R
                  S9n[        U[        U0S9R                  $ g Nr+   Tr  )rD   r   r/   r0   r   r,   r1   r   r   r   r   )r   rz   r@   r  selectedChildTypes        r   get_childTypeChildSerializer.get_childType-  s     &
$$++x/C/C/F/F+GNNPt ) 1 1 5 59M9M9P9P 5 Q&!K+Dd r   c                 :   [        U 5      n[        R                  R                  UR                  R
                  S9R                  5       nUS:X  aK  [        R                  R                  UR                  R
                  S9n[        U[        U0S9R                  $ g r,  )rD   rs   r/   r0   ru   r,   r1   r   rm   r   r   )r   rz   r@   r  selectedGenders        r   
get_genderChildSerializer.get_gender7  s     &
>>((H,=,=,@,@(AHHJt#^^//83D3D3G3G/HN#j(Ad r   c                    [         R                  R                  UR                  S9R	                  5       nUS:X  a<  [         R                  R                  UR                  S9n[        U5      R                  $ [        R                  " 5       [        R                  " 5       UR                  S.n[        US9nUR                  5       (       a  UR                  5         UR                  $ g )Nr-   TrM   rN   r)   r   )r2   r/   r0   r,   r1   r   ParentProfileSerializerr   r   r  r  r  )r   rz   r  rV  parentProfileMapparentProfileSerializers         r   get_parentProfile!ChildSerializer.get_parentProfileA  s     ((//(++/FMMOt$,,008;;0GH*84999 'lln&lln"++
 '>CS&T#&//11',,..333 2r   rO   N)rP   rQ   rR   rS   r   r   r$  r#  r%  rX   r  r.  r2  r9  rW   rO   r   r   r  r    sK    ..0F113I557M
 
(H4r   r  c                   .    \ rS rSr " S S5      rS rSrg)EmergencyContactSerializeriS  c                        \ rS rSr\r/ SQrSrg)EmergencyContactSerializer.MetaiT  )r,   fullNamer  rM   rN   r   rO   N)rP   rQ   rR   rS   EmergencyContactrU   rV   rW   rO   r   r   rX   r>  T  s     
r   rX   c                     SnSnSU;   a  [        XS   R                  5      nOSnUS:X  a  U$ [        U5      S:  a  [        R                  " SU/05      eg )Nr    Fr   r'  Tr   r!   r(  r   r   r%   r)  s       r   r  #EmergencyContactSerializer.validate_  sd    &t,<,?,?@G@Ld?K"--w~.FGG #r   rO   Nr  rO   r   r   r<  r<  S  s    	
 	
Hr   r<  c                   (    \ rS rSr " S S5      rSrg)r6  in  c                        \ rS rSr\r/ SQrSrg)ParentProfileSerializer.Metaio  r5  rO   N)rP   rQ   rR   rS   r2   rU   rV   rW   rO   r   r   rX   rF  o  s    
r   rX   rO   NrY   rO   r   r   r6  r6  n  s    
 
r   r6  c                   ~    \ rS rSr\R
                  " 5       r\R
                  " 5       r " S S5      rS r	S r
S rSrg)	SymptomGroupSerializeri{  c                        \ rS rSr\r/ SQrSrg)SymptomGroupSerializer.Metai  )r,   datenoterM   rN   r*   symptomRowListisAuthorizedrO   N)rP   rQ   rR   rS   SymptomGrouprU   rV   rW   rO   r   r   rX   rJ    s    	
r   rX   c                 b    [        XR                  R                  R                  5      (       a  gg NTr8   r*   r)   r,   r   rz   s     r   get_isAuthorized'SymptomGroupSerializer.get_isAuthorized  (    t44<<??@@ Ar   c                     SnSnSU;   a-  [        XS   R                  R                  R                  5      nOSnUS:X  a  U$ [	        U5      S:  a  [
        R                  " SU/05      eg Nr    Fr*   r'  Tr   r!   r'   r)   r   r,   r
   r   r#   rB  s       r   r  SymptomGroupSerializer.validate  q    $&t1B,C,K,K,T,T,W,WXG@Ld?K"--w~.FGG #r   c                     [        U 5      n[        R                  R                  UR                  S9n[        US[        U0S9R                  $ )N)symptomGroupIdTr  )rD   
SymptomRowr/   r0   r,   SymptomRowSerializerr   r   r!  s       r   get_symptomRowList)SymptomGroupSerializer.get_symptomRowList  sG     &
%%,,HKK,H#4+z)B

$	r   rO   N)rP   rQ   rR   rS   r   r   rN  rM  rX   rT  r  r`  rW   rO   r   r   rH  rH  {  s8    446L 668N
 
Hr   rH  c                   ~    \ rS rSr\R
                  " 5       r\R
                  " 5       r " S S5      rS r	S r
S rSrg)	r_  i  c                        \ rS rSr\r/ SQrSrg)SymptomRowSerializer.Metai  )r,   rM   rN   r   r]  symptomTyperN  rO   N)rP   rQ   rR   rS   r^  rU   rV   rW   rO   r   r   rX   rd    s    
r   rX   c                 v    [        XR                  R                  R                  R                  5      (       a  gg rQ  )r8   r]  r*   r)   r,   rS  s     r   rT  %SymptomRowSerializer.get_isAuthorized  s.    t33CCKKNNOO Pr   c                     SnSnSU;   a7  [        XS   R                  R                  R                  R                  5      nOSnUS:X  a  U$ [        U5      S:  a  [        R                  " SU/05      eg )Nr    Fr]  r'  Tr   r!   r'   r*   r)   r   r,   r
   r   r#   rB  s       r   r  SymptomRowSerializer.validate  sw    t#&t1A,B,R,R,Z,Z,c,c,f,fgG@Ld?K"--w~.FGG #r   c                 <   [        U 5      n[        R                  R                  UR                  R
                  S9R                  5       nU(       aK  [        R                  R                  UR                  R
                  S9n[        U[        U0S9R                  $ g Nr+   r  )rD   r   r/   r0   r   r,   r1   r   r   r   r   r   rz   r@   r   rV  s        r   get_symptomType$SymptomRowSerializer.get_symptomType  s     &
!!((H,B,B,E,E(FMMO"**..(2H2H2K2K.LH(;
";d r   rO   N)rP   rQ   rR   rS   r   r   rN  re  rX   rT  r  rn  rW   rO   r   r   r_  r_    s8    335L335K

 

Hr   r_  c                   ~    \ rS rSr\R
                  " 5       r\R
                  " 5       r " S S5      rS r	S r
S rSrg)	KickTrackerGroupSerializeri  c                        \ rS rSr\r/ SQrSrg)KickTrackerGroupSerializer.Metai  )r,   rK  rM   rN   r*   kickTrackerRowSummaryrN  rO   N)rP   rQ   rR   rS   KickTrackerGrouprU   rV   rW   rO   r   r   rX   rs    s     
r   rX   c                 b    [        XR                  R                  R                  5      (       a  gg rQ  rR  rS  s     r   rT  +KickTrackerGroupSerializer.get_isAuthorized  rV  r   c                     SnSnSU;   a-  [        XS   R                  R                  R                  5      nOSnUS:X  a  U$ [	        U5      S:  a  [
        R                  " SU/05      eg rX  rY  rB  s       r   r  #KickTrackerGroupSerializer.validate  r[  r   c                 `   [         R                  R                  UR                  S9R	                  5       nUS:  as  [         R                  R                  UR                  S9R                  [        S5      [        S5      S9nUb)  [        US   S5      u  pE[        US5      u  pgUS	   UUUS
.$ g )N)kickTrackerGroupIdr   kicksseconds)
totalKickstotalSecondsr  i  <   r~  )r~  hoursminutesr}  )KickTrackerRowr/   r0   r,   r   	aggregateSumdivmod)r   rz   r   
kickCountsr  	remainderr  r}  s           r   get_kickTrackerRowSummary4KickTrackerGroupSerializer.get_kickTrackerRowSummary  s    &&---MSSU19'//66#+;; 7 i3w<c)niM  %#)*^*Dd#K #))R#8 ",\":"&&	  r   rO   N)rP   rQ   rR   rS   r   r   rN  rt  rX   rT  r  r  rW   rO   r   r   rq  rq    s9    335L'==?

 

Hr   rq  c                   V    \ rS rSr\R
                  " 5       r " S S5      rS rS r	Sr
g)KickTrackerRowSerializeri	  c                        \ rS rSr\r/ SQrSrg)KickTrackerRowSerializer.Metai  )r,   rK  r}  r|  rM   rN   r{  rN  rO   N)rP   rQ   rR   rS   r  rU   rV   rW   rO   r   r   rX   r    s    	
r   rX   c                 v    [        XR                  R                  R                  R                  5      (       a  gg rQ  )r8   r{  r*   r)   r,   rS  s     r   rT  )KickTrackerRowSerializer.get_isAuthorized  s.    t77GGOORRSS Tr   c                     SnSnSU;   a7  [        XS   R                  R                  R                  R                  5      nOSnUS:X  a  U$ [        U5      S:  a  [        R                  " SU/05      eg )Nr    Fr{  r'  Tr   r!   ri  rB  s       r   r  !KickTrackerRowSerializer.validate  sw    4'&t1E,F,V,V,^,^,g,g,j,jkG@Ld?K"--w~.FGG #r   rO   NrP   rQ   rR   rS   r   r   rN  rX   rT  r  rW   rO   r   r   r  r  	  s%    335L
 
Hr   r  c                      \ rS rSr\R
                  " 5       r\R
                  " 5       r\R
                  " 5       r\R
                  " 5       r	\R
                  " 5       r
\R
                  " 5       r\R
                  " 5       r\R
                  " 5       r " S S5      rS rS rS rS rS rS	 rS
 rS rS rS rS rS rSrg)WeightGainSerializeri,  c                        \ rS rSr\r/ SQrSrg)WeightGainSerializer.Metai6  )r,   heightprePregnancyWeightcurrentWeightcurrentWeekrM   rN   r   r*   bmibmiCategorygainrecommendedMinrecommendedMaxstatusIdstatusrN  rO   N)rP   rQ   rR   rS   
WeightGainrU   rV   rW   rO   r   r   rX   r  6  s    
r   rX   c                 b    [        XR                  R                  R                  5      (       a  gg rQ  rR  rS  s     r   rT  %WeightGainSerializer.get_isAuthorizedL  rV  r   c                     SnSnSU;   a-  [        XS   R                  R                  R                  5      nOSnUS:X  a  U$ [	        U5      S:  a  [
        R                  " SU/05      eg rX  rY  rB  s       r   r  WeightGainSerializer.validateP  r[  r   c                 b    [        UR                  [        UR                  S-  S5      -  S5      $ )Nd   r   )roundr  powr  rS  s     r   get_bmiWeightGainSerializer.get_bmi^  s,    X003#8MPQ3RRTUVVr   c                     [        U 5      n[        R                  R                  UR                  S9R                  US9nUR                  5       S:  a  US   R                  $ g)Nr   rv   r   r    )rD   r   r/   r0   r   ry   ri   )r   rz   r@   langLists       r   get_bmiCategory$WeightGainSerializer.get_bmiCategorya  se     &
"**11H<N<N1OVV! W 
 !A;###r   c                 4    UR                   UR                  -
  $ r   )r  r  rS  s     r   getGainWeightGainSerializer.getGainj  s    %%(C(CCCr   c                 $    U R                  U5      $ r   )r  rS  s     r   get_gainWeightGainSerializer.get_gainm  s    ||H%%r   c                    SnSn[         R                  R                  UR                  S9nUR	                  5       S:  a  US   R
                  nUS   R                  n[        S[        UR                  S5      5      S-  nX%-  nX5-  nXg4$ )Nr   r   (   g      D@)r   r/   r0   r   ry   r   r   r  )r   rz   minValmaxValbmiCaseWeightGainListresulttotalMintotalMaxs           r   getTotalMinMax#WeightGainSerializer.getTotalMinMaxp  s     1 9 9 @ @(( !A !
 !((*Q.*1-11F*1-11FQH00"56=??!!r   c                 @    U R                  U5      u  p#[        US5      $ Nr   r  r  r   rz   recoMinrecoMaxs       r   get_recommendedMin'WeightGainSerializer.get_recommendedMin  "    ..x8Wa  r   c                 @    U R                  U5      u  p#[        US5      $ r  r  r  s       r   get_recommendedMax'WeightGainSerializer.get_recommendedMax  r  r   c                     U R                  U5      u  p#SnSnU R                  U5      nXbS-
  :  a  SnSnXE4$ XcS-   :  a  SnSnXE4$ SnS	nXE4$ )
Nr    g?r   BelowrI  Abover   Within)r  r  )r   rz   r  r  r  r  r  s          r   	getStatusWeightGainSerializer.getStatus  s    !00:||H%S. HF  sN"HF  HFr   c                 ,    U R                  U5      u  p#U$ r   r  r   rz   r  r  s       r   get_statusId!WeightGainSerializer.get_statusId  s    >>(3r   c                 ,    U R                  U5      u  p#U$ r   r  r  s       r   
get_statusWeightGainSerializer.get_status  s    >>(3r   rO   N)rP   rQ   rR   rS   r   r   rN  r  r  r  r  r  r  r  rX   rT  r  r  r  r  r  r  r  r  r  r  r  rW   rO   r   r   r  r  ,  s    446L

+
+
-C335K,,.D 668N 668N002H..0F
 
,HWD&" !!  r   r  c                   V    \ rS rSr\R
                  " 5       r " S S5      rS rS r	Sr
g)OvulationSerializeri  c                        \ rS rSr\r/ SQrSrg)OvulationSerializer.Metai  )r,   lastMenstrualPeriodcycleLength
nextPeriodovulationDayfertileStart
fertileEndexpectedDueDaterM   rN   r*   rN  rO   N)rP   rQ   rR   rS   	OvulationrU   rV   rW   rO   r   r   rX   r    s    
r   rX   c                 b    [        XR                  R                  R                  5      (       a  gg rQ  rR  rS  s     r   rT  $OvulationSerializer.get_isAuthorized  rV  r   c                     SnSnSU;   a-  [        XS   R                  R                  R                  5      nOSnUS:X  a  U$ [	        U5      S:  a  [
        R                  " SU/05      eg rX  rY  rB  s       r   r  OvulationSerializer.validate  r[  r   rO   Nr  rO   r   r   r  r    s%    446L
 
"Hr   r  c                   ~    \ rS rSr\R
                  " 5       r\R
                  " 5       r " S S5      rS r	S r
S rSrg)	DueDateCalculatorSerializeri  c                        \ rS rSr\r/ SQrSrg) DueDateCalculatorSerializer.Metai  )r,   r  r  conceiveDatedateOfTransfer	numOfDaysultrasoundDateweeksdaysr  rM   rN   r*   r  calculationMethodrN  rO   N)rP   rQ   rR   rS   DueDateCalculatorrU   rV   rW   rO   r   r   rX   r    s    !
r   rX   c                 b    [        XR                  R                  R                  5      (       a  gg rQ  rR  rS  s     r   rT  ,DueDateCalculatorSerializer.get_isAuthorized  rV  r   c                     SnSnSU;   a-  [        XS   R                  R                  R                  5      nOSnUS:X  a  U$ [	        U5      S:  a  [
        R                  " SU/05      eg rX  rY  rB  s       r   r  $DueDateCalculatorSerializer.validate  r[  r   c                 <   [        U 5      n[        R                  R                  UR                  R
                  S9R                  5       nU(       aK  [        R                  R                  UR                  R
                  S9n[        U[        U0S9R                  $ g rl  )rD   r   r/   r0   r  r,   r1   r   r   r   r   rm  s        r   get_calculationMethod1DueDateCalculatorSerializer.get_calculationMethod  s}     &
 ((//X5Q5Q5T5T/U\\^(0044(:V:V:Y:Y4ZH.xj@YZ___r   rO   N)rP   rQ   rR   rS   r   r   rN  r  rX   rT  r  r  rW   rO   r   r   r  r    s9    446L#99;
 
*Hr   r  c                   V    \ rS rSr\R
                  " 5       r " S S5      rS rS r	Sr
g)NotesSerializeri  c                        \ rS rSr\r/ SQrSrg)NotesSerializer.Metai  )r,   r  r   rM   rN   r*   rN  rO   N)rP   rQ   rR   rS   NotesrU   rV   rW   rO   r   r   rX   r    s    
r   rX   c                 b    [        XR                  R                  R                  5      (       a  gg rQ  rR  rS  s     r   rT   NotesSerializer.get_isAuthorized  rV  r   c                     SnSnSU;   a-  [        XS   R                  R                  R                  5      nOSnUS:X  a  U$ [	        U5      S:  a  [
        R                  " SU/05      eg rX  rY  rB  s       r   r  NotesSerializer.validate  r[  r   rO   Nr  rO   r   r   r  r    s%    446L

 

Hr   r  c                   V    \ rS rSr\R
                  " 5       r " S S5      rS rS r	Sr
g)AppointmentSerializeri  c                        \ rS rSr\r/ SQrSrg)AppointmentSerializer.Metai  )r,   r  
doctorName
specialityrK  dateTimeisDonerM   rN   r*   rN  rO   N)rP   rQ   rR   rS   AppointmentrU   rV   rW   rO   r   r   rX   r    s    
r   rX   c                 b    [        XR                  R                  R                  5      (       a  gg rQ  rR  rS  s     r   rT  &AppointmentSerializer.get_isAuthorized/  rV  r   c                     SnSnSU;   a-  [        XS   R                  R                  R                  5      nOSnUS:X  a  U$ [	        U5      S:  a  [
        R                  " SU/05      eg rX  rY  rB  s       r   r  AppointmentSerializer.validate3  r[  r   rO   Nr  rO   r   r   r
  r
    s%    446L
 
 Hr   r
  c                   V    \ rS rSr\R
                  " 5       r " S S5      rS rS r	Sr
g)TodoSerializeriE  c                        \ rS rSr\r/ SQrSrg)TodoSerializer.MetaiG  )	r,   r  rK  r  r  rM   rN   r*   rN  rO   N)rP   rQ   rR   rS   TodorU   rV   rW   rO   r   r   rX   r  G  s    

r   rX   c                 b    [        XR                  R                  R                  5      (       a  gg rQ  rR  rS  s     r   rT  TodoSerializer.get_isAuthorizedU  rV  r   c                     SnSnSU;   a-  [        XS   R                  R                  R                  5      nOSnUS:X  a  U$ [	        U5      S:  a  [
        R                  " SU/05      eg rX  rY  rB  s       r   r  TodoSerializer.validateY  r[  r   rO   Nr  rO   r   r   r  r  E  s%    446L
 
Hr   r  )Hrest_frameworkr   mama_care.modelsdjango.db.modelsr   r  django.httpr   mama_care_api.settingsr   r   r   r   r   r'   r8   r<   rB   rD   ModelSerializerrF   r\   rd   rm   r   r   r   r   r   r   r   r   r   r   r   r   r   r  r
  r&  rZ  r   r2  rr  r7  r  r<  r  rB  r  rT  r  r  r  
Serializerr  r  r  r  r  r<  r6  rH  r_  rq  r  r  r  r  r  r
  r  rO   r   r   <module>r&     s   &     $ . 5
(+\)	
+55 	

[88 

44 
"2{22 2"9{:: 95+55 5"<+"="= <7K77 70
K$?$? 
=+"="= =2	
+*E*E 	
K77 @
K$?$? 
'K33 'KT
 ; ; 


+"="= 

=+"="= =.
+*E*E 
;#>#> :RK$?$? Rh

k&A&A 

@{'B'B @$@(C(C @.

+*E*E 

?!<!< ?*

)D)D 

A;#>#> A,

;+F+F 

A;#>#> A,

;+F+F 

0\;66 0\f
;#>#> 
2K// 2,

K77 

K {'='= K ^Q{22 Qh[88 :	
K77 	
H4k11 H4XH!<!< H6
k99 
([88 (X*;66 *\0!<!< 0hH{:: HFr;66 rl#H+55 #HL2+"="= 2jHk11 H@"HK77 "HP H[00  Hr   