Ë
    t0=i]  ã                  ól   — d Z ddlmZ ddlmZ ddlmZ  G d„ dej                  «      Z G d„ de«      Z	y	)
z&Django models for wallet transactions.é    )Úannotations)ÚDecimal)Úmodelsc                  óÒ  — e Zd ZdZ ej
                  ddd¬«      Z ej                  dd¬«      Z ej                  dd¬«      Z	 ej
                  d	d
dgd¬«      Z
 ej                  ddd¬«      Z ej                  ddd¬«      Z ej                  dddd¬«      Z ej                   ddd¬«      Z ej$                  ddd¬«      Z ej(                  edd¬«      Z G d„ d«      Zd d„Zy)!ÚAbstractWalletTransactiona£  
    Abstract base model for storing wallet transaction records.
    
    Extend this model if you want to customize the table name or field definitions.
    When you extend this abstract model with a custom db_table, only ONE table
    will be created (your custom table), not the default wallet_transactions table.
    
    Example:
        class CustomWalletTransaction(AbstractWalletTransaction):
            amount = models.DecimalField(max_digits=20, decimal_places=8)
            balance = models.DecimalField(max_digits=20, decimal_places=8)
            
            class Meta:
                db_table = "custom_wallet_trans"  # Only this table will be created
    é2   TzBWallet type / point type (e.g., 'credit_balance', 'reward_points'))Ú
max_lengthÚdb_indexÚ	help_textzDInitiator ID - user who performed this transaction (-100 for system))r
   r   zUser ID - owner of the walleté   )Úcz
Credit/Add)ÚdzDebit/Deductz:Transaction type: 'c' for credit/add, 'd' for debit/deduct)r	   Úchoicesr   é   é   zTransaction amount)Ú
max_digitsÚdecimal_placesr   zBalance after this transactionzGTransaction type code (integer constant, e.g., 1000 for wallet-deposit))r
   ÚnullÚblankr   Ú zRemarks/description)r   Údefaultr   zCreation date/time)Úauto_now_addr
   r   z Additional fields stored as JSON)r   r   r   c                  óº   — e Zd ZdZ ej
                  ddg¬«       ej
                  ddg¬«       ej
                  ddg¬«       ej
                  ddg¬«      gZdgZy	)
úAbstractWalletTransaction.MetaTÚuidÚwtype)ÚfieldsÚcdateÚ
trans_typeÚiidz-cdateN)Ú__name__Ú
__module__Ú__qualname__Úabstractr   ÚIndexÚindexesÚordering© ó    úV/home/cursorai/projects/telegram-earn/packages/wallet_utils/src/wallet_utils/models.pyÚMetar   M   sc   „ ØˆàˆF�L‰L ¨Ð 0Ô1ØˆF�L‰L ¨Ð 0Ô1ØˆF�L‰L ¨,Ð 7Ô8ØˆF�L‰L ¨Ð 0Ô1ð	
ˆð �:‰r)   r+   c                óˆ   — | j                   j                  «       › d| j                  › d| j                  › d| j                  › �S )NÚ z - User )ÚtypeÚupperÚamountr   r   )Úselfs    r*   Ú__str__z!AbstractWalletTransaction.__str__W   s7   € Ø—)‘)—/‘/Ó#Ð$ A d§k¡k ]°!°D·J±J°<¸xÈÏÉÀzÐRÐRr)   N)ÚreturnÚstr)r!   r"   r#   Ú__doc__r   Ú	CharFieldr   ÚBigIntegerFieldr    r   r.   ÚDecimalFieldr0   ÚbalanceÚIntegerFieldr   Ú	TextFieldÚdescrÚDateTimeFieldr   Ú	JSONFieldÚdictÚ
extra_datar+   r2   r(   r)   r*   r   r   
   s<  „ ñð  ˆF×ÑØØØVô€Eð
 !ˆ&×
 Ñ
 ØØXô€Cð !ˆ&×
 Ñ
 ØØ1ô€Cð ˆ6×ÑØØ$Ð&;Ð<ØNô€Dð
 !ˆV× Ñ ØØØ&ô€Fð
 "ˆf×!Ñ!ØØØ2ô€Gð
 %�×$Ñ$ØØØØ[ô	€Jð ˆF×ÑØØØ'ô€Eð
 !ˆF× Ñ ØØØ&ô€Eð
 "�×!Ñ!ØØØ4ô€J÷ñ ôSr)   r   c                  ó:   — e Zd ZdZ G d„ dej
                  «      Zy)ÚWalletTransactionaÚ  
    Concrete model for storing wallet transaction records.
    
    This is the default implementation that creates the 'wallet_transactions' table.
    Use this model directly, or extend AbstractWalletTransaction for custom implementations.
    
    If you extend AbstractWalletTransaction with a custom db_table, only your custom
    table will be created (not this one), as long as you skip running wallet_utils
    migrations or exclude this model from migrations.
    c                  ó   — e Zd ZdZy)úWalletTransaction.MetaÚwallet_transactionsN)r!   r"   r#   Údb_tabler(   r)   r*   r+   rD   g   s   „ Ø(‰r)   r+   N)r!   r"   r#   r5   r   r+   r(   r)   r*   rB   rB   [   s   „ ñ	ô)Ð(×-Ñ-õ )r)   rB   N)
r5   Ú
__future__r   Údecimalr   Ú	django.dbr   ÚModelr   rB   r(   r)   r*   Ú<module>rK      s3   ðÙ ,å "å å ôNS §¡ô NSôb)Ð1õ )r)   