HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: //home/arjun/projects/buyercall/buyercall/blueprints/agents/__pycache__/serializers.cpython-310.pyc
o

we�	�@s�ddlmZddlmZmZddlmZmZddlm	Z	ddl
mZddlm
Z
Gdd�dej�ZGd	d
�d
ej�ZGdd�dej�ZGd
d�dej�ZdS)�)�fields)�Agent�Team)�Partnership�PartnershipAccount)�User)�ma)�generate_presigned_file_urlc@s,eZdZe�d�ZGdd�d�Zdd�ZdS)�AgentWithoutTeamSchema�get_agent_rolec@�eZdZeZgd�ZdS)zAgentWithoutTeamSchema.Meta)�sid�	firstname�lastname�phonenumber�email�roleN��__name__�
__module__�__qualname__r�modelr�rr�I/home/arjun/projects/buyercall/buyercall/blueprints/agents/serializers.py�Meta
�rcCs|jjS�N��userr��self�objrrrrsz%AgentWithoutTeamSchema.get_agent_roleN)rrrr�Methodrrrrrrrr

s
r
c@s\eZdZe�d�Ze�d�Zejdd�dd�Ze	j
dd�ZGd	d
�d
�Zdd�Z
d
d�ZdS)�
TeamSchema�get_partnership_account_id�get_partnership_idcCs
tdd�S�NT)�many)r
rrrr�<lambda>s
zTeamSchema.<lambda>T)�	dump_only�name)�	attributec@r)zTeamSchema.Meta)�id�	is_activer*N)rrrrr�excluderrrrrrrcC�|r	tj|jd�SdS�N)r,)r�get_sid_from_id�partnership_idrrrrr%�zTeamSchema.get_partnership_idcCr/r0)rr1�partnership_account_idrrrrr$"r3z%TeamSchema.get_partnership_account_idN)rrrrr"r4r2�Nested�membersr�String�teamNamerr%r$rrrrr#s

r#c@seZdZGdd�d�ZdS)�AgentSchemac@r)zAgentSchema.Meta)r,�	extension�is_group�agentsN)rrrrrr.rrrrr'rrN)rrrrrrrrr9&sr9c@sneZdZe�d�Ze�d�Zejdd�Z	e�d�Z
e�d�ZGdd�d�Zd	d
�Z
dd�Zd
d�Zdd�ZdS)�AgentMiniSchemar�	get_teamsF)�dump_default�
get_avatar�get_user_idc@r)zAgentMiniSchema.Meta)
r
rrrrr�teams�isTeam�
userAvatar�userIdNrrrrrr4rrcCs|jr|jjSdS)N�rrrrrr8szAgentMiniSchema.get_agent_rolecCs|jrtdd��|j�SgSr&)rBr#�dumprrrrr>;szAgentMiniSchema.get_teamsc
CsXt�|j�}|r*z|j�d�\}}t||�WSty)}zWYd}~dSd}~wwdS)Nz::rF)r�	get_by_id�user_id�user_avatar�splitr	�	Exception)r r!r�bucket_name�key�errrr@>s
��zAgentMiniSchema.get_avatarcCst�|j�Sr)rr1rIrrrrrAHszAgentMiniSchema.get_user_idN)rrrrr"rrBr�BooleanrCrDrErrr>r@rArrrrr=,s




r=N)�marshmallowr�"buyercall.blueprints.agents.modelsrr�'buyercall.blueprints.partnership.modelsrr� buyercall.blueprints.user.modelsr�buyercall.extensionsr�buyercall.lib.util_boto3_s3r	�SQLAlchemyAutoSchemar
r#r9r=rrrr�<module>s