o
    B_i                     @  sr   d dl mZ d dlmZmZmZ ddlmZmZ ddl	m
Z
mZmZmZ dZdZdddZdddZdddZdS )    )annotations)AnyDictList   )ZoneOperation	ParamSpec   )requestraw_wrapcoerce_page_sizebuild_list_params	locations get_businessunits_with_locationsreturnList[ZoneOperation]c                   C  s`   t tdddddd dd ddtd	d
ddtddddtddddtddddgdddgdddgS )Nz Get BusinessUnits with LocationszFDevuelve businessunits (zone=businessunits) incluyendo join=locations.GETreadTr	   F)wherepagepageSizerawr   stringu   Cláusula WHERE estilo AroFlo.r   integeru   Número de página (1..N).r   u'   Tamaño de página (AroFlo 'pageSize').r   booleanz/Si true, devuelve respuesta cruda + meta debug.businessunitsz"Listar businessunits con locationsz#Auditar locations por business unitlow)codelabeldescriptionhttp_methodside_effect
idempotentdefault_paramsparamscategory	use_cases
risk_levelrequires_confirmation)r   OP_CODEr    r*   r*   Z/var/www/html/flask_server/apps/aroflo_connector_app/zones/businessunits/join_locations.pyget_operations   s.   r,   operation_codestrboolc                 C  s   | t kS )N)r)   )r-   r*   r*   r+   supports*   s   r0   clientr   r$   Dict[str, Any]c           	      C  s   | t krtd|  t|dd}|dd }t|dd}|dk r)tdt|}td|t||d	}t|d
|}|rCt	||S |S )Nu8   [BusinessUnits.join_locations] Operación no soportada: r   Fr   r   r	   zpage debe ser >= 1.r   )zoner   joinr   r   r   )
r)   
ValueErrorr/   getintr   r   	JOIN_NAMEr
   r   )	r-   r1   r$   r   r   r   r   params_listrespr*   r*   r+   execute.   s"   r;   N)r   r   )r-   r.   r   r/   )r-   r.   r1   r   r$   r2   r   r   )
__future__r   typingr   r   r   baser   r   _join_utilsr
   r   r   r   r8   r)   r,   r0   r;   r*   r*   r*   r+   <module>   s   

