
    =j              	          S r SSKJrJrJrJr  SSKJr  SSKJ	r	J
r
  SSKJr  SSKJrJrJr  \" 5       r\R%                  S\S9\R&                  " S	5      S
\" \	5      4S\S\S\4S jj5       5       r\R%                  S\S9\R&                  " S	5      S
\" \	5      4S\S\S\4S jj5       5       r\R%                  S\S9\R&                  " S	5      \" \	5      4S\S\S\4S jj5       5       rg)z"LSEG credit bond analytics router.    )	APIRouterDependsRequestHTTPException)limiter)get_registryrun_sync)ServiceRegistry)LsegBondOutLsegBondListOutLsegPortfolioSummaryOutz/bonds)response_modelz	30/minuteFrequestforce_refreshregistryc                    #    [        UR                  R                  U5      I S h  vN n[        U[	        U5      S9$  N7f)N)bondscount)r	   lseg_bond_serviceget_all_bondsr   len)r   r   r   r   s       4/root/lseg-credit/backend/app/routers/lseg_credit.py
list_bondsr      s9      855CC]SSEc%j99 Ts   $A >A z/portfolio/summaryc                 t   #    [        UR                  R                  U5      I S h  vN n[        S0 UD6$  N7f)N )r	   r   get_portfolio_summaryr   )r   r   r   summarys       r   portfolio_summaryr      s6      X77MM}]]G"-W-- ^s   $868z/bonds/{isin}isinc                    #    [        UR                  R                  U5      I S h  vN nUc  [        SSU S3S9e[	        S0 UD6$  N 7f)Ni  zBond 'z' not found)status_codedetailr   )r	   r   get_bondr   r   )r   r   r   bonds       r   r#   r#   "   sQ      (44==tDDD|fTF+4NOO Es   $A	A!A	N)__doc__fastapir   r   r   r   app.mainr   app.dependenciesr   r	   app.services.registryr
   app.models.schemasr   r   r   routergetlimitboolr   r   strr#   r       r   <module>r1      s/   ( > >  3 1 T T	 H_5{   ' 5::: :  6:  1HI{   ' 5... .  J. OK8{ !( 5
   9r0   