
    Ah_                         d dl mZ  eddg      Zej                  d      d        Zej                  d      d        Zej                  d	      d
        Zy)    )	APIRouterz/testTest)prefixtags/c                     K   ddiS w)NmessagezTest endpoint working r
       K/var/www/intrajisbackend.com/public_html/app/backend/routers/test_router.pytest_endpointr      s     .//s   z/kardex-simplec            	      .   K   ddddddddd	gd
dd
diS w)Nr	   TEST001zProducto de prueba 1g      $@g      Y@g      I@g     9@normal)codedescription	min_stock	max_stockbalancepmpstock_status   
   )datatotal_itemsitems_per_pagecurrent_pager
   r
   r   r   test_kardexr      sF      	 &#9!%!&# $,
  
 s   z/database-checkc                    K   ddl m}  ddlm}m}m}  |        5 }	 |j                  |      j                         }|j                  |      j                         }|j                  |      j                         }|j                  |      j                  d      j                         }d|||d|D 	cg c]<  }	|	j                  |	j                  |	j                  |	j                  |	j                  d> c}	dcd d d        S c c}	w # t        $ r!}
d	t!        |
      d
cY d }
~
cd d d        S d }
~
ww xY w# 1 sw Y   y xY ww)Nr   )SessionLocal)ProductModelMovementModelKardexValueModel   	connected)products	movementskardex_values)idnamer   stockbarcode)database_statustable_countssample_productserror)r-   r0   )app.backend.db.databaser    app.backend.db.modelsr!   r"   r#   querycountlimitall
product_idr*   r   r+   r,   	Exceptionstr)r    r!   r"   r#   sessionproduct_countmovement_countkardex_countr/   pes              r   check_databaser@   !   s*    4SS	 7	#MM,7==?M$]]=9??AN"==)9:@@BL &mmL9??BFFHO $/ -!/%1!  /$   ll !'(}}!"#$99$  $  	#*Q 7 4	5 s_   D>D2BD1AD 
2D6
D> D	D/D*D/D2 
D>*D//D22D;7D>N)fastapir   test_routergetr   postr   r@   r
   r   r   <module>rE      su    

 0 0 "# $( "#" $"r   