
    !+i                      Z    d Z ddlmZ ddlmZmZmZmZmZ ddlm	Z	 ddl
Z
 G d de	      Zy)z
User model for authentication
    )datetime)ColumnIntegerStringBooleanDateTime)BaseNc                   $   e Zd ZdZ eedd      Z e ed      ddd      Z e ed      d      Z	 e ed      d      Z
 e ed	      d
      Z eed      Z eeej                         Z eed      Zededefd       ZdedefdZy)UserusersT)primary_keyautoincrement   F)uniquenullableindex)r   d   2   admin)defaultpasswordreturnc                 d    t        j                  | j                               j                         S )z3Simple hash for password - in production use bcrypt)hashlibsha256encode	hexdigest)r   s    =/var/www/hypershopcomercio.com.br/hyper-ai/app/models/user.pyhash_passwordzUser.hash_password   s#     ~~hoo/0::<<    c                 >    | j                   | j                  |      k(  S )N)password_hashr   )selfr   s     r   verify_passwordzUser.verify_password   s    !!T%7%7%AAAr    N)__name__
__module____qualname____tablename__r   r   idr   emailr"   nameroler   	is_activer   r   utcnow
created_at
last_loginstaticmethodstrr   boolr$    r    r   r   r   
   s    M	T	>B6#;te4HE6#;7M&+-D&*g.Dw-I(//:J40J= = = =B B Br    r   )__doc__r   
sqlalchemyr   r   r   r   r   app.core.databaser	   r   r   r4   r    r   <module>r8      s)     A A " B4 Br    