
    Ci                         U d Z ddlmZmZ ddlmZ ddlZdZe	e
d<   dZee	df   e
d<   dZee	ee	   df   e
d	<   dZee	ee	   df   e
d
<   ddZddZy)zdsmart inv

Revision ID: 057861985319
Revises: 7268a22148b7
Create Date: 2025-12-18 10:48:01.158290

    )SequenceUnion)opN057861985319revision7268a22148b7down_revisionbranch_labels
depends_onc                  ֬   t        j                  dt        j                  dt        j                         dd      t        j                  dt        j                         d      t        j                  dt        j
                  d	
      d      t        j                  dt        j                  d      t        j                  d      d      t        j                  dt        j                  d      t        j                  d      d      t        j                  d             t        j                  t        j                  d      ddgd       t        j                  t        j                  d      ddgd       t        j                  dt        j                  dt        j                         dd      t        j                  dt        j                         d      t        j                  dt        j                         d      t        j                  dt        j
                  d	
      d      t        j                  dt        j                  d      t        j                  d      d      t        j                  dt        j                  d      t        j                  d      d      t        j                  dgdg      t        j                  d      t        j                  d      
       t        j                  t        j                  d      ddgd       t        j                  t        j                  d      ddgd       t        j                  dt        j                  dt        j                         dd      t        j                  dt        j                         d      t        j                  dt        j                         d      t        j                  dt        j
                  d	
      d      t        j                  dt        j
                  d
      d      t        j                  dt        j
                  d
      d      t        j                  d t        j                         d      t        j                  d!t        j                         d      t        j                  dt        j                  d      t        j                  d      d      t        j                  dt        j                  d      t        j                  d      d      t        j                  dgdg      t        j                  d             t        j                  t        j                  d"      ddgd       t        j                  t        j                  d#      ddgd       t        j                  t        j                  d$      ddgd       t        j                  d%t        j                  dt        j                         dd      t        j                  dt        j                         d      t        j                  d&t        j                         d      t        j                  d't        j
                  d	
      d      t        j                  dt        j                  d      t        j                  d      d      t        j                  dt        j                  d      t        j                  d      d      t        j                  dgdg      t        j                  d      	       t        j                  t        j                  d(      d%dgd       t        j                  t        j                  d)      d%dgd       t        j                  d*t        j                  dt        j                         dd      t        j                  dt        j                         d      t        j                  d+t        j                         d      t        j                  d,t        j
                  d	
      d      t        j                  d-t        j
                  d	
      d      t        j                  d.t        j                         d      t        j                  dt        j                  d      t        j                  d      d      t        j                  dt        j                  d      t        j                  d      d      t        j                  dgdg      t        j                  d             t        j                  t        j                  d/      d*dgd       t        j                  t        j                  d0      d*dgd       t        j                  t        j                  d1      d*d+gd       t        j                  d2t        j                  dt        j                         dd      t        j                  dt        j                         d      t        j                  d3t        j                         d      t        j                  d4t        j
                  d	
      d      t        j                  d5t        j
                  d
      d      t        j                  dt        j                  d      t        j                  d      d      t        j                  dt        j                  d      t        j                  d      d      t        j                  dgdg      t        j                  d      
       t        j                  t        j                  d6      d2dgd       t        j                  t        j                  d7      d2dgd       t        j                  d8t        j                  dt        j                         dd      t        j                  dt        j                         d      t        j                  d9t        j                         d      t        j                  d:t        j                         d      t        j                  d;t        j                         d      t        j                  d<t        j
                  d=
      d      t        j                  d>t        j
                  d	
      d      t        j                  d?t        j                         d      t        j                  d@t        j
                  d	
      d      t        j                  d,t        j
                  d	
      d      t        j                  dAt        j                          d      t        j                  dBt        j                          d      t        j                  dCt        j                          d      t        j                  dDt        j                          d      t        j                  dEt        j
                  dF
      d      t        j                  dt        j                  d      t        j                  d      d      t        j                  dt        j                  d      t        j                  d      d      t        j                  dgdg      t        j                  d9gdGg      t        j                  d:gdHg      t        j                  d             t        j                  t        j                  dI      d8dgd       t        j                  t        j                  dJ      d8dgd       t        j                  dKt        j                  dt        j                         dd      t        j                  dt        j                         d      t        j                  dLt        j                         d      t        j                  d&t        j                         d      t        j                  dMt        j"                  dNdOdPdQdRdSdTU      d      t        j                  dVt        j                  d      d      t        j                  dWt        j                         d      t        j                  dXt        j                  d      d      t        j                  dYt        j
                  d
      d      t        j                  dZt        j
                  d
      d      t        j                  d[t        j                  d      d      t        j                  dt        j                  d      t        j                  d      d      t        j                  dt        j                  d      t        j                  d      d      t        j                  dgdg      t        j                  d&gd\g      t        j                  d             t        j                  t        j                  d]      dKdgd       t        j                  t        j                  d^      dKdgd       t        j                  t        j                  d_      dKd&gd       t        j                  t        j                  d`      dKdLgd       t        j                  dat        j                  dt        j                         dd      t        j                  dt        j                         d      t        j                  d&t        j                         d      t        j                  dbt        j                  d      d      t        j                  dct        j
                  d
      d      t        j                  dWt        j                         d      t        j                  dXt        j                  d      d      t        j                  dYt        j
                  d
      d      t        j                  dZt        j
                  d
      d      t        j                  d[t        j                  d      d      t        j                  dt        j                  d      t        j                  d      d      t        j                  dt        j                  d      t        j                  d      d      t        j                  dgdg      t        j                  d&gd\g      t        j                  d             t        j                  t        j                  dd      dadgd       t        j                  t        j                  de      dadgd       t        j                  t        j                  df      dad&gd       t        j                  dgt        j                  dt        j                         dd      t        j                  dt        j                         d      t        j                  d;t        j                         d      t        j                  d&t        j                         d      t        j                  dht        j                  d      d      t        j                  dit        j                         d      t        j                  djt        j                         d      t        j                  dt        j                  d      t        j                  d      d      t        j                  dt        j                  d      t        j                  d      d      t        j                  dgdg      t        j                  d&gd\g      t        j                  d;gdkg      t        j                  d             t        j                  t        j                  dl      dgdgd       t        j                  t        j                  dm      dgdgd       t        j                  t        j                  dn      dgd&gd       t        j                  t        j                  do      dgd;gd       t        j                  t        j                  dp      dgdhgd       t        j                  dqt        j                  dt        j                         d      t        j                  dt        j                         d      t        j                  d&t        j                         d      t        j                  d;t        j                         d      t        j                  drt        j$                         d      t        j                  dst        j$                         d      t        j                  dtt        j                         d      t        j                  dut        j
                         d      t        j                  dt        j                  d      t        j                  d      d      t        j                  dgdg      t        j                  d&gd\g      t        j                  d;gdkg      t        j                  d             t        j                  t        j                  dv      dqdgd       t        j                  t        j                  dw      dqdgd       t        j                  t        j                  dx      dqd&gd       t        j                  t        j                  dy      dqd;gd       t        j                  dzt        j                  dt        j                         dd      t        j                  dt        j                         d      t        j                  d;t        j                         d      t        j                  d&t        j                         d      t        j                  d{t        j
                  d
      d      t        j                  d|t        j                         d      t        j                  d}t        j                  d      d      t        j                  d~t        j                  d      d      t        j                  dMt        j"                  ddddddU      d      t        j                  dt        j                  d      t        j                  d      d      t        j                  dt        j                  d      t        j                  d      d      t        j                  dgdg      t        j                  d&gd\g      t        j                  d;gdkg      t        j                  d             t        j                  t        j                  d      dzd{gd       t        j                  t        j                  d      dzdgd       t        j                  t        j                  d      dzdgd       t        j                  t        j                  d      dzd&gd       t        j                  t        j                  d      dzd;gd       t        j                  g dt        j                  dt        j                         d      t        j                  dt        j$                         d      t        j                  dt        j                         d      t        j                  d&t        j                         d      t        j                  d;t        j                         d      t        j                  dt        j                         d      t        j                  dt        j                         d      t        j                  dt        j                         d      t        j                  dt        j                         d      t        j                  dt        j                         d      t        j                  dt        j                         d      t        j                  dt        j                         d      t        j                  dt        j                         d      t        j                  dt        j                         d      t        j                  dt        j                         d      t        j                  dt        j                         d      t        j                  dt        j                         d      t        j                  dt        j                         d      t        j                  dt        j                         d      t        j                  dt        j                         d      t        j                  dt        j
                  d
      d      t        j                  dt        j                         d      t        j                  dt        j                          d      t        j                  dt        j                         d      t        j                  dt        j                         d      t        j                  dt        j                          d      t        j                  dt        j                         d      t        j                  dgdg      t        j                  d&gd\g      t        j                  d;gdkg      t        j                  d      t        j                  ddd&d;dU        t        j                  t        j                  d      ddgd       t        j                  t        j                  d      ddgd       t        j                  t        j                  d      dd&gd       t        j                  t        j                  d      dd;gd       t        j                  t        j                  d      ddgd       t        j                  dt        j                  dt        j                         d      t        j                  dt        j$                         d      t        j                  dt        j                         d      t        j                  d&t        j                         d      t        j                  d;t        j                         d      t        j                  dt        j                         d      t        j                  dt        j                         d      t        j                  dt        j                         d      t        j                  dt        j                  d      t        j                  d      d      t        j                  dgdg      t        j                  d&gd\g      t        j                  d;gdkg      t        j                  d             t        j                  t        j                  d      ddgd       t        j                  t        j                  d      ddgd       t        j                  t        j                  d      dd&gd       t        j                  t        j                  d      dd;gd       t        j                  t        j                  d      ddgd       t        j                  ddg dd       t        j                  dt        j                  dt        j                         dd      t        j                  dt        j                         d      t        j                  d;t        j                         d      t        j                  d&t        j                         d      t        j                  dt        j                  d      t        j                  d      d      t        j                  dgdg      t        j                  d&gd\g      t        j                  d;gdkg      t        j                  d      
       t        j                  t        j                  d      ddgd       t        j                  t        j                  d      ddgd       t        j                  dt        j                  dt        j                         dd      t        j                  dt        j                         d      t        j                  dt        j                         d      t        j                  d;t        j                         d      t        j                  d&t        j                         d      t        j                  dt        j                         d      t        j                  dt        j                         d      t        j                  dt        j                         d      t        j                  dt        j                         d      t        j                  dt        j                         d      t        j                  dt        j
                  d
      d      t        j                  dt        j
                  d
      d      t        j                  dt        j                  d      t        j                  d      d      t        j                  dt        j                  d      t        j                  d      d      t        j                  dgdg      t        j                  d&gd\g      t        j                  d;gdkg      t        j                  d             t        j                  t        j                  d      ddgd       t        j                  t        j                  d      ddgd       t        j                  t        j                  d      dd&gd       t        j                  t        j                  d      dd;gd       t        j                  dt        j                  dt        j                         dd      t        j                  dt        j                         d      t        j                  d;t        j                         d      t        j                  d3t        j                         d      t        j                  dt        j                  d      t        j                  d      d      t        j                  dgdg      t        j                  d;gdkg      t        j                  d3gdg      t        j                  d      
       t        j                  t        j                  dī      ddgd       t        j                  t        j                  dū      ddgd       t        j                  dt        j                  dt        j                         dd      t        j                  dt        j                         d      t        j                  dt        j                         d      t        j                  d;t        j                         d      t        j                  dt        j                         d      t        j                  dt        j                         d      t        j                  dt        j                         d      t        j                  dt        j                  d      t        j                  d      d      t        j                  dt        j                  d      t        j                  d      d      t        j                  dgdg      t        j                  d;gdkg      t        j                  dgdg      t        j                  d             t        j                  t        j                  d̫      ddgd       t        j                  t        j                  dͫ      ddgd       t        j                  t        j                  dΫ      dd;gd       t        j                  dt        j                  dt        j                         dd      t        j                  dt        j                         d      t        j                  dLt        j                         d      t        j                  d&t        j                         d      t        j                  dMt        j"                  dNdOdPdQdRdSdTU      d      t        j                  dVt        j                  d      d      t        j                  dWt        j                         d      t        j                  dt        j                         d      t        j                  dXt        j                  d      d      t        j                  dYt        j
                  d
      d      t        j                  dZt        j
                  d
      d      t        j                  d[t        j                  d      d      t        j                  dt        j                  d      t        j                  d      d      t        j                  dt        j                  d      t        j                  d      d      t        j                  dgdg      t        j                  d&gd\g      t        j                  dgdg      t        j                  d             t        j                  t        j                  dЫ      ddgd       t        j                  t        j                  dѫ      ddgd       t        j                  t        j                  dҫ      dd&gd       t        j                  t        j                  dӫ      ddLgd       t        j                  dt        j                  dt        j                         d      t        j                  dt        j                         d      t        j                  d&t        j                         d      t        j                  d;t        j                         d      t        j                  dt        j                         d      t        j                  dt        j                         d      t        j                  dt        j                         d      t        j                  dt        j                         d      t        j                  dLt        j                         d      t        j                  dt        j                  d      t        j                  d      d      t        j                  dt        j                  d      t        j                  d      d      t        j                  dgdg      t        j                  d&gd\g      t        j                  d;gdkg      t        j                  d      t        j                  dd&d;d֬U             t        j                  t        j                  d׫      ddgd       t        j                  t        j                  dث      ddgd       t        j                  t        j                  d٫      dd&gd       t        j                  t        j                  dګ      dd;gd       t        j                  dt        j                  dt        j                         dd      t        j                  dt        j                         d      t        j                  dt        j                         d      t        j                  d;t        j                         d      t        j                  dt        j                         d      t        j                  dt        j                         d      t        j                  dt        j                         d      t        j                  dt        j                  d      t        j                  d      d      t        j                  dt        j                  d      t        j                  d      d      t        j                  dgdg      t        j                  d;gdkg      t        j                  dgdg      t        j                  dgdg      t        j                  d             t        j                  t        j                  d      ddgd       t        j                  t        j                  d      ddgd       t        j                  t        j                  d      dd;gd       t        j                  dt        j                  dt        j                         dd      t        j                  dt        j                         d      t        j                  d&t        j                         d      t        j                  dt        j                         d      t        j                  dbt        j                  d      d      t        j                  dct        j
                  d
      d      t        j                  dWt        j                         d      t        j                  dXt        j                  d      d      t        j                  dYt        j
                  d
      d      t        j                  dZt        j
                  d
      d      t        j                  d[t        j                  d      d      t        j                  dt        j                  d      t        j                  d      d      t        j                  dt        j                  d      t        j                  d      d      t        j                  dgdg      t        j                  d&gd\g      t        j                  dgdg      t        j                  d             t        j                  t        j                  d      ddgd       t        j                  t        j                  d      ddgd       t        j                  t        j                  d      dd&gd       t        j                  dt        j                  dt        j                         d      t        j                  dt        j$                         d      t        j                  dt        j                         d      t        j                  d&t        j                         d      t        j                  d;t        j                         d      t        j                  dt        j                         d      t        j                  dt        j                         d      t        j                  dt        j                         d      t        j                  dt        j                         d      t        j                  dt        j                  d      t        j                  d      d      t        j                  dgdg      t        j                  d&gd\g      t        j                  d;gdkg      t        j                  d             t        j                  t        j                  d      ddgd       t        j                  t        j                  d      ddgd       t        j                  t        j                  d      ddgd       t        j                  t        j                  d      dd&gd       t        j                  t        j                  d      dd;gd       t        j                  ddg dd       t        j                  dt        j                  dt        j                         d      t        j                  dt        j$                         d      t        j                  dt        j                         d      t        j                  d&t        j                         d      t        j                  d;t        j                         d      t        j                  dt        j                         d      t        j                  dt        j                         d      t        j                  dt        j                         d      t        j                  dt        j                         d      t        j                  dt        j                         d      t        j                  dt        j                         d      t        j                  dt        j                         d      t        j                  dt        j                         d      t        j                  dt        j                         d      t        j                  dt        j                          d      t        j                  d t        j
                  d
      d      t        j                  dt        j
                  d	
      d      t        j                  dt        j                  d      t        j                  d      d      t        j                  dgdg      t        j                  d&gd\g      t        j                  d;gdkg      t        j                  d             t        j                  t        j                  d      ddgd       t        j                  t        j                  d      ddgd       t        j                  t        j                  d      dd&gd       t        j                  t        j                  d      dd;gd       t        j                  t        j                  d      ddgd       t        j                  ddg dd       t        j                  dt        j                  dt        j                         d      t        j                  dt        j                         d      t        j                  d&t        j                         d      t        j                  d;t        j                         d      t        j                  dt        j$                         d      t        j                  dt        j                         d      t        j                  d	t        j
                  d	
      d      t        j                  dt        j                  d      t        j                  d      d      t        j                  dgdg      t        j                  d&gd\g      t        j                  d;gdkg      t        j                  d             t        j                  d
dg dd       t        j                  t        j                  d      ddgd       t        j                  t        j                  d      ddgd       t        j                  t        j                  d      ddgd       t        j                  t        j                  d      dd&gd       t        j                  t        j                  d      dd;gd       t        j                  dt        j                  dt        j                         dd      t        j                  dt        j                         d      t        j                  d;t        j                         d      t        j                  d&t        j                         d      t        j                  dt        j                         d      t        j                  dt        j"                  ddddddddU      d      t        j                  dt        j                         d      t        j                  dt        j
                  d
      d      t        j                  dt        j                  d      t        j                  d      d      t        j                  dgdg      t        j                  dgdg      t        j                  d&gd\g      t        j                  d;gdkg      t        j                  d             t        j                  t        j                  d      ddgd       t        j                  t        j                  d       ddgd       t        j                  t        j                  d!      dd&gd       t        j                  t        j                  d"      dd;gd       t        j                  d#t        j                  dt        j                         dd      t        j                  dt        j                         d      t        j                  d$t        j                         d      t        j                  d;t        j                         d      t        j                  dt        j                         d      t        j                  dt        j                         d      t        j                  dt        j                         d      t        j                  dt        j                  d      t        j                  d      d      t        j                  dt        j                  d      t        j                  d      d      t        j                  dgdg      t        j                  d;gdkg      t        j                  d$gd%g      t        j                  d             t        j                  t        j                  d&      d#dgd       t        j                  t        j                  d'      d#dgd       t        j                  t        j                  d(      d#d;gd       t        j                  d)t        j                  dt        j                         dd      t        j                  dt        j                         d      t        j                  dLt        j                         d      t        j                  d&t        j                         d      t        j                  dMt        j"                  dNdOdPdQdRdSdTU      d      t        j                  dVt        j                  d      d      t        j                  dWt        j                         d      t        j                  d*t        j                         d      t        j                  dXt        j                  d      d      t        j                  dYt        j
                  d
      d      t        j                  dZt        j
                  d
      d      t        j                  d[t        j                  d      d      t        j                  dt        j                  d      t        j                  d      d      t        j                  dt        j                  d      t        j                  d      d      t        j                  dgdg      t        j                  d&gd\g      t        j                  d*gd%g      t        j                  d             t        j                  t        j                  d+      d)dgd       t        j                  t        j                  d,      d)dgd       t        j                  t        j                  d-      d)d&gd       t        j                  t        j                  d.      d)dLgd       t        j                  d/t        j                  dt        j                         dd      t        j                  dt        j                         d      t        j                  d0t        j                         d      t        j                  d;t        j                         d      t        j                  dt        j                         d      t        j                  dt        j                         d      t        j                  dt        j                  d      t        j                  d      d      t        j                  dt        j                  d      t        j                  d      d      t        j                  dgdg      t        j                  d;gdkg      t        j                  d0gd1g      t        j                  d             t        j                  t        j                  d2      d/dgd       t        j                  t        j                  d3      d/dgd       t        j                  t        j                  d4      d/d;gd       t        j                  d5t        j                  dt        j                         dd      t        j                  dt        j                         d      t        j                  d6t        j                         d      t        j                  d;t        j                         d      t        j                  dt        j                         d      t        j                  dt        j                         d      t        j                  dt        j                         d      t        j                  dt        j                  d      t        j                  d      d      t        j                  dt        j                  d      t        j                  d      d      t        j                  dgdg      t        j                  d;gdkg      t        j                  d6gd7g      t        j                  d             t        j                  t        j                  d8      d5dgd       t        j                  t        j                  d9      d5dgd       t        j                  t        j                  d:      d5d;gd       y (;  N	companiesidTF)autoincrementnullable
company_id)r   company_name   )length
created_at)timezoneznow())server_defaultr   
updated_atix_companies_company_id)uniqueix_companies_id
categoriescategory_idcategory_namezcompanies.idix_categories_company_idix_categories_id	discountsdiscount_iddiscount_namediscount_coded   discount_type2   valuediscount_rulesix_discounts_company_idix_discounts_discount_idix_discounts_id	locationslocation_idlocation_nameix_locations_company_idix_locations_idproduct_varients
varient_idskuvarient_nameattribute_detailsix_product_varients_company_idix_product_varients_idix_product_varients_varient_idvendors	vendor_idvendor_namevendor_codeix_vendors_company_idix_vendors_idproductsfk_product_category_idproduct_variant_id
product_idproduct_namei  
short_namedescription
brand_nameeligible_for_returndisplay_on_posdisplay_on_online_storeis_perishable
image_pathi  zcategories.idzproduct_varients.idix_products_company_idix_products_idpurchase_orderssupplier_idstatusDRAFTPENDING_APPROVALSENTRECEIVEDRETURNEDCLOSEDpurchaseorderstatus)nameexpected_delivery_dateref_id
order_date
ref_numberlinked_ref_numberlinked_ref_datetimezlocations.idix_purchase_orders_company_idix_purchase_orders_idix_purchase_orders_location_idix_purchase_orders_supplier_idsales_orderssold_atchannelix_sales_orders_company_idix_sales_orders_idix_sales_orders_location_iddaily_sales	sale_datequantity_soldtotal_amountzproducts.idix_daily_sales_company_idix_daily_sales_idix_daily_sales_location_idix_daily_sales_product_idix_daily_sales_sale_datedemand_forecastsforecast_datetarget_dateforecast_qtymodel_versionix_demand_forecasts_company_idix_demand_forecasts_idix_demand_forecasts_location_idix_demand_forecasts_product_idinventory_batches	batch_refquantity_on_handexpiry_datereceived_dateACTIVESOLD_OUTEXPIREDDISPOSEDDONATEDinventorybatchstatusix_inventory_batches_batch_refix_inventory_batches_company_idix_inventory_batches_id ix_inventory_batches_location_idix_inventory_batches_product_idinventory_planning_snapshotsnapshot_dateavg_daily_demandsigma_daily_demandlead_time_daysreview_period_daysservice_level_targetcurrent_safety_stockcurrent_reorder_pointforecast_avg_daily_demand_90dforecast_safety_stock_90dforecasted_reorder_point_90don_hand_qtyinbound_qtyavailable_stock
min_target
max_targetstock_status   recommended_order_qtyshould_reorderdays_of_coverdays_until_stockout	is_urgenturgency_score$uq_planning_snapshot_per_day_sku_loc)ix_inventory_planning_snapshot_company_id!ix_inventory_planning_snapshot_id*ix_inventory_planning_snapshot_location_id)ix_inventory_planning_snapshot_product_id,ix_inventory_planning_snapshot_snapshot_dateinventory_snapshot_dailyoutbound_qty&ix_inventory_snapshot_daily_company_idix_inventory_snapshot_daily_id'ix_inventory_snapshot_daily_location_id&ix_inventory_snapshot_daily_product_id)ix_inventory_snapshot_daily_snapshot_date!ix_snapshot_company_loc_prod_date)r   r   r.   rC   product_locationsix_product_locations_company_idix_product_locations_idproduct_pricesproduct_price_idcost_price_per_unitmarkup_valuemargin_valueretail_price_excl_taxcompare_at_pricemarkup_type_namemargin_type_nameix_product_prices_company_idix_product_prices_idix_product_prices_location_idix_product_prices_product_idproduct_vendorsz
vendors.idix_product_vendors_company_idix_product_vendors_idpurchase_order_linespurchase_order_idordered_qtyreceived_qty	unit_costzpurchase_orders.id"ix_purchase_order_lines_company_idix_purchase_order_lines_id"ix_purchase_order_lines_product_idpurchase_order_receive$ix_purchase_order_receive_company_idix_purchase_order_receive_id%ix_purchase_order_receive_location_id%ix_purchase_order_receive_supplier_idreorder_policiesmin_order_qty"uq_reorder_policy_company_loc_prodix_reorder_policies_company_idix_reorder_policies_idix_reorder_policies_location_idix_reorder_policies_product_idsales_order_linessales_order_idquantity
unit_pricepromotion_idzdiscounts.idzsales_orders.idix_sales_order_lines_company_idix_sales_order_lines_idix_sales_order_lines_product_idsales_return_orders!ix_sales_return_orders_company_idix_sales_return_orders_id"ix_sales_return_orders_location_idservice_level_dailydate
demand_qtyfulfilled_qtylost_sales_qtyservice_level!ix_service_level_daily_company_idix_service_level_daily_dateix_service_level_daily_id"ix_service_level_daily_location_id!ix_service_level_daily_product_id#ix_servicelvl_company_loc_prod_date)r   r   r.   rC   slow_mover_snapshottotal_sold_7dtotal_sold_30dtotal_sold_90dads_7dads_30dads_90ddoh_90ddays_since_last_saleis_slow_moverslow_mover_severityslow_mover_reason!ix_slow_mover_snapshot_company_idix_slow_mover_snapshot_id"ix_slow_mover_snapshot_location_id!ix_slow_mover_snapshot_product_id$ix_slow_mover_snapshot_snapshot_date"uq_slow_mover_snapshot_day_sku_locstockout_eventsreason!ix_stockout_company_loc_prod_date)r   r.   rC   r   ix_stockout_events_company_idix_stockout_events_dateix_stockout_events_idix_stockout_events_location_idix_stockout_events_product_idinventory_movementsbatch_idmovement_typeSALERECEIPTSALE_RETURNPURCHASE_RETURN
ADJUSTMENTTRANSFER_INTRANSFER_OUTmovementtypequantity_delta	referencezinventory_batches.id!ix_inventory_movements_company_idix_inventory_movements_id"ix_inventory_movements_location_id!ix_inventory_movements_product_idpurchase_order_receive_linespurchase_order_receive_idzpurchase_order_receive.id*ix_purchase_order_receive_lines_company_id"ix_purchase_order_receive_lines_id*ix_purchase_order_receive_lines_product_idpurchase_order_returnpurchase_receive_order_id#ix_purchase_order_return_company_idix_purchase_order_return_id$ix_purchase_order_return_location_id$ix_purchase_order_return_supplier_idsales_return_order_linessales_return_order_idzsales_return_orders.id&ix_sales_return_order_lines_company_idix_sales_return_order_lines_id&ix_sales_return_order_lines_product_idpurchase_order_return_linespurchase_order_return_idzpurchase_order_return.id)ix_purchase_order_return_lines_company_id!ix_purchase_order_return_lines_id)ix_purchase_order_return_lines_product_id)r   create_tablesaColumnIntegerStringDateTimetextPrimaryKeyConstraintcreate_indexfForeignKeyConstraintUniqueConstraintFloatJSONTextBooleanEnumDate     F/var/www/html/hubwallet-dev/alembic/versions/057861985319_smart_inv.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?]On-=@D!!$ OOBDD89;L|nejkOOBDD013DtfUZ[OOBDD9:<MP]glmOOBDD9:<MP]glmOONIIdBJJLuEIIlBJJL59IImRZZ\E:IIid3eDIIi"->IIh

t4IIlBKK6GIIlBIIS1DAII!299C#84HII#R[[$%?$OIIlBKK6rwwwGWbfgIIlBKK6rwwwGWbfg\N^,<?]On-=@D!" OOBDD56_deOOBDD-.uUOOBDD67-afgOOMIIdBJJLuEIIlBJJL59IIlBJJL59IImRZZ\E:IIk2;;5FIIorzz|e<IInbhhj59IIlBKK6rwwwGWbfgIIlBKK6rwwwGWbfg\N^,<?]On-=@\N]O>D! OOBDD45}|n]bcOOBDD,-}tfUSOOBDD56_deOOBDD45}|n]bcOOBDD34mk][`aOO&IIdBJJL51IIlBJJL59IImRZZ\E:IIlBJJL59IIorwwy59IImRWWY7IInbhhj59IIoryy{T:IIlBKK6rwwwGWbfg\N^,<?]On-=@\N]O>D! OOBDD9:<NQ]P^glmOOBDD124FW\]OOBDD:;=OR_Q`inoOOBDD9:<NQ]P^glmOO'IIdBJJLuEIIlBJJL59IIlBJJL59IImRZZ\E:IIk299C05AII "**,?IImR[[$7$GIIor{{D9EJIIh*iY]st  @E  FIIlBKK6rwwwGWbfgIIlBKK6rwwwGWbfg\N^,<?]On-=@\N]O>D!" OOBDD9:<OR]Q^gklOOBDD:;=PS_R`inoOOBDD235H4&Y^_OOBDD;<>QTaSbkpqOOBDD:;=PS_R`inoOO !1 !IIdBJJL51!IIorwwy59! IIlBJJL59! IImRZZ\E:	!
 IIlBJJL59! II "((*u=! II"BHHJ?! II

u=! II"BJJL5A! II$bhhj5A! II$bhhj5A! II%rxxzEB! II-rxxzEJ! II)288:F! II,bhhj5I!  IImRXXZ%8!!" IImRXXZ%8#!$ IIe<%!& IIlBHHJ7'!( IIlBHHJ7)!* IInbiir2TB+!, II%rxxzEB-!. II

u=/!0 IIorxxzD91!2 II#RXXZ$?3!4 IIk2::<%85!6 IIorxxzE:7!8 \N^,<?9!: ]On-=@;!< \N]O>=!> D!?!@ }lY  AA!D OOBDDDEGdgsft  ~C  DOOBDD<=?\_c^dmrsOOBDDEFHehugv  @E  FOOBDDDEGdgsft  ~C  DOOBDDGHJgjyiz  DI  JOO.IIdBJJL51IIorwwy59IIlBJJL59IImRZZ\E:IIlBJJL59IImRXXZ%8IImRXXZ%8IInbhhj59IIlBKK6rwwwGWbfg\N^,<?]On-=@\N]O>D! OOBDDABD^am`nw|}OOBDD9:<VY]X^glmOOBDDBCE_boapy~OOBDDABD^am`nw|}OOBDDDEGadsct  ~C  DOO79S  VR  [_  `OO'IIdBJJLuEIIlBJJL59IIlBJJL59IImRZZ\E:IIlBKK6rwwwGWbfg\N^,<?]On-=@\N]O>D!
 OOBDD:;=PS_R`inoOOBDD235H4&Y^_OO$IIdBJJLuEIIlBJJL59II "**,>IIlBJJL59IImRZZ\E:II#RXXZ$?IInbhhj48IInbhhj48II%rxxzDAII "((*t<II "))2"6FII "))2"6FIIlBKK6rwwwGWbfgIIlBKK6rwwwGWbfg\N^,<?]On-=@\N]O>D!%( OOBDD78:J\NchiOOBDD/02BTFSXYOOBDD89;Km_ejkOOBDD78:J\NchiOO%IIdBJJLuEIIlBJJL59IIlBJJL59IIk2::<%8IIlBKK6rwwwGWbfg\N^,<?\N]O>[ML><D!
 OOBDD89;L|nejkOOBDD013DtfUZ[OO*IIdBJJLuEIIlBJJL59II!2::<%@IIlBJJL59IImRZZ\E:IInbjjlU;IIk288:6IIlBKK6rwwwGWbfgIIlBKK6rwwwGWbfg\N^,<?\N]O>014H3ILD! OOBDD=>@VYeXfotuOOBDD568NQUPV_deOOBDD=>@VYeXfotuOO,IIdBJJLuEIIlBJJL59IImRZZ\E:IImRZZ\E:IIh);VZQ[]e  mB  C  NS  TII&T(BTRIIh

t4II!2::<$?IIlBKK6GIIlBIIS1DAII!299C#84HII#R[[$%?$OIIlBKK6rwwwGWbfgIIlBKK6rwwwGWbfg\N^,<?]On-=@014H3ILD!%( OOBDD?@BZ]i\j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~C  DrE  c                  '   t        j                  t        j                  d      d       t        j                  t        j                  d      d       t        j                  t        j                  d      d       t        j                  d       t        j                  t        j                  d      d       t        j                  t        j                  d      d       t        j                  t        j                  d	      d       t        j                  d       t        j                  t        j                  d
      d       t        j                  t        j                  d      d       t        j                  t        j                  d      d       t        j                  t        j                  d      d       t        j                  d       t        j                  t        j                  d      d       t        j                  t        j                  d      d       t        j                  t        j                  d      d       t        j                  d       t        j                  t        j                  d      d       t        j                  t        j                  d      d       t        j                  t        j                  d      d       t        j                  t        j                  d      d       t        j                  d       t        j                  t        j                  d      d       t        j                  t        j                  d      d       t        j                  t        j                  d      d       t        j                  t        j                  d      d       t        j                  t        j                  d      d       t        j                  dd       t        j                  d       t        j                  dd        t        j                  t        j                  d!      d        t        j                  t        j                  d"      d        t        j                  t        j                  d#      d        t        j                  t        j                  d$      d        t        j                  t        j                  d%      d        t        j                  d        t        j                  d&d'       t        j                  t        j                  d(      d'       t        j                  t        j                  d)      d'       t        j                  t        j                  d*      d'       t        j                  t        j                  d+      d'       t        j                  t        j                  d,      d'       t        j                  d'       t        j                  t        j                  d-      d.       t        j                  t        j                  d/      d.       t        j                  t        j                  d0      d.       t        j                  d.       t        j                  t        j                  d1      d2       t        j                  t        j                  d3      d2       t        j                  t        j                  d4      d2       t        j                  d2       t        j                  t        j                  d5      d6       t        j                  t        j                  d7      d6       t        j                  t        j                  d8      d6       t        j                  t        j                  d9      d6       t        j                  d6       t        j                  t        j                  d:      d;       t        j                  t        j                  d<      d;       t        j                  t        j                  d=      d;       t        j                  t        j                  d>      d;       t        j                  d;       t        j                  t        j                  d?      d@       t        j                  t        j                  dA      d@       t        j                  t        j                  dB      d@       t        j                  d@       t        j                  t        j                  dC      dD       t        j                  t        j                  dE      dD       t        j                  dD       t        j                  t        j                  dF      dG       t        j                  t        j                  dH      dG       t        j                  t        j                  dI      dG       t        j                  t        j                  dJ      dG       t        j                  dG       t        j                  t        j                  dK      dL       t        j                  t        j                  dM      dL       t        j                  dL       t        j                  dNdO       t        j                  t        j                  dP      dO       t        j                  t        j                  dQ      dO       t        j                  t        j                  dR      dO       t        j                  t        j                  dS      dO       t        j                  t        j                  dT      dO       t        j                  dO       t        j                  t        j                  dU      dV       t        j                  t        j                  dW      dV       t        j                  t        j                  dX      dV       t        j                  t        j                  dY      dV       t        j                  t        j                  dZ      dV       t        j                  dV       t        j                  t        j                  d[      d\       t        j                  t        j                  d]      d\       t        j                  t        j                  d^      d\       t        j                  t        j                  d_      d\       t        j                  t        j                  d`      d\       t        j                  d\       t        j                  t        j                  da      db       t        j                  t        j                  dc      db       t        j                  t        j                  dd      db       t        j                  t        j                  de      db       t        j                  db       t        j                  t        j                  df      dg       t        j                  t        j                  dh      dg       t        j                  t        j                  di      dg       t        j                  t        j                  dj      dg       t        j                  t        j                  dk      dg       t        j                  dg       t        j                  t        j                  dl      dm       t        j                  t        j                  dn      dm       t        j                  t        j                  do      dm       t        j                  dm       t        j                  t        j                  dp      dq       t        j                  t        j                  dr      dq       t        j                  t        j                  ds      dq       t        j                  t        j                  dt      dq       t        j                  dq       t        j                  t        j                  du      dv       t        j                  t        j                  dw      dv       t        j                  dv       t        j                  t        j                  dx      dy       t        j                  t        j                  dz      dy       t        j                  dy       t        j                  t        j                  d{      d|       t        j                  t        j                  d}      d|       t        j                  t        j                  d~      d|       t        j                  d|       t        j                  t        j                  d      d       t        j                  t        j                  d      d       t        j                  d       t        j                  t        j                  d      d       t        j                  t        j                  d      d       t        j                  t        j                  d      d       t        j                  d       t        j                  t        j                  d      d       t        j                  t        j                  d      d       t        j                  d       t        j                  t        j                  d      d       t        j                  t        j                  d      d       t        j                  d       y )Nr1  r-  )
table_namer0  r/  r,  r(  r+  r*  r'  r"  r&  r%  r$  r!  r  r   r  r  r  r  r  r  r  r  r
  r	  r  r  r  r  r   r  r  r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r|   r   r   r   r   r{   rs   rz   ry   rx   rr   rj   rq   rp   ro   rn   ri   rd   rh   rg   rc   rO   rb   ra   r`   rN   r@   rM   r?   r:   r>   r9   r2   r8   r7   r1   r-   r0   r,   r!   r+   r*   r    r   r   r   r   r   )r   
drop_indexr;  
drop_tablerD  rE  rF  	downgraderL  j  s   MM"$$BCPmnMM"$$:;HefMM"$$BCPmnMM/0MM"$$?@MghMM"$$78E_`MM"$$?@MghMM,-MM"$$=>KbcMM"$$=>KbcMM"$$45BYZMM"$$<=JabMM)*MM"$$CDQopMM"$$;<IghMM"$$CDQopMM01MM"$$:;H]^MM"$$;<I^_MM"$$23@UVMM"$$:;H]^MM'(MM"$$67DUVMM"$$78EVWMM"$$./<MNMM"$$01>OPMM"$$67DUVMM5BSTMM#$MM6CXYMM"$$=>K`aMM"$$:;H]^MM"$$;<I^_MM"$$23@UVMM"$$:;H]^MM'(MM7DYZMM"$$:;H]^MM"$$;<I^_MM"$$23@UVMM"$$45BWXMM"$$:;H]^MM'(MM"$$;<I^_MM"$$23@UVMM"$$:;H]^MM'(MM"$$89FYZMM"$$01>QRMM"$$89FYZMM%&MM"$$78EWXMM"$$89FXYMM"$$/0=OPMM"$$78EWXMM$%MM"$$>?LdeMM"$$>?LdeMM"$$56C[\MM"$$=>KcdMM*+MM"$$;<I_`MM"$$34AWXMM"$$;<I_`MM()MM"$$./<MNMM"$$67DUVMM#$MM"$$56CSTMM"$$67DTUMM"$$-.;KLMM"$$56CSTMM"#MM"$$01>QRMM"$$89FYZMM%&MM5B\]MM"$$BCPjkMM"$$?@MghMM"$$@ANhiMM"$$78E_`MM"$$?@MghMM,-MM"$$EFSpqMM"$$BCPmnMM"$$CDQnoMM"$$:;HefMM"$$BCPmnMM/0MM"$$89FYZMM"$$9:GZ[MM"$$01>QRMM"$$89FYZMM"$$78EXYMM%&MM"$$78EWXMM"$$89FXYMM"$$/0=OPMM"$$78EWXMM$%MM"$$12}MMM"$$23NMM"$$34OMM"$$*+FMM"$$23NMM- MM"$$45.QMM"$$+,HMM"$$34PMM.!MM"$$78EVWMM"$$78EVWMM"$$./<MNMM"$$67DUVMM#$MM"$$'(Z@MM"$$/0ZHMM*MM"$$'I>MM"$$./IFMM)MM"$$78EWXMM"$$/0=OPMM"$$78EWXMM$%MM"$$()kBMM"$$01kJMM+MM"$$()kBMM"$$12{KMM"$$01kJMM+MM"$$)*|DMM"$$12|LMM,MM"$$()kBMM"$$01kJMM+rE  )returnN)__doc__typingr   r   alembicr   
sqlalchemyr3  r   str__annotations__r	   r
   r   rG  rL  rD  rE  rF  <module>rT     sv    #   # "0uS$Y 015uS(3--. 5.2
E#x}d*+ 2Q	DjKrE  