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/leads/__pycache__/rest_api.cpython-310.pyc
o

�we��@sfddlZddlmZmZmZddlmZmZddl	m
Z
ededd�Zej
dd	gd
�edd���ZdS)
�N)�	Blueprint�jsonify�
make_response)�rest_method�rest_partnership_account)�Lead�	leads_api�	templates)�template_folderz
/api/v1/calls�GET)�methodscCs�t�}tj�tj��tjtjk��	�}t
�d�t
|�tj��|D];}|�t|j|j|j|j|j|j|j|j|jr>|j��nd|jrG|j��nd|jpLd|jrS|jjnd|j|jd��q!tt|d��}d|j d<|S)z! External REST API endpoint.
    zFound {} leads for user {}N)�id�status�	firstname�lastname�email�phonenumber�question�duration�	starttime�endtime�
recording_url�agent�notes�
call_count)�callszno-cachez
Cache-Control)!�listr�query�	outerjoinr�filter�partnership_account_idrr
�all�log�debug�format�len�append�dictrrrrrrrr�	isoformatrr�	full_namerrrr�headers)�data�leads�lead�response�r/�E/home/arjun/projects/buyercall/buyercall/blueprints/leads/rest_api.py�
leads_jsons6
��
�
r1)�loggingr"�flaskrrr�buyercall.lib.util_restrr�!buyercall.blueprints.leads.modelsr�__name__r�router1r/r/r/r0�<module>s