
    /i@                         d dl m Z  d dlmZm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)    )datetime)OptionalList)	BaseModelFieldfield_validator
ConfigDictc                       e Zd ZU eed<    edd      Zeed<    eddd      Zeed	<    edd
      Z	e
ed<   dZeed<    ed	      ededefd              Z ed      ededefd              Zy)ProductBasereference_id.   
min_lengthproduct_name      )r   
max_lengthbarcoder   gtmspFstatusvreturnc                 <    |j                         st        d      |S )NzBarcode must be numericisdigit
ValueErrorclsr   s     9/var/www/html/marco-python-backend/app/schemas/product.pyvalidate_barcodezProductBase.validate_barcode   s     yy{677    c                 <    |j                         rt        d      |S Nz-Product name cannot consist solely of numbersr   r   s     r!   validate_product_namez!ProductBase.validate_product_name   s     99;LMMr#   N)__name__
__module____qualname__int__annotations__r   r   strr   r   floatr   boolr   classmethodr"   r&    r#   r!   r   r      s    ca0L#0r:GS:sq!C!FDY     
 ^$c c   %r#   r   c                       e Zd Zy)ProductCreateN)r'   r(   r)   r0   r#   r!   r2   r2      s    r#   r2   c                       e Zd ZU  edd      Zee   ed<    edd      Zee	   ed<   dZ
ee   ed<    ed      ed	ee   d
ee   fd              Zy)ProductUpdateNr   r   r   r   r   r   r   r   r   c                 @    ||j                         rt        d      |S r%   r   r   s     r!   r&   z#ProductUpdate.validate_product_name%   s"     =QYY[LMMr#   )r'   r(   r)   r   r   r   r,   r+   r   r-   r   r.   r   r/   r&   r0   r#   r!   r4   r4       so    "'";L(3-; !,C%,!FHTN!^$hsm    %r#   r4   c                   `    e Zd ZU eed<   eed<   eed<   dZee   ed<   dZ	eed<    e
d	      Zy)
ProductResponseid
created_at
updated_atNlast_execution_timer   violation_countT)from_attributes)r'   r(   r)   r*   r+   r   r;   r   r,   r<   r	   model_configr0   r#   r!   r7   r7   -   s6    G)-#-OSd3Lr#   r7   c                   <    e Zd ZU ee   ed<   eed<   eed<   eed<   y)ProductListResponseitemstotalpagelimitN)r'   r(   r)   r   r7   r+   r*   r0   r#   r!   r@   r@   7   s      J
IJr#   r@   N)r   typingr   r   pydanticr   r   r   r	   r   r2   r4   r7   r@   r0   r#   r!   <module>rG      sM     ! B B) ,	K 	
I 
4k 4) r#   