
    $1i#                         d dl m Z  d dlmZmZ d dlmZ d dlmZ d dlm	Z	m
Z
mZmZ d dlmZ d dlmZmZmZ  G d d	e      Z G d
 de      Z G d de      Z G d de      Z G d de
      Zy)    )datetime)OptionalList)Query)EmailStr)Field	BaseModel
ConfigDictfield_validator)FileResponseSchema)
BaseSchemaAddressCreateRequestSchemaAddressSchemac                   <   e Zd ZU  ed      Z edd      Zee   e	d<    edd      Z
ee   e	d<    edd	      Zee   e	d
<    edd      Zee   e	d<    edd      Zee   e	d<    edd      Zee   e	d<    edd      Zee   e	d<    edd      Zee   e	d<    edd      Zee   e	d<    edd      Zee   e	d<    edd      Zee   e	d<    edd      Zee   e	d<    edd      Zee   e	d<    edd      Zee   e	d <    edd!      Zee   e	d"<   y)#CustomerContactBaseT)from_attributesNzFirst name of Contactdefaultdescription
first_namezLast name of Contact	last_nameTitle of the contacttitlez%Designation of contact (legacy field)designationz>Relation of contact, inclusive of alphabetical characters onlyrelationzA valid email addressemailzPersonal phone numberphoneAccount phone numberaccount_phonezOffice phone numberoffice_phonez.Website of the customer contact (legacy field)websiteAccount website URLaccount_websitez!Date of birth (mm/dd/yyyy format)dobz)Tilled account id of the Customer Contact	tilled_idJActivation status of Customer, false denotes that the Customer is inactive	is_activez)Selected timezone of the customer contacttimezone)__name__
__module____qualname__r
   model_configr   r   r   str__annotations__r   r   r   r   r   r   r   r   r    r!   r#   r$   r   r%   r'   boolr(        i/var/www/html/hwPaymentPortal-be-dev/hw-payment-portal-api/src/apps/customers/schemas/customer_contact.pyr   r      s   d3L !&+!J   %* Ix}  !*E8C=  "';"K#  $THhsm  !&d@W XE8HX !;RSE8C=S#(CY#ZM8C=Z"'BW"XL(3-X #4=mnGXc]n%*4EZ%[OXc][ $D>abC(	b$? Ix}  !&`!Ix~  $?Hhsm r1   r   c                   |   e Zd ZU  eddddddddd	d
ddddddddddddddddd
gdi      Z ed      Zeed<    edd !      Z	e
e   ed"<    edd#!      Ze
e   ed$<    edd%!      Ze
e   ed&<    edd'!      Ze
e   ed(<    edd)!      Ze
e   ed*<    edd+!      Ze
e   ed,<    edd-!      Ze
ee      ed.<   y)/CustomerContactSchemaTexamplei  con_abcd1234efgh5678SarahWilsonzsarah.wilson@example.comz+1555789012zProject Managerzhttps://sarahwilson.example.comz1988-03-10T00:00:00ZprimaryzAmerica/Denverz2024-01-10T08:20:00Zz2024-01-15T12:35:00Z   z456 Contact Streetz
Building CDenverCO80202USmailingF)
idaddress_line_1address_line_2citystatezipcodecountryaddress_typeuse_as_defaultr'   )r@   
contact_idr   r   r   r   r   r#   r$   r   r(   r'   
created_at
updated_at	addressesr   json_schema_extrazId of Customer resourcer   r@   Nz4Unique id of Contact, typically of the form con_xxxxr   rI   r&   r'   z'Created date and time as unix timestamprJ   z'Updated date and time as unix timestamprK   z'Deleted date and time as unix timestamp
deleted_atz#Profile picture / avatar of contactavatarz#Customer's available addresses listrL   )r)   r*   r+   r
   r,   r   r@   intr.   rI   r   r-   r'   r/   rJ   r   rK   rP   rQ   r   rL   r   r   r0   r1   r2   r4   r4   C   sW   4%%3!.*#D-%,!44  *>*6 (!%#*#'(1*/%)
"LH  9:B: %J!J  !&`!Ix~  &+=&J"  &+=&J"  &+=&J"  ,19,FH'(  0590Ix]+, r1   r4   c                   h   e Zd ZU  eddddddddd	d
i      Z ed      Zeed<    ed      Z	eed<    ed      Z
eed<    edd      Zee   ed<    edd      Zee   ed<    edd      Zee   ed<    edd      Zee   ed<    edd      Zee   ed<    edd !      ed"               Zy)#"CustomerContactCreateRequestSchemaTr5   MichaelHussyzmichaelhussy@yopmail.comz+1 871 71123zHead of saleszhttps://example.comz1990-05-15T00:00:00Z)r   r   r   r   r   r#   r$   rM   z First name of Contact (required)rO   r   zLast name of Contact (required)r   z A valid email address (required)r   Nr   r   r   r   r   r"   r#   .ID of Uploaded image file to be used as avatar	avatar_idCustomer's billing addressaddressr$   before)modec                 2   ||S t        |t              r	 t        j                  |d      }|S |S # t        $ r] 	 d|v r&t        j
                  |j                  dd            }nt        j
                  |      }|cY S # t        $ r t	        d      w xY ww xY w)z+Validate date of birth format (mm/dd/yyyy).z%m/%d/%YTZz+00:00z4DOB must be in mm/dd/yyyy format or valid ISO format)
isinstancer-   r   strptime
ValueErrorfromisoformatreplace)clsvparsed_dates      r2   validate_dob_formatz6CustomerContactCreateRequestSchema.validate_dob_format   s     9Ha]&//:>""   	]]ax&.&<&<QYYsH=U&V&.&<&<Q&?&&! ]$%[\\]	]s!   0 	BA A=:B=BB)r)   r*   r+   r
   r,   r   r   r-   r.   r   r   r   r   r   r   r#   rX   rR   rZ   r   r   classmethodrh   r0   r1   r2   rT   rT      s%   '$3!/(#8-

L  6J  5Is  (JKE8K $)*$M8C=  !*E8C=  &+)&OXc] 
  %D Ix}  5:05GX01 
 U*  +r1   rT   c                       e Zd ZU  eddddddddd	d
ddddddddddddi      Z edd      Zee   e	d<    edd      Z
ee   e	d<    edd      Zee   e	d<   y)"CustomerContactUpdateRequestSchemaTr5   zUpdated JanezUpdated Smithzupdated.jane@example.comz+1555987654zSenior Account Managerzhttps://updated-example.comz1985-12-25T00:00:00ZFzAmerica/Chicago	secondaryz789 Updated BoulevardzUnit 20060601ChicagoILr>   r?   )rA   rB   rE   rC   rD   rF   rG   rH   )r   r   r   r   r   r#   r$   r'   r(   r   rZ   rM   Nr&   r   r'   rW   rX   rY   rZ   )r)   r*   r+   r
   r,   r   r'   r   r/   r.   rX   rR   rZ   r   r0   r1   r2   rk   rk      s    ,,3!.1#@-"-'&=&0&%!#$-&*	
L8 !&`!Ix~   %D Ix}  5:05GX01 r1   rk   c                   2    e Zd ZU  edd      Zee   ed<   y)CustomerContactListFilterSchemaNzHSearch by customer Contact name, email, transaction billing address, etcr   search)r)   r*   r+   r   rr   r   r-   r.   r0   r1   r2   rq   rq      s    !^FHSM r1   rq   N)r   typingr   r   fastapi.param_functionsr   pydantic.networksr   pydanticr   r	   r
   r   "src.apps.files.schemas.file_commonr   src.apps.base.schemas.commonr   r   r   r   r4   rT   rk   rq   r0   r1   r2   <module>ry      sg     ! ) & B B A ^ ^5* 5pA/ AHG)< GT()< (Vi r1   