
    E8i`                    V    d Z ddlmZ ddlmZ ddlmZ  G d dej                        Zy)z+Commission tracking across referral levels.    )annotations)Decimal)modelsc                     e Zd ZdZdZdZedfedfgZ ej                  dej                  d      Z
 ej                  dej                  d	      Z ej                  d
ej                  d      Z ej                         Z ej                  dd      Z ej                  dd      Z ej$                  dee      Z ej(                  d      Z ej(                  dd      Z G d d      ZddZy)
Commissionz:Stores multi-level commissions derived from daily rewards.pendingdistributedPendingDistributedz
users.Usercommissions_earned)	on_deleterelated_namecommissions_paidzinvestments.Rewardcommissions      )
max_digitsdecimal_places      )
max_lengthchoicesdefaultT)auto_now_add)nullblankc                  d    e Zd ZdZ ej
                  ddg       ej
                  ddg      gZy)Commission.Metar   upline_userstatus)fieldsrewardlevelN)__name__
__module____qualname__db_tabler   Indexindexes     F/home/cursorai/projects/telegram-earn/backend/apps/referrals/models.pyMetar   .   s4     FLL 9:FLL7 34
r+   r-   c                T    d| j                    d| j                   d| j                   S )NzCommission Lz to z from reward )r#   upline_user_id	reward_id)selfs    r,   __str__zCommission.__str__5   s.    djj\d.A.A-B-PTP^P^O_``r+   N)returnstr)r$   r%   r&   __doc__STATUS_PENDINGSTATUS_DISTRIBUTEDSTATUS_CHOICESr   
ForeignKeyCASCADEr   downline_userr"   IntegerFieldr#   DecimalFieldcommission_rateamount	CharFieldr    DateTimeField
created_atdistributed_atr-   r2   r*   r+   r,   r   r   
   s   DN&	#	]+N
 $&##..)K
 &F%%..'M
 V.."F
  F!E)f))QqIO V  BqAFVF
 &%%48J)V))t4@N
 
ar+   r   N)	r5   
__future__r   decimalr   	django.dbr   Modelr   r*   r+   r,   <module>rH      s#    1 "  ,a ,ar+   