
    %7i                     p    d Z ddlmZ ddlmZmZmZmZmZmZm	Z	 ddl
mZ  G d de      Z G d de      Zy	)
ze
Hyper Forecast V2 - Product Forecast Model
Stores product-level metrics for intelligent forecasting
    )datetime)ColumnIntegerStringDateTimeDateNumericBoolean)Basec                      e Zd ZdZdZ eed      Z e ed      ddd      Z	 e ed      dd	      Z
 e ed
            Z e ed
            Z e ed            Z e ed            Z e edd            Z e edd            Z ee      Z ee      Z e edd            Z e edd            Z e ed            Z e edd            Z eed      Z eed      Z eed      Z eed      Z e edd            Z e ed            Z e edd            Z e edd            Z e edd            Z  e ed            Z! e ed            Z" e edd            Z# e edd            Z$ ee%d      Z& ee%d      Z' ee(e)jT                        Z+ ee(e)jT                  e)jT                        Z,d Z-y)ProductForecastzO
    Product-level metrics for forecasting.
    Updated daily by sync job.
    product_forecastTprimary_key   Funiquenullableindexd   )r   r   i  2   
            r   default   r   onupdatec                 V    d| j                    d| j                   d| j                   dS )Nz<ProductForecast z: z/day, stock=>)mlb_idavg_units_7dstock_currentselfs    I/var/www/hypershopcomercio.com.br/hyper-ai/app/models/product_forecast.py__repr__zProductForecast.__repr__F   s1    "4;;-r$2C2C1DLQUQcQcPddeff    N).__name__
__module____qualname____doc____tablename__r   r   idr   r#   skutitle	thumbnailcategory_mlcategory_normalizedr	   r$   avg_units_30dtotal_units_7dtotal_units_30dtotal_revenue_7dtotal_revenue_30dtrend	trend_pctr%   
stock_fullstock_localstock_incomingdays_of_coveragestock_statuspricecost
margin_pctcurvecurve_criteriaforecast_units_todayforecast_revenue_todayr
   	is_activehas_rupture_riskr   r   utcnow
created_at
updated_atr)    r*   r(   r   r   
   s    'M	T	*B F2Jte4HF
t4
8C6#;Evc{#I %K , '"a.)L72q>*MG_NWoOgb!n-wr1~. 6":Ewq!}%I 7A.M+J!,KGQ/Ngam,&*%L 72q>"E'"a.!D1&J 6!9EF2J'N "'"a.1#GBN3 w-Igu5 (//:J(//HOOTJgr*   r   c                      e Zd ZdZdZ eed      Z e ed      ddd      Z	 e ed            Z
 e ed	            Z e ed
d      d      Z e ed
d      d      Z e ed
d      d      Z e ed
d      d      Z eed      Z eeej*                        Z eeej*                  ej*                        Zd Zy)CategoryMappingzr
    Maps ML category codes to normalized category names.
    Allows assigning seasonal factors per category.
    category_mappingTr   r   Fr      r      r   g      ?r   r   c                 <    d| j                    d| j                   dS )Nz<CategoryMapping z -> r"   )r4   r5   r&   s    r(   r)   zCategoryMapping.__repr__e   s&    "4#3#3"4D9Q9Q8RRSTTr*   N)r+   r,   r-   r.   r/   r   r   r0   r   r4   category_ml_namer5   r	   multiplier_summermultiplier_wintermultiplier_fallmultiplier_springr
   rI   r   r   rK   rL   rM   r)   rN   r*   r(   rP   rP   J   s     'M	T	*B TENKfSk* !, wq!}c:wq!}c:WQ]C8Owq!}c:w-I(//:J(//HOOTJUr*   rP   N)r.   r   
sqlalchemyr   r   r   r   r   r	   r
   app.models.baser   r   rP   rN   r*   r(   <module>r\      s8     P P P  =gd =g@Ud Ur*   