
    KCjr                         d Z ddlZddlmZ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)u  
Authentication request/response schemas for the SaaS customer login flow.

Separate from app/schemas/request.py and response.py, which cover the
crop analysis API surface — auth has its own validation concerns
(password strength, email format) that don't belong mixed in there.
    N)	BaseModelEmailStrFieldfield_validatorc                       e Zd ZU eed<    eddd      Zeed<    edd	      Zedz  ed
<    edd	      Z	edz  ed<    e
d      ededefd              Zy)UserRegisterRequestemail.      )
min_length
max_lengthpasswordN   )r   	full_nameorganizationvreturnc                     t        j                  d|      st        d      t        j                  d|      st        d      |S )Nz[A-Za-z]z)Password must contain at least one letterz[0-9]z)Password must contain at least one number)research
ValueError)clsr   s     =C:\Crop_Prediction\Backend\crop-ai-system\app\schemas\auth.pyvalidate_password_strengthz.UserRegisterRequest.validate_password_strength   s=     yya(HIIyy1%HII    )__name__
__module____qualname__r   __annotations__r   r   strr   r   r   classmethodr    r   r   r   r      sq    O#!<Hc<!$37IsTz7$Tc:L#*:Z 3 3   !r   r   c                   "    e Zd ZU eed<   eed<   y)UserLoginRequestr	   r   N)r   r   r   r   r   r    r"   r   r   r$   r$      s    OMr   r$   c                   :    e Zd ZU eed<   eed<   dZeed<   eed<   y)TokenResponseaccess_tokenrefresh_tokenbearer
token_typeexpires_in_minutesN)r   r   r   r    r   r*   intr"   r   r   r&   r&   #   s    Jr   r&   c                       e Zd ZU eed<   y)RefreshTokenRequestr(   N)r   r   r   r    r   r"   r   r   r.   r.   *   s    r   r.   c                   V    e Zd ZU eed<   eed<   edz  ed<   edz  ed<   eed<   eed<   y)UserProfileResponseidr	   Nr   r   is_verified
created_at)r   r   r   r    r   boolr"   r   r   r0   r0   .   s+    GJTz*Or   r0   )__doc__r   pydanticr   r   r   r   r   r$   r&   r.   r0   r"   r   r   <module>r7      sQ    
 @ @)  y 
I ) ) r   