
    `|h                        d dl mZ d dlmZ d dlmZ d dlmZ d dlmZ d dl	Z	 e
d            e            Z e            Z e            Z G d d	e          Z G d
 de          Ze                    d          defd            ZdS )    )	APIRouter)API_BaseRequest)API_BaseResponse)EasySQL)EasyUserNzSEARCH USER COUNT API ENDPOINTc                   ,    e Zd ZU dZeed<   dZeed<   dS )API_Request account_typejob_locationN)__name__
__module____qualname__r   str__annotations__r        @C:\xampp\htdocs\dev\Site\Backend\api\users\search_users_count.pyr	   r	      s2         L#L#r   r	   c                       e Zd ZU dZeed<   dS )API_Responser   countN)r   r   r   r   intr   r   r   r   r   r      s         E3NNNNNr   r   z/users/search_users_countrequestc                    t                      }| j        }t                              |          }|dk    rd|_        d|_        d|_        |S t                                           t          	                                 t          
                    d          }g }|D ]}t          j        |d                   }|                    d          }|                    d          }	|                    d          }
d	}| j        d
k    r|| j        k    rd}| j        d
k    r	 |r|                    |           d	|_        d|_        d
|_        t#          |          |_        |S )NFi  zLogin Failureusers
attributesr   	post_codelocation_rangeTr
      )r   session_hashuserauthenticate_sessionsuccessstatus_codereasonsql_connectiondb_init
db_connectselectjsonloadsgetr   r   appendlenr   )r   api_responser    username	all_usersfiltered_usersaccount_userusers_attributes	user_typeuser_location
user_rangeuser_oks               r   search_users_countr9      ss     >>L'L((66H5$#& -  %%g..IN " 0 0:l<&@AA$((88	(,,[99%))*:;;
2%%G0002%% 	0!!,///L"LL^,,Lr   )fastapir   api.core.EasyMessager   r   api.core.EasySQLr   api.core.EasyUserr   r*   printrouterr&   r!   r	   r   postr9   r   r   r   <module>rA      s0  
       0 0 0 0 0 0 1 1 1 1 1 1 $ $ $ $ $ $ & & & & & &  & ' ' '	xzz    /       #    ())+ + + + *)+ + +r   