
    i                         d dl mZmZ d dlmZ d dlmZ  G d de      Z G d de      Z G d d	e      Z G d
 de      Z	 G d de      Z
 G d de      Zy)    )ListOptional)datetime)CustomModelc                      e Zd ZU dZee   ed<   dZee   ed<   dZ	ee   ed<   dZ
ee   ed<   dZee   ed<   dZee   ed	<   dZee   ed
<   dZee   ed<   dZee   ed<   dZee   ed<   dZee   ed<   dZee   ed<   dZee   ed<   dZee   ed<   dZee   ed<   dZee   ed<   dZee   ed<   dZee   ed<   dZee   ed<   dZee   ed<   dZee   ed<   dZee   ed<   dZee   ed<   y)NetworkPlanningr   
network_idN/Alocationstatetotal_hh	target_hhg        areaactionformat_a_y1format_a_y2format_a_y3format_a_y4format_a_y5format_b_y1format_b_y2format_b_y3format_b_y4format_b_y5total_store_count_y1total_store_count_y2total_store_count_y3total_store_count_y4total_store_count_y5group_idN)__name__
__module____qualname__r	   r   int__annotations__r   strr   r   r   r   floatr   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r         >/var/www/html/retail-simulation-api/app/api/module_3/schema.pyr   r      sI    !J!#Hhsm# E8C= Hhsm Ix} D(5/!FHSM!!"K#"!"K#"!"K#"!"K#"!"K#"!"K#"!"K#"!"K#"!"K#"!"K#"*+(3-+*+(3-+*+(3-+*+(3-+*+(3-+Hhsmr)   r   c                       e Zd ZU dZee   ed<   dZee   ed<   dZ	ee   ed<   dZ
ee   ed<   dZee   ed<   dZee   ed<   y	)
TradingMonthsr   
trading_idr
   store_a_trading_monthsstore_b_trading_monthsrationale_for_store_arationale_for_store_br    N)r!   r"   r#   r-   r   r$   r%   r.   r&   r/   r0   r1   r    r(   r)   r*   r,   r,   "   sZ     !J!,1HSM1,1HSM1+08C=0+08C=0Hhsmr)   r,   c                       e Zd ZU dZee   ed<   dZee   ed<   dZee   ed<   dZ	ee   ed<   dZ
ee   ed<   dZee   ed<   dZee   ed	<   dZee   ed
<   dZee   ed<   dZee   ed<   y)PreOperatingExpensesr   pre_operating_idpre_operating_months_store_apre_operating_months_store_bmarketing_expenses_store_amarketing_expenses_store_br
   accounting_benefits_store_aaccounting_benefits_store_bother_remarks_store_aother_remarks_store_br    N)r!   r"   r#   r4   r   r$   r%   r5   r6   r7   r8   r9   r&   r:   r;   r<   r    r(   r)   r*   r3   r3   ,   s    &'hsm'23 (3-323 (3-301101116#616#6+08C=0+08C=0Hhsmr)   r3   c                   ^   e Zd ZU dZee   ed<   dZee   ed<   dZee   ed<   dZ	ee   ed<   dZ
ee   ed<   dZee   ed<   dZee   ed<   dZee   ed	<   dZee   ed
<   dZee   ed<   dZee   ed<   dZee   ed<   dZee   ed<   dZee   ed<   dZee   ed<   dZee   ed<   dZee   ed<   dZee   ed<   dZee   ed<   dZee   ed<   dZee   ed<   dZee   ed<   dZee   ed<   edefd       Zedefd       Zedefd       Z edefd       Z!edefd       Z"edefd       Z#y )!StoreInvestmentSummaryr   capital_expenses_acapital_expenses_bit_capital_expenses_ait_capital_expenses_btotal_store_capital_expenses_atotal_store_capital_expenses_brental_advance_arental_advance_bpre_operating_expenses_apre_operating_expenses_bmarketing_expenses_amarketing_expenses_btotal_store_investment_atotal_store_investment_br    rent_per_month_arent_per_month_butilities_autilities_bemployee_wages_aemployee_wages_bpre_operating_months_apre_operating_months_breturnc                     | j                   xs d| j                  xs dz   | j                  xs dz   }| j                  xs d|z  | j                  xs dz   S u{   Pre-operating Expenses = Number of PreOperating Month × (Rent per Month + Utilities + Employee Wages) + Marketing Expensesr   )rM   rO   rQ   rS   rI   selfmonthly_costss     r*   #calculated_pre_operating_expenses_az:StoreInvestmentSummary.calculated_pre_operating_expenses_aU   ]     ..3!8H8H8MANRVRgRgRlklm++0qMATE^E^Ecbcddr)   c                     | j                   xs d| j                  xs dz   | j                  xs dz   }| j                  xs d|z  | j                  xs dz   S rW   )rN   rP   rR   rT   rJ   rX   s     r*   #calculated_pre_operating_expenses_bz:StoreInvestmentSummary.calculated_pre_operating_expenses_b[   r\   r)   c                 D    | j                   xs d| j                  xs dz   S zGTotal Capital Expenses = Capital Expenses excl.IT + IT Capital Expensesr   )r?   rA   rY   s    r*   #calculated_total_capital_expenses_az:StoreInvestmentSummary.calculated_total_capital_expenses_aa   %     '',11K1K1PqQQr)   c                 D    | j                   xs d| j                  xs dz   S r`   )r@   rB   ra   s    r*   #calculated_total_capital_expenses_bz:StoreInvestmentSummary.calculated_total_capital_expenses_bf   rc   r)   c                 V    | j                   | j                  xs dz   | j                  z   S zSStore Investment = Total Capital Expenses + Rental Advance + Pre-operating Expensesr   )rb   rE   r[   ra   s    r*   #calculated_total_store_investment_az:StoreInvestmentSummary.calculated_total_store_investment_ak   ;     774;P;P;UTUVY]  ZB  ZB  B  	Br)   c                 V    | j                   | j                  xs dz   | j                  z   S rg   )re   rF   r^   ra   s    r*   #calculated_total_store_investment_bz:StoreInvestmentSummary.calculated_total_store_investment_bp   ri   r)   N)$r!   r"   r#   r?   r   r$   r%   r@   rA   rB   rC   rD   rE   rF   rG   rH   rI   rJ   rK   rL   r    rM   rN   rO   rP   rQ   rR   rS   rT   propertyr[   r^   rb   re   rh   rk   r(   r)   r*   r>   r>   :   s   ())())+,8C=,+,8C=,45"HSM545"HSM5&'hsm'&'hsm'./hsm/./hsm/*+(3-+*+(3-+./hsm/./hsm/Hhsm '(hsm'&'hsm'!"K#"!"K#"&'hsm'&'hsm',-HSM-,-HSM-eS e e
 eS e e
 RS R R RS R R BS B B BS B Br)   r>   c                   ^    e Zd ZU dZee   ed<   dZee   ed<   dZ	ee   ed<   dZ
ee   ed<   y)Module3Summaryr   
summary_idr
   network_submissionsnetwork_summariser    N)r!   r"   r#   ro   r   r$   r%   rp   r&   rq   r    r(   r)   r*   rn   rn   w   s<     !J!).#.',x},Hhsmr)   rn   c                       e Zd ZU eed<   ee   ed<   eed<   eed<   e	ed<   e
ed<   eed<   edefd	       Zedefd
       Zedefd       Zedefd       Zy)Module3ReportPreviewr    network_planningtrading_monthspre_operating_expensesstore_investment_summarysummarylast_updatedrU   c                     t        | j                  D cg c]!  }|j                  s|j                  dk7  s |# c}      S c c}w )Nr
   )lenrt   r   )rY   ns     r*   total_locationsz$Module3ReportPreview.total_locations   s9    t44[4!

qzzUZGZA4[\\[s   AAAc                 :    t        d | j                  D              S )Nc              3   <   K   | ]  }|j                   xs d   ywr   N)r   .0r|   s     r*   	<genexpr>z;Module3ReportPreview.total_stores_year_5.<locals>.<genexpr>   s!     N8M11)).Q.8M   sumrt   ra   s    r*   total_stores_year_5z(Module3ReportPreview.total_stores_year_5   s    N8M8MNNNr)   c                 :    t        d | j                  D              S )Nc              3   <   K   | ]  }|j                   xs d   ywr   )r   r   s     r*   r   z>Module3ReportPreview.format_a_stores_year_5.<locals>.<genexpr>        E/D!1==%A%/Dr   r   ra   s    r*   format_a_stores_year_5z+Module3ReportPreview.format_a_stores_year_5       Et/D/DEEEr)   c                 :    t        d | j                  D              S )Nc              3   <   K   | ]  }|j                   xs d   ywr   )r   r   s     r*   r   z>Module3ReportPreview.format_b_stores_year_5.<locals>.<genexpr>   r   r   r   ra   s    r*   format_b_stores_year_5z+Module3ReportPreview.format_b_stores_year_5   r   r)   N)r!   r"   r#   r$   r%   r   r   r,   r3   r>   rn   r   rl   r}   r   r   r   r(   r)   r*   rs   rs   ~   s    M?++!!0044] ] ] OS O O F F F F F Fr)   rs   N)typingr   r   r   app.utils.schemas_utilsr   r   r,   r3   r>   rn   rs   r(   r)   r*   <module>r      s[    !  / k  6 K  
 ; 
 9B[ 9Bz [  F; Fr)   