o
    fsi                     @   sL   d dl mZ d dlmZ d dlmZ G dd dejZG dd dejZdS )	    )models)User)timezonec                   @   s   e Zd ZdZejdddZejddZej	dej
dddd	d
ZejdddZejddZejddZG dd dZdd Zedd ZdS )ApparelItemzIGeneric configurable merchandise/apparel item for distribution at events.   z-e.g. "ICTAZ AGM 2025 T-Shirts", "Goodie Bags")
max_length	help_textTblankzevents.Eventapparel_itemsz7Optional: link to the event this item is distributed at)	on_deletenullr
   related_namer   z'Only active items appear in the scanner)defaultr   )auto_now_add)auto_nowc                   @   s   e Zd ZdgZdZdZdS )zApparelItem.Metaz-created_atzApparel ItemzApparel ItemsN)__name__
__module____qualname__orderingverbose_nameverbose_name_plural r   r   :/var/www/html/smartRegister/backend/apps/apparel/models.pyMeta   s    r   c                 C   s   | j S N)nameselfr   r   r   __str__   s   zApparelItem.__str__c                 C   s
   | j  S r   )collectionscountr   r   r   r   collection_count   s   
zApparelItem.collection_countN)r   r   r   __doc__r   	CharFieldr   	TextFielddescription
ForeignKeySET_NULLeventBooleanField	is_activeDateTimeField
created_at
updated_atr   r   propertyr"   r   r   r   r   r      s     r   c                   @   s   e Zd ZdZejeejddZej	dddZ
ej	ddZejdd	Zej	ddd
ZejejdZejeejdddZejdd	ZG dd dZdd ZdS )CollectionRecorduN   Records that a paid member has collected an apparel item — via barcode scan.r    )r   r   d   T)r   db_indexr   )r   r	   )r   r
   )r   )r   r   r
   c                   @   s"   e Zd ZddgZdgZdZdZdS )zCollectionRecord.Metaapparel_itemregistration_codez-collected_atzCollection RecordzCollection RecordsN)r   r   r   unique_togetherr   r   r   r   r   r   r   r   +   s
    r   c                 C   s   | j  d| jj S )Nu    — )	full_namer3   r   r   r   r   r   r   1   s   zCollectionRecord.__str__N)r   r   r   r#   r   r'   r   CASCADEr3   r$   r4   r6   
EmailFieldemailpayment_statusr,   r   nowcollected_atr   r(   recorded_byr%   notesr   r   r   r   r   r   r0       s    r0   N)		django.dbr   django.contrib.auth.modelsr   django.utilsr   Modelr   r0   r   r   r   r   <module>   s
    