U
    è?tig  ã                   @   s\   d dl m Z  d dlmZmZmZmZ eeef eeee f dœdd„Zee	dœdd„Z
d	S )
é    )Údatetime)ÚDictÚAnyÚTupleÚOptional)Úcreator_infoÚreturnc                 C   sf   | sdS |   d¡dkrdS |   d¡dkr,dS |   d¡dkr>d	S |   d
¡dkrPd	S |   d¡dkrbdS dS )N)Fz'Unable to verify TikTok creator status.Zposting_disabledT)Fz6Posting is currently disabled for this TikTok account.Zpublish_disabled)Fz;Publishing is temporarily disabled for this TikTok account.Zcan_postF)Fz2This TikTok account cannot publish at this moment.Zcan_publishZcan_make_more_posts)Fz4Daily posting limit reached. Please try again later.)TN)Úget)r   © r
   ú./var/www/html/luxverbi-app/services/creator.pyÚcreator_can_post_now   s    r   )Ú
publish_atr   c                 C   s@   | pd  ¡ } | stdƒ‚t | ¡}|jdkr4tdƒ‚t| ¡ ƒS )zF
    Requiere ISO8601 con offset (ej: 2026-01-24T09:00:00+01:00).
    Ú Zmissing_publish_atNz5publish_at must include timezone offset (e.g. +01:00))ÚstripÚ
ValueErrorr   ÚfromisoformatÚtzinfoÚintÚ	timestamp)r   Údtr
   r
   r   Úparse_publish_at_iso_to_ts   s    

r   N)r   Útypingr   r   r   r   ÚstrÚboolr   r   r   r
   r
   r
   r   Ú<module>   s   $