
    ph                         d dl m Z  d dlmZmZmZmZ d dlmZ d dl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 G d de      Zy)    )datetime)DictOptionalListAny)UUID)	BaseModelFieldfield_validatorc                   z    e Zd ZU dZ edd      Zeed<    edd      Ze	e   ed<    e
d      ed	               Zy)
RetailerInfoz5Schema for retailer information in wine match payload.RET001examplecodeN
2025-07-15datec                 l    |r	 t        j                  |d       |S |S # t        $ r t        d      w xY w)Nz%Y-%m-%dz!Date must be in YYYY-MM-DD format)r   strptime
ValueError)clsvs     `/var/www/html/wine-match-dev/backend/winematch-backend/src/apps/wine_match/schemas/wine_match.pyvalidate_date_formatz!RetailerInfo.validate_date_format   sG     F!!!Z0 q  F !DEEFs    3)__name__
__module____qualname____doc__r
   r   str__annotations__r   r   r   classmethodr        r   r   r   	   sJ    ?c8,D#,l;D(3-;V  r#   r   c                       e Zd ZU dZ eddddddi      Zeeef   e	d	<    edd
d      Z
ee	d<    eddd      Zee   e	d<   y)WineMatchPayloadSchemaz,Schema for the wine matching process payload.z2Dictionary of retailers with their codes and dates	retailer1r   r   )r   r   )descriptionr   	retailersKEYWORDzThe type of matching to perform)r   r'   matchedTypeNFULLzThe operation modemode)r   r   r   r   r
   r(   r   r   r   r    r*   r,   r   r"   r#   r   r%   r%      sa    6).HxFG*ItC%& 
 S)AbcKcfBVWD(3-Wr#   r%   c                   T    e Zd ZU dZ edd      Zeed<    edd      Ze	e   ed<   y)	WineMatchBaseSchemazBase schema for wine match.California Cabernet Matchr   nameN4Matching configuration for California Cabernet winesr'   )
r   r   r   r   r
   r0   r   r    r'   r   r"   r#   r   r.   r.   $   s-    $c#>?D#?!&t5k!lK#lr#   r.   c                       e Zd ZdZy)WineMatchCreateSchemaz Schema for creating a wine matchN)r   r   r   r   r"   r#   r   r3   r3   *   s    *r#   r3   c                   Z    e Zd ZU dZ edd      Zee   ed<    edd      Z	ee   ed<   y)WineMatchUpdateSchemaz Schema for updating a wine matchNr/   r   r0   r1   r'   )
r   r   r   r   r
   r0   r   r   r    r'   r"   r#   r   r5   r5   /   s1    *.IJD(3-J!&t5k!lK#lr#   r5   c                   N    e Zd ZU dZeed<   eed<   eed<   eed<    G d d      Zy)	WineMatchOutSchemazSchema for wine match outputiduuid
created_at
updated_atc                       e Zd ZdZy)WineMatchOutSchema.ConfigTN)r   r   r   from_attributesr"   r#   r   Configr=   <   s    r#   r?   N)	r   r   r   r   intr    r   r   r?   r"   r#   r   r7   r7   5   s%    &G
J r#   r7   N)r   typingr   r   r   r   r9   r   pydanticr	   r
   r   r   r%   r.   r3   r5   r7   r"   r#   r   <module>rC      sg     , ,  6 6
9  XY Xm) m	/ 	
mI m, r#   