Ë
    KµCj	  ã            	       óì   — d Z ddlmZ ddlmZmZmZmZ i 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d“dd“dd“dd“dddddd d d!œ¥Z G d"„ d#e«      Z	 G d$„ d%e«      Z
 G d&„ d'e«      Zy())u  
Input schema for the /analyze endpoint.

This is the single most important validation surface in the system â€”
every downstream model depends on this data being clean. We validate
aggressively here so bad input never reaches a model and produces a
silently wrong prediction.

Design choice: crop/district lookups are loaded from data/lookup/*.json
at startup (see app/services/reference_data.py) rather than hardcoded
here, so the client coordinator can update supported crops/districts
without a code change and redeploy.
é    )ÚUnion)Ú	BaseModelÚFieldÚfield_validatorÚmodel_validatorÚjanuaryé   ÚjanÚfebruaryé   ÚfebÚmarché   ÚmarÚaprilé   ÚaprÚmayé   Újuneé   ÚjunÚjulyé   ÚjulÚaugusté   ÚaugÚ	septemberé	   Úsepé
   é   é   )ÚseptÚoctoberÚoctÚnovemberÚnovÚdecemberÚdecc                   ó2  — e Zd ZU  eddddg¬«      Zeed<    eddddg¬«      Zeed	<    edd
dg¬«      Ze	ee
f   ed<    edd¬«      Zedz  ed<    edd	«      ededefd„«       «       Z ed«      ede	ee
f   de
fd„«       «       Z ed¬«      dd„«       Zy)ÚCropAnalysisRequest.r   é2   Úrice)Ú
min_lengthÚ
max_lengthÚexamplesÚcropéd   Ú	ThanjavurÚlocationÚJuner   )r2   ÚmonthNzvOptional ID of a saved CropPlan this analysis belongs to (SaaS dashboard use). Omit for one-off / API-key-based calls.)ÚdescriptionÚcrop_plan_idÚvÚreturnc                 ó\   — |j                  «       j                  «       }|st        d«      ‚|S )Nz(Field cannot be empty or whitespace only)ÚstripÚlowerÚ
ValueError)Úclsr;   Úcleaneds      ú@C:\Crop_Prediction\Backend\crop-ai-system\app\schemas\request.pyÚstrip_and_lowercasez'CropAnalysisRequest.strip_and_lowercase-   s*   € ð —'‘'“)—/‘/Ó#ˆÙÜÐGÓHÐHØˆó    c                 óš  — t        |t        «      r$d|cxk  rdk  st        d«      ‚ t        d«      ‚|S t        |t        «      r}|j	                  «       j                  «       }|j                  «       r/t        |«      }d|cxk  rdk  st        d«      ‚ t        d«      ‚|S |t        vrt        d|› d�«      ‚t        |   S t        d«      ‚)Nr	   r$   zMonth must be between 1 and 12ú'z[' is not a recognized month name. Use a full or short English month name, or a number 1-12.z!Month must be a string or integer)Ú
isinstanceÚintr@   Ústrr>   r?   ÚisdigitÚMONTH_NAME_TO_NUMBER)rA   r;   ÚkeyÚnums       rC   Únormalize_monthz#CropAnalysisRequest.normalize_month5   sØ   € ô �aœÔØ˜”<˜R’<Ü Ð!AÓBÐBð  Ü Ð!AÓBÐBØˆHÜ�aœÔØ—'‘'“)—/‘/Ó#ˆCØ�{‰{Œ}Ü˜#“h�Ø˜C”~ 2’~Ü$Ð%EÓFÐFð &Ü$Ð%EÓFÐFØ�
ØÔ.Ñ.Ü Ø˜�sð Pð Qóð ô (¨Ñ,Ð,ÜÐ<Ó=Ð=rE   Úafter)Úmodec                 ó   — | S )N© )Úselfs    rC   Úvalidate_combinationz(CropAnalysisRequest.validate_combinationK   s	   € ð ˆrE   )r<   r-   )Ú__name__Ú
__module__Ú__qualname__r   r3   rJ   Ú__annotations__r6   r8   r   rI   r:   r   ÚclassmethodrD   rO   r   rU   rS   rE   rC   r-   r-   #   sì   … Ù�c a°BÀ&ÀÔJ€Dˆ#ÓJÙ˜#¨!¸À{ÀmÔT€HˆcÓTÙ" 3°&¸!°Ô=€Eˆ5��c�‰?Ó=Ù$ØðTô €L�#˜‘*ó ñ �V˜ZÓ(Øð Cð ¨Cò ó ó )ðñ �WÓØð>  c¨3 h¡ð >°Cò >ó ó ð>ñ( ˜'Ô"òó #ñrE   r-   c                   ó4   — e Zd ZU dZeed<   dZeed<   eed<   y)ÚTaskSubmissionResponseuJ   Returned immediately by POST /analyze â€” the job is queued, not done yet.Útask_idÚqueuedÚstatusÚpoll_urlN)rV   rW   rX   Ú__doc__rJ   rY   r_   rS   rE   rC   r\   r\   T   s   … ÙTØƒLØ€FˆCÓØ„MrE   r\   c                   óJ   — e Zd ZU eed<   eed<   dZedz  ed<   dZedz  ed<   y)ÚTaskStatusResponser]   r_   NÚresultÚerror)rV   rW   rX   rJ   rY   rd   Údictre   rS   rE   rC   rc   rc   [   s(   … ØƒLØƒKØ€FˆD�4‰KÓØ€Eˆ3�‰:ÔrE   rc   N)ra   Útypingr   Úpydanticr   r   r   r   rL   r-   r\   rc   rS   rE   rC   ú<module>ri      s  ðñõ ç GÓ GðØˆqðØ˜ðà�ðà˜!ðð ˆQðð �qðð ˆQð	ð �qð	ð
 
ˆ1ðð ˆAðð �aðð ˆAðð �aðð ˆaðð ˜ðð �ðð ˜1ðð '(Ø˜"Ø˜2Ø˜2òÐ ô .˜)ô .ôb˜Yô ô˜õ rE   