Ë
    H(i&
  ã                   ó¾  — d dl mZ d dlmZmZ d dlmZ d dlmZ d dl	m
Z
 ddlmZmZmZmZ d dlmZmZ  e«       Zej)                  d	d
¬«       ee
«       ee«      fdee   dedefd„«       Zej-                  de¬«       ee
«       ee«      fdededefd„«       Zej-                  ded
¬«       ee
«       ee«      fdededefd„«       Zej-                  dee   d
¬«       ee
«       ee«      fdededefd„«       Zej9                  dd
¬«       ee
«       ee«      fdededefd„«       Zej=                  dd
¬«       ee
«       ee«      fdededefd„«       Zy)é    )ÚList)Ú	APIRouterÚDepends)ÚSession)Úservice)Úget_dbé   )ÚTotalConsumptionResponseÚcustomer_location_creatÚcustomerLocationResponseÚcustomerLocationUpdate)ÚJWTPayloadSchemaÚget_current_studentz/customer_locationT)Úresponse_model_exclude_noneÚrequestÚdbÚtokenc              ƒ   óh   K  — t        j                  ||«      j                  | «      ƒ d {  –—† S 7 Œ­w©N)r   ÚCustomer_locationÚcreate_customer_location©r   r   r   s      úG/var/www/html/retail-simulation-api/app/api/customer_location/router.pyÚcreate_customer_locatior      s*   è ø€ ä×*Ñ*¨2¨uÓ5×NÑNÈwÓW×WÐWÐWúó   ‚)2«0¬2z5/customer_location/group/{group_id}/total_consumption)Úresponse_modelÚgroup_idc              ƒ   óh   K  — t        j                  ||«      j                  | «      ƒ d {  –—† S 7 Œ­wr   )r   r   Úget_total_potential_by_group©r   r   r   s      r   Úget_total_consumption_by_groupr!      s+   è ø€ ä×*Ñ*¨2¨uÓ5×RÑRÐS[Ó\×\Ð\Ð\úr   z-/customer_location/get/{customer_location_id})r   r   Úcustomer_location_idc              ƒ   óh   K  — t        j                  ||«      j                  | «      ƒ d {  –—† S 7 Œ­wr   )r   r   Úget_customer_location©r"   r   r   s      r   Úget_simulationr&      s+   è ø€ ä×*Ñ*¨2¨uÓ5×KÑKÐL`Óa×aÐaÐaúr   z#/customer_location/group/{group_id}c              ƒ   óh   K  — t        j                  ||«      j                  | «      ƒ d {  –—† S 7 Œ­wr   )r   r   Úget_customer_locations_by_groupr    s      r   r(   r(      s+   è ø€ ä×*Ñ*¨2¨uÓ5×UÑUÐV^Ó_×_Ð_Ð_úr   z/customer_location/updatec              ƒ   óh   K  — t        j                  ||«      j                  | «      ƒ d {  –—† S 7 Œ­wr   )r   r   Úupdate_customer_locationr   s      r   Úupdate_segmentr+      s*   è ø€ ä×*Ñ*¨2¨eÓ4×MÑMÈgÓV×VÐVÐVúr   z0/customer_location/delete/{customer_location_id}c              ƒ   óh   K  — t        j                  ||«      j                  | «      ƒ d {  –—† S 7 Œ­wr   )r   r   Údelete_customer_locationr%   s      r   Údelete_catchmentr.      s+   è ø€ ä×*Ñ*¨2¨uÓ5×NÑNÐOcÓd×dÐdÐdúr   N) Útypingr   Úfastapir   r   Úsqlalchemy.ormr   Úapp.api.customer_locationr   Úapp.database.main.mysqlr   Úschemasr
   r   r   r   Úapp.dependency.authanticationr   r   Úcustomer_location_routerÚpostr   ÚgetÚintr!   r&   Úlistr(   Úputr+   Údeleter.   © ó    r   ú<module>r?      sg  ðÝ ß %Ý "Ý -Ý *ß wÓ wß Oá$›;Ð à×ÑÐ3ÐQUÐÓVÙW^Ð_eÓWfñ  BIð  J]ó  B^ñ X¨4Ð0GÑ+Hð XÈWð XÐn~ò Xó WðXð ×ÑÐUÐe}ÐÓ~ÙELÈVÃ_Ñovð  xKó  pLñ ]°3ð ]¸7ð ]Ð\lò ]ó ð]ð ×ÑÐMÐ^vð  UYÐó  ZÙBIÈ&Ã/Ñmtð  vIó  nJñ b¨sð b¸ð bÐZjò bó Zðbð ×ÑÐCÐSWÐXpÑSqð  OSÐó  TÙFMÈfÃoÑpwð  yLó  qMñ `°Cð `¸Gð `Ð]mò `ó Tð`ð ×ÑÐ9ÐW[ÐÓ\ÙHOÐPVËÑryð  {Nó  sOñ WÐ!7ð W¸gð WÐ_oò Wó ]ðWð × Ñ Ð!SÐptÐ ÓuÙCJÈ6Ã?Ñmtð  vIó  nJñ e°ð e¸ð eÐZjò eó vñer>   