
    ^/i.                         U d Z ddlmZmZ ddlmZ ddlZdZe	e
d<   dZee	df   e
d<   dZee	ee	   df   e
d	<   dZee	ee	   df   e
d
<   ddZddZy)zyinvnetory snapsot and forecast

Revision ID: be92d0addc3f
Revises: 694082d3ab93
Create Date: 2025-12-02 15:40:14.633591

    )SequenceUnion)opNbe92d0addc3frevision694082d3ab93down_revisionbranch_labels
depends_onc            %      ,"   t        j                  dt        j                  dt        j                         d      t        j                  dt        j                         d      t        j                  dt        j                         d      t        j                  dt        j                         d      t        j                  d	t        j
                         d      t        j                  d
t        j
                         d      t        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                  t        j                  d      ddgd       t        j                  t        j                  d      ddgd       t        j                  t        j                  d      ddgd       t        j                  t        j                  d      ddgd       t        j                  dt        j                  dt        j                         d      t        j                  dt        j
                         d      t        j                  dt        j                         d      t        j                  dt        j                         d      t        j                  dt        j                         d      t        j                  dt        j                         d      t        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                  t        j                  d      ddgd       t        j                  t        j                  d      ddgd       t        j                  t        j                  d      ddgd       t        j                  t        j                  d      ddgd       t        j                  t        j                  d      ddgd       t        j                  d dg d!d       t        j                  d"t        j                  dt        j                         d      t        j                  dt        j
                         d      t        j                  dt        j                         d      t        j                  dt        j                         d      t        j                  dt        j                         d      t        j                  d#t        j                         d      t        j                  d$t        j                         d      t        j                  d%t        j                         d      t        j                  d&t        j                         d      t        j                  d't        j                         d      t        j                  d(t        j                         d      t        j                  d)t        j                         d      t        j                  d*t        j                         d      t        j                  d+t        j                         d      t        j                  d,t        j                         d      t        j                  dt        j                         d      t        j                  dt        j                         d      t        j                  d-t        j                         d      t        j                  d.t        j                         d      t        j                  d/t        j                         d      t        j                  d0t        j                  d12      d      t        j                  d3t        j                         d      t        j                  d4t        j                         d      t        j                  dgd5g      t        j                  dgd6g      t        j                  dgd7g      t        j                  d      t        j                  ddddd89             t        j                  t        j                  d:      d"dgd       t        j                  t        j                  d;      d"dgd       t        j                  t        j                  d<      d"dgd       t        j                  t        j                  d=      d"dgd       t        j                  t        j                  d>      d"dgd       t        j                  d?t        j                  dt        j                         d      t        j                  dt        j                         d      t        j                  dt        j                         d      t        j                  dt        j                         d      t        j                  d%t        j                         d      t        j                  d&t        j                         d      t        j                  d't        j                         d      t        j                  d@t        j                         d      t        j                  dAt        j                         d      t        j                  dt        j                  d      t        j                  d      d      t        j                  dBt        j                  d      t        j                  d      d      t        j                  dgd5g      t        j                  dgd6g      t        j                  dgd7g      t        j                  d      t        j                  ddddC9             t        j                  t        j                  dD      d?dgd       t        j                  t        j                  dE      d?dgd       t        j                  t        j                  dF      d?dgd       t        j                  t        j                  dG      d?dgd       t        j                  dHt        j                  dt        j                         d      t        j                  dt        j
                         d      t        j                  dt        j                         d      t        j                  dt        j                         d      t        j                  dt        j                         d      t        j                  dt        j                         d      t        j                  dIt        j                         d      t        j                  dJt        j                         d      t        j                  dKt        j                         d      t        j                  dLt        j                         d      t        j                  dMt        j                         d      t        j                  dNt        j                  d12      d      t        j                  dOt        j                  dP2      d      t        j                  dt        j                  d      t        j                  d      d      t        j                  dgd5g      t        j                  dgd6g      t        j                  dgd7g      t        j                  d             t        j                  t        j                  dQ      dHdgd       t        j                  t        j                  dR      dHdgd       t        j                  t        j                  dS      dHdgd       t        j                  t        j                  dT      dHdgd       t        j                  t        j                  dU      dHdgd       t        j                  dVdHg d!d       y )WNdemand_forecastsidF)nullable
company_idTlocation_id
product_idforecast_datetarget_dateforecast_qtymodel_version
created_at)timezoneznow())server_defaultr   ix_demand_forecasts_company_id)uniqueix_demand_forecasts_idix_demand_forecasts_location_idix_demand_forecasts_product_idinventory_snapshot_dailysnapshot_dateon_hand_qtyinbound_qtyoutbound_qty&ix_inventory_snapshot_daily_company_idix_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   r   inventory_planning_snapshotavg_daily_demandsigma_daily_demandlead_time_daysreview_period_daysservice_level_targetcurrent_safety_stockcurrent_reorder_pointforecast_avg_daily_demand_90dforecast_safety_stock_90dforecasted_reorder_point_90davailable_stock
min_target
max_targetstock_status   )lengthrecommended_order_qtyshould_reorderzcompanies.company_idzlocations.location_idzproducts.product_id$uq_planning_snapshot_per_day_sku_loc)name)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_datereorder_policiesmin_order_qtysupplier_id
updated_at"uq_reorder_policy_company_loc_prodix_reorder_policies_company_idix_reorder_policies_idix_reorder_policies_location_idix_reorder_policies_product_idslow_mover_snapshottotal_sold_90dads_90ddoh_90ddays_since_last_saleis_slow_moverslow_mover_severityslow_mover_reason   !ix_slow_mover_snapshot_company_idix_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_loc)r   create_tablesaColumnIntegerDateFloatStringDateTimetextPrimaryKeyConstraintcreate_indexfBooleanForeignKeyConstraintUniqueConstraint     [/var/www/html/hubwallet-dev/alembic/versions/be92d0addc3f_invnetory_snapsot_and_forecast.pyupgradern      s   OO&IIdBJJL51IIlBJJL48IImRZZ\D9IIlBJJL48IIorwwy59IImRWWY7IInbhhj59IIoryy{T:IIlBKK6rwwwGWbfgD! OOBDD9:<NQ]P^glmOOBDD124FW\]OOBDD:;=OR_Q`inoOOBDD9:<NQ]P^glmOO.IIdBJJL51IIorwwy59IIlBJJL59IImRZZ\E:IIlBJJL59IImRXXZ%8IImRXXZ%8IInbhhj59IIlBKK6rwwwGWbfgD! OOBDDABD^am`nw|}OOBDD9:<VY]X^glmOOBDDBCE_boapy~OOBDDABD^am`nw|}OOBDDDEGadsct  ~C  DOO79S  VR  [_  `OO1IIdBJJL51IIorwwy59IIlBJJL59IImRZZ\E:IIlBJJL59II "((*u=II"BHHJ?II

u=II"BJJL5AII$bhhj5AII$bhhj5AII%rxxzEBII-rxxzEJII)288:FII,bhhj5IIImRXXZ%8IImRXXZ%8IIe<IIlBHHJ7IIlBHHJ7IInbiir2TBII%rxxzEBII

u=\N-C,DG]O.E-FI\N-B,CFD!}lY  A9< OOBDDDEGdgsft  ~C  DOOBDD<=?\_c^dmrsOOBDDEFHehugv  @E  FOOBDDDEGdgsft  ~C  DOOBDDGHJgjyiz  DI  JOO&IIdBJJL51IIlBJJL59IImRZZ\E:IIlBJJL59II

u=II"BJJL5AII$bhhj5AIIorxxzE:IImRZZ\D9IIlBKK6rwwwGWbfgIIlBKK6rwwwGWbfg\N-C,DG]O.E-FI\N-B,CFD!m\Hlm!$ OOBDD9:<NQ]P^glmOOBDD124FW\]OOBDD:;=OR_Q`inoOOBDD9:<NQ]P^glmOO)IIdBJJL51IIorwwy59IIlBJJL59IImRZZ\E:IIlBJJL59IImRXXZ%8II
U;IIie4IIie4II$bjjlUCIIorzz|e<II#RYYb%9DIII!299C#84HIIlBKK6rwwwGWbfg\N-C,DG]O.E-FI\N-B,CFD!%( OOBDD<=?TWcVdmrsOOBDD457Ltf]bcOOBDD=>@UXeWfotuOOBDD<=?TWcVdmrsOOBDD?@BWZiYjsxyOO8:O  RN  W[  \rl   c                     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                  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                  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                  d      d       t        j                  t        j                  d      d       t        j                  d       y ) Nr[   rM   )
table_namerZ   rY   rX   rW   rV   rL   rD   rK   rJ   rI   rC   r*   rB   rA   r@   r?   r)   r   r(   r'   r&   r%   r$   r   r   r   r   r   )r   
drop_indexrg   
drop_tablerk   rl   rm   	downgraders      s   MM6CXYMM"$$=>K`aMM"$$:;H]^MM"$$;<I^_MM"$$23@UVMM"$$:;H]^MM'(MM"$$78EWXMM"$$89FXYMM"$$/0=OPMM"$$78EWXMM$%MM"$$EFSpqMM"$$BCPmnMM"$$CDQnoMM"$$:;HefMM"$$BCPmnMM/0MM5B\]MM"$$BCPjkMM"$$?@MghMM"$$@ANhiMM"$$78E_`MM"$$?@MghMM,-MM"$$78EWXMM"$$89FXYMM"$$/0=OPMM"$$78EWXMM$%rl   )returnN)__doc__typingr   r   alembicr   
sqlalchemyr]   r   str__annotations__r	   r
   r   rn   rs   rk   rl   rm   <module>r{      su    #   # "0uS$Y 015uS(3--. 5.2
E#x}d*+ 2v\t&rl   