
    NCi9                     T   d Z ddlmZmZ ddlmZmZ ddlm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 G d de      Z G d de      Zy) u*   
Schémas Pydantic pour les prescriptions
    )	BaseModelField)ListOptional)datetime)PrescriptionStatus)UserMinimalResponsec                   D    e Zd ZU dZeed<   dZee   ed<   dZee   ed<   y)PrescriptionProductBasez)Base pour les produits d'une prescriptionproduct_name_extractedNdosageform)	__name__
__module____qualname____doc__str__annotations__r   r   r        @/home/www/lebenam.kofcorporation.com/app/schemas/prescription.pyr   r      s'    3 FHSM D(3-r   r   c                   H    e Zd ZU dZdZee   ed<   dZe	ed<    G d d      Z
y)PrescriptionProductInSearchu(   Produit dans les résultats de rechercheN
product_idFfoundc                       e Zd ZdZy)"PrescriptionProductInSearch.ConfigTNr   r   r   from_attributesr   r   r   Configr          r   r    )r   r   r   r   r   r   intr   r   boolr    r   r   r   r   r      s'    2 $J$E4 r   r   c                   t    e Zd ZU dZeed<   eed<   ee   ed<   eed<   ee   ed<   ee   ed<    G d d	      Zy
)PrescriptionProductResponseu-   Réponse avec les détails du produit trouvéidprescription_idr   r   r   r   c                       e Zd ZdZy)"PrescriptionProductResponse.ConfigTNr   r   r   r   r    r)   $   r!   r   r    N)	r   r   r   r   r"   r   r   r   r    r   r   r   r%   r%      s>    7GSM
3- r   r%   c                       e Zd ZdZy)PrescriptionCreateu2   Création d'une prescription (upload d'ordonnance)N)r   r   r   r   r   r   r   r+   r+   )   s    <r   r+   c                   l    e Zd ZU dZeed<   eed<   eed<   eed<   eed<   g Z	e
e   ed<    G d d	      Zy
)PrescriptionResponseu&   Réponse de base pour une prescriptionr&   user_idprescription_filestatus
created_atproductsc                       e Zd ZdZy)PrescriptionResponse.ConfigTNr   r   r   r   r    r4   6   r!   r   r    Nr   r   r   r   r"   r   r   r   r   r2   r   r%   r    r   r   r   r-   r-   -   s;    0GL24Hd./4 r   r-   c                   l    e Zd ZU dZeed<   eed<   eed<   eed<   eed<   g Z	e
e   ed<    G d d	      Zy
)PrescriptionDetailResponseu2   Détails complets d'une prescription avec produitsr&   r.   r/   r0   r1   r2   c                       e Zd ZdZy)!PrescriptionDetailResponse.ConfigTNr   r   r   r   r    r9   B   r!   r   r    Nr5   r   r   r   r7   r7   9   s;    <GL24Hd./4 r   r7   c                       e Zd ZU dZ ed      Zeed<   dZe	e   ed<   dZ
e	e   ed<   dZe	e   ed<   dZe	e   ed	<   dZe	e   ed
<   dZeed<    G d d      Zy)PrescriptionSearchProductAdminu5   Produit dans les résultats de recherche pour l'adminproduct_name)aliasr   Nr   r   quantity_available
unit_pricer   Fr   c                       e Zd ZdZy)%PrescriptionSearchProductAdmin.ConfigTNr   r   r   r   r    rA   O   r!   r   r    )r   r   r   r   r   r   r   r   r   r   r   r>   r"   r?   floatr   r   r#   r    r   r   r   r;   r;   E   sp    ?"'n"=C= FHSM D(3-(,,"&J& $J$E4 r   r;   c                       e Zd ZU dZeed<   eed<   eed<   eed<   ee   ed<   e	ed<   e
e	   ed<   eed	<   eed
<   eed<    G d d      Zy)AdminPrescriptionSearchResponseu8   Réponse pour une recherche de prescription pour l'adminr&   r'   
partner_iduserproducts_foundtotal_pricedistance_kmall_products_availableprescriptionr1   c                        e Zd ZdZed        Zy)&AdminPrescriptionSearchResponse.ConfigTc                 .    | j                   j                  S )N)rK   rF   )objs    r   get_userz/AdminPrescriptionSearchResponse.Config.get_usere   s    ##(((r   N)r   r   r   r   staticmethodrP   r   r   r   r    rM   b   s    		) 
	)r   r    N)r   r   r   r   r"   r   r	   r   r;   rB   r   r#   r-   r   r    r   r   r   rD   rD   R   sS    BGO
788%   &&) )r   rD   c                       e Zd ZU dZeed<   eed<   eed<   eed<   eed<   dZe	e   ed<   eed	<   eed
<    G d d      Z
y)PharmacyStockInfoz(Information sur le stock d'une pharmaciepharmacy_idpharmacy_namephysical_addressgps_latitudegps_longitudeNrI   quantityr?   c                       e Zd ZdZy)PharmacyStockInfo.ConfigTNr   r   r   r   r    r[   v   r!   r   r    )r   r   r   r   r"   r   r   rB   rI   r   r    r   r   r   rS   rS   k   sF    2#'K%'M r   rS   c                   X    e Zd ZU dZeed<   eed<   eed<   eed<   eed<   g Zee	   ed<   y)	ProductSearchResultu&   Résultat de recherche pour un produitr   r<   r   r   unit
pharmaciesN)
r   r   r   r   r"   r   r   r_   r   rS   r   r   r   r]   r]   y   s/    0O
IK
I*,J&',r   r]   c                   l    e Zd ZU dZeed<   eed<   eed<   eed<   eed<   eed<   eed<    G d	 d
      Zy)PrescriptionSearchResponseu%   Réponse de recherche de prescriptionr&   r'   rI   total_products_foundtotal_products_searchedtotal_pharmacies_foundr1   c                       e Zd ZdZy)!PrescriptionSearchResponse.ConfigTNr   r   r   r   r    rf      r!   r   r    N)	r   r   r   r   r"   r   rB   r   r    r   r   r   ra   ra      s8    /G   r   ra   c                   &    e Zd ZU dZg Zee   ed<   y) PrescriptionSearchDetailResponseu.   Détails complets de recherche avec résultatsresultsN)r   r   r   r   ri   r   r]   r   r   r   r   rh   rh      s    8)+GT%&+r   rh   N)r   pydanticr   r   typingr   r   r   app.models.prescriptionr   app.schemas.userr	   r   r   r%   r+   r-   r7   r;   rD   rS   r]   ra   rh   r   r   r   <module>rn      s    & !  6 0i "9 
"9 
	 	
9 

 
Y )i )2	 -) - ,'A ,r   