Ë
    ›j#  ã                  ó,   — d Z ddlmZ ddlmZmZ dd„Zy)u%  
Input validators for form and API data.

validate_amount() is the canonical money-input parser:
  - Strips whitespace, leading '$', commas
  - Raises ValueError for non-numeric, zero, or negative values
  - Returns Decimal rounded to 2 decimal places
  - Never returns float â€” Decimal only
é    )Úannotations)ÚDecimalÚInvalidOperationc                óF  — | €t        d«      ‚t        | t        «      r<| j                  «       j	                  d«      j                  dd«      } | st        d«      ‚	 t        t        | «      «      }|dk  rt        d«      ‚t        |d«      S # t        $ r t        d«      ‚w xY w)a2  
    Parse and validate a monetary amount from user input.

    Args:
        value: str, int, float, or Decimal representing a money amount.

    Returns:
        Decimal rounded to 2 decimal places (e.g. Decimal('29.99')).

    Raises:
        ValueError: If value is non-numeric, zero, or negative.
    z Amount must be a positive numberú$ú,Ú r   é   )	Ú
ValueErrorÚ
isinstanceÚstrÚstripÚlstripÚreplacer   r   Úround)ÚvalueÚamounts     ú0/var/www/html/financials/app/utils/validators.pyÚvalidate_amountr      s¥   € ð €}ÜÐ;Ó<Ð<ô %œÔØ—‘“×$Ñ$ SÓ)×1Ñ1°#°rÓ:ˆÙÜÐ?Ó@Ð@ð=Üœ˜U›Ó$ˆð ‚{ÜÐ;Ó<Ð<ä˜ÓÐøô ò =ÜÐ;Ó<Ð<ð=ús   ÁB ÂB N)Úreturnr   )Ú__doc__Ú
__future__r   Údecimalr   r   r   © ó    r   ú<module>r      s   ðñõ #ç -ôr   