
    2i                     :    d dl mZ  G d dej                        Zy)    )serializersc                       e Zd Z ej                         Z ej                   ej                  dd            Z ej                  dd      Z	 ej                  dd      Z
d Zy	)
CityTaxPreviewRequestSerializer      )
max_digitsdecimal_places)childF   )required	min_valuec                 J   h d}|j                  |j                               st        j                  d      d|d   cxk  rdk  sn t        j                  d      d|d   cxk  rdk  sn t        j                  d      |d   |d   kD  rt        j                  d	      |S )
N>   yearto_month
from_monthz0Period must include from month, to month or yearr   r      u   from_month must be 1–12r   u   to_month must be 1–12z!from_month cannot exceed to_month)issubsetkeysr   ValidationError)selfvaluer   s      3/backend/structures/serializers_city_tax_preview.pyvalidate_periodz/CityTaxPreviewRequestSerializer.validate_period   s    5  .--.`aaE,'-2---.IJJE*%++--.GHHz!22--.QRR    N)__name__
__module____qualname__r   	DictFieldperiodDecimalFieldratesIntegerFieldproperty_type_idproperty_idr    r   r   r   r      sf    "[""$F!K!!&k&&!AFE 0{//!L*+**EQGKr   r   N)rest_frameworkr   
Serializerr   r%   r   r   <module>r(      s    &k&<&< r   