
    KCj#                         d Z ddlmZ ddl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	 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)uU  
Response schemas — the exact contract the client's frontend can rely on.

Every field is explicitly typed and Optional where a model can legitimately
have no answer (e.g. no SARIMAX model exists yet for a brand-new district).
This means the client gets a 200 with nulls in known places, never a
500 because a key was missing from a dict.
    )Optional)	BaseModelc                   R    e Zd ZU dZee   ed<   dZee   ed<   dZeed<   dZ	e
ed<   y)ClimateOutputNforecast_rainfall_mmforecast_temp_c        anomaly_scoreunknownanomaly_label)__name__
__module____qualname__r   r   float__annotations__r   r
   r   str     AC:\Crop_Prediction\Backend\crop-ai-system\app\schemas\response.pyr   r      s3    ,0(5/0'+OXe_+M5"M3"r   r   c                   6    e Zd ZU eed<   eed<   g Zee   ed<   y)FeasibilityOutputlabel
confidencetop_factorsN)r   r   r   r   r   r   r   listr   r   r   r   r      s    JKcr   r   c                   4    e Zd ZU eed<   dZeed<   dZeed<   y)YieldOutputexpected_yield_ton_har	   uncertainty_ton_haztonnes per hectareunitN)r   r   r   r   r   r   r    r   r   r   r   r   r      s       ##$D#$r   r   c                   6    e Zd ZU eed<   dZee   ed<   eed<   y)TrendOutputtrendNsloper   )r   r   r   r   r   r$   r   r   r   r   r   r"   r"   "   s    J!E8E?!r   r"   c                   6    e Zd ZU eed<   eed<   dZee   ed<   y)AlternativeCropcropscoreNreason)r   r   r   r   r   r   r)   r   r   r   r   r&   r&   (   s    
IL FHSM r   r&   c                       e Zd ZU ee   ed<   y)RecommendationOutputalternativesN)r   r   r   r   r&   r   r   r   r   r+   r+   .   s    ''r   r+   c                   >    e Zd ZU dZee   ed<   dZeed<   dZ	eed<   y)MarketOutputNprice_forecast_per_quintalr   demand_levelprice_volatility)
r   r   r   r/   r   r   r   r0   r   r1   r   r   r   r.   r.   2   s&    266!L#!%c%r   r.   c                   ^    e Zd ZU eed<   eed<   eed<   eed<   eed<   e	ed<   g Z
ee   ed<   y)	ModelOutputsclimatefeasibilityyield_predictionr#   recommendationmarket	conflictsN)r   r   r   r   r   r   r   r"   r+   r.   r9   r   r   r   r   r   r3   r3   8   s4    ""!!((ItCyr   r3   c                   X    e Zd ZU eed<   eed<   eed<   eed<   eed<   eed<   dZe	ed<   y	)
CropAnalysisResult
request_idinputmodelsexplanationmodel_versionprocessing_msFcachedN)
r   r   r   r   r   dictr3   intrB   boolr   r   r   r;   r;   B   s.    OKFDr   r;   c                   0    e Zd ZU dZeed<   eed<   eed<   y)ErrorResponseuK   Standard error shape returned for every 4xx/5xx — never a bare exception.
error_codemessager<   N)r   r   r   __doc__r   r   r   r   r   rG   rG   L   s    UOLOr   rG   N)rJ   typingr   pydanticr   r   r   r   r"   r&   r+   r.   r3   r;   rG   r   r   r   <module>rM      s     #I # 	  %) %) !i !(9 (&9 &9  I r   