o
    ̿Si}                     @   s   d dl m Z  d dlmZmZ d dlmZmZmZmZ d dl	m
Z
 ddlmZ ddlmZ G dd	 d	eZG d
d deZG dd deZG dd deZG dd deZG dd deZG dd deZG dd deZededZG dd de
ee ZeeeeeeedZdefddZd S )!    )datetime)	BaseModelField)OptionalListTypeVarGeneric)GenericModel   )
CommonBase)SaaSInvoicesc                   @   s   e Zd ZU edddZeed< edddZeed< edddZ	eed	< ed
ddZ
ee ed< edddZeed< edddZeed< ed
ddZee ed< d
S )FeatureBase.zName of the featuredescriptionnameTz1Flag to indicate if the feature should be visibledisplayzURL for the featureurlNz'API URL for the feature (if applicable)apiurlzIcon identifier for the featureiconz3Category of the feature (e.g. 'saas' or 'platform')categoryzDescription of the featurer   )__name__
__module____qualname__r   r   str__annotations__r   boolr   r   r   r   r   r    r   r   5/var/www/html/Trade-python/app/v1/models/crudmodel.pyr   
   s   
 r   c                   @   s|   e Zd ZU eed< eed< eed< dZee ed< dZee ed< dZ	ee ed< e
dd	Zee ed
< dZee ed< dS )	Portfoliosymbolquantityaverage_priceNcurrent_pricenotesstrategymanual)defaultsourceexecuted_at)r   r   r   r   r   floatr"   r   r#   r$   r   r'   r(   r   r   r   r   r   r      s   
 r   c                   @   s   e Zd ZU edddZeed< edddZeed< edddZeed< ed	d
dZ	e
e ed< ed	ddZe
e ed< ed	ddZe
e ed< ed	ddZe
e ed< edddZe
e ed< ed	ddZe
e ed< d	S )ZerodhaSettings.zZerodha Kite API keyr   api_keyzZerodha Kite API secret
api_secretzOAuth Redirect URLredirect_urlNzZerodha user IDbroker_user_idzAccess token after loginaccess_tokenzPublic tokenpublic_tokenzLogin timestamp
login_timeinactivez*Connection status: active/inactive/expiredstatuszOptional admin notesr#   )r   r   r   r   r+   r   r   r,   r-   r.   r   r/   r0   r1   r   r3   r#   r   r   r   r   r*       s   
 r*   c                   @   s.   e Zd ZU eed< dZee ed< eed< dS )DummyCitiesr   Nstatecountry)r   r   r   r   r   r5   r   r   r   r   r   r4   .   s   
 r4   c                   @   sF   e Zd ZU eed< dZee ed< dZee ed< dZ	ee ed< dS )DVehicleCategoryr   Nrateunit	base_rate)
r   r   r   r   r   r8   r   r)   r9   r:   r   r   r   r   r7   4   s
   
 r7   c                   @   sN   e Zd ZU eed< dZee ed< eed< dZee ed< dZ	ee ed< dS )DummyPriceTyper   Nr3   currencycitypricing_file)
r   r   r   r   r   r3   r   r=   intr>   r   r   r   r   r;   ;   s   
 r;   c                   @   sN   e Zd ZU eed< eed< dZee ed< dZee ed< dZ	ee ed< dS )LocationsBaser   addressNlatitude	longitudetype)
r   r   r   r   r   rB   r   r)   rC   rD   r   r   r   r   r@   D   s   
 r@   c                   @   s6   e Zd ZU dZee ed< eej	dZ
ee ed< dS )CommonUpdateNuser_id)default_factoryupdated_date)r   r   r   rF   r   r   r   r   r   utcnowrH   r   r   r   r   rE   L   s   
 rE   	ModelType)boundc                   @   s"   e Zd ZU eed< ee ed< dS )
CommonListtotal_countitemsN)r   r   r   r?   r   r   rJ   r   r   r   r   rL   T   s   
 rL   )featuresdummycitiesdummypricetypedummyvehiclecategorysaasinvoices	portfoliozerodhacollection_namec                 C   s*   t |  }|du rtd|  d|S )zy
    Resolve the collection name to a Pydantic model using the mapping.
    This function is called by your routers.
    NzModel for collection 'z' not found.)MODEL_MAPPINGgetlower
ValueError)rV   model_classr   r   r   get_model_for_collectiond   s   r\   N)r   pydanticr   r   typingr   r   r   r   pydantic.genericsr	   	basemodelr   saas.subscriptionsr   r   r   r*   r4   r7   r;   r@   rE   rJ   rL   rW   r   r\   r   r   r   r   <module>   s2    	