
    կ)i*                         d dl mZ d dlmZmZmZ d dlmZmZm	Z	 d dl
mZmZmZmZ d dlmZ d dlmZ  G d de      Z G d	 d
e      Zy)    )Optional)	BaseModelEmailStrField)INTEGERVARCHAR
ForeignKey)MappedSessionmapped_columnrelationship)Base)
TblStudentc                       e Zd ZU  ed      Zee   ed<    ed      Ze	dz  ed<    ed      Z
ee	   ed<    ed      Zee	   ed<    ed      Zee   ed<    ed      Zee	   ed	<    ed      Zee	   ed
<   y)	GroupBaseN)defaultgroup_idsimulation_code
group_namecategory_assignedr   number_of_memberscategory
group_code)__name__
__module____qualname__r   r   r   int__annotations__r   strr   r   r   r   r        </var/www/html/retail-simulation-api/app/models/main/group.pyr   r      s    #D1Hhsm1"'"5OS4Z5 %d 3J3',T':x}:',Q'7x}7#D1Hhsm1 %d 3J3r!   r   c            	       	   e Zd ZU dZ ededd      Zee   e	d<    e e
d       ed      d      Zee   e	d	<    ed
 e
d      d      Zee   e	d
<    ed e
d      d      Zee   e	d<    ed e
d      d      Zeee      e	d<    ededd      Zee   e	d<    ed e
d      d      Zeee      e	d<    ed e
d      dd      Zee   e	d<    ed e
d      d      Zeee      e	d<    ed e
d      d      Zeee      e	d<    ed e
d      d      Zee   e	d<    ed e
d      d      Zee   e	d<    ed e
d      d      Zee   e	d<    ed e
d      d      Zee   e	d<    ed e
d      d      Zee   e	d<    edd      Z edd      Z ed d      Z ed!d      Z  ed"d      Z! ed#d      Z" ed$d      Z# ed%d      Z$ ed&d      Z% ed'd      Z& ed(d      Z' ed)d      Z( ed*d      Z) ed+d      Z* ed,d      Z+ ed-d      Z, ed.d      Z- ed/d      Z. ed0d      Z/ ed1d      Z0 ed2d      Z1 ed3d      Z2 ed4d      Z3 ed5d      Z4 ed6d      Z5 ed7d      Z6 ed8d      Z7 ed9d      Z8 ed:d      Z9 ed;d      Z: ed<d      Z; ed=d      Z< ed>d      Z= ed?d      Z> ed@d      Z? edAd      Z@ edBd      ZA edCd      ZB edDd      ZC edEd      ZD edFd      ZE edGd      ZF edHd      ZG edId      ZH edJd      ZI edKd      ZJ edLd      ZK edMd      ZL edNd      ZM edOd      ZN edPd      ZO edQd      ZP edRd      ZQ edSd      ZR edTd      ZS edUd      ZT edVd      ZU edWd      ZV edXd      ZW edYd      ZX edZd      ZY ed[d      ZZ ed\d      Z[ ed]d      Z\ ed^d      Z] ed_d      Z^ ed`d      Z_ edad      Z` edbd      Za edcd      Zb eddd      Zc eded      Zd edfd      Ze edgd      Zf edhd      Zg edid      Zh edjd      Zi edkd      Zj edld      Zkeldmemdnendod fdp       Zoeldednendodqfdr       Zpeldedmemdnendodqfds       Zqerdednenfdt       Zserdednenfdu       Ztyv)wTblGroup	tbl_groupr   T)primary_keyautoincrementd   ztbl_simulation.simulation_codeF)nullabler   r      group_emailr   r   r   )r)   r   r   r   )r)   uniquesample_excel_oneexcel_pre_select0corporate_and_concept_level_organisational_chart store_level_organisational_chartcategory_definition_excelinventory_managemannt_excelonline_policies_excelTblSimulationgroups)back_populatesr   groupTblBrand
TblSegmentTblStoreFormatTblCustomerLocationTblCatchmentPotentialTblCategoryTblNetworkPlanningTblCivilTblDisplayRackingUnitTblCommercialEquipmentTblPlumbingTblTradingMonthTblPreOperatingExpenseTblCompetitorAnalysisTblDisplayBoardTblCompetitorBenchmarkingTblCarpentryTblInfoTechTblVisualMerchElementsTblDepreciationTblCompetitorCategoryAnalysesTblGrossMarginContributionTblVendorMetricsPriorityListTblPreSelectedCategoryTblVendorScorecardTblPrivateLabllingTblCategoryCaptinshipPlanningTblAdditionalInstallationTblSalesEstimateTblRentExpensesTblCompetitorPricingAnalysis TblStoreFormatepricingStrategiesTblCompetitorAnalysisComparisonTblCorporateConceptOffice
TblUtilityTblOperatingExpensesTblStoreLevelStaffNeedsTblCentralisedAndDirectTblCategoryWishInventoryTblShrinkageAreasReasonsTblSalesTblRecurringOperatingTblDigitalAssetTblMarketingCompetitorTblCompetitorIntensityTblProjectedMarketShareTblLocationSpillageFactorTblLocationDetailsTblElectricalCablingTblCategoryPricingStrategisTblDefineYourPromotionsTblPromotionCompetitorAnalysisTblRecoveryOfPromotionalTblCustomerEngagementTblCompetitorLoyaltyTblBrandAttributeAssessmentTblBrandingAttributesTblIntegratedMarketingTblAnnexuresTblOptimisingAssetsTblShortNegotiationFinal%TblMarginandSalesContributionAnalysisTblOnlinePreSelectServiceTblAdaptingSupplyChainTblCriticalBusinessTblExpandedPerformanceTblCategoriesUnderPromotionsTblComparativeAnalysisTblMeasuringSalesProfitabilityTblConceptOffice
TblSummaryTblCashConversionCycleTblVisualMerchStrategyTblPhysicalStoreFormatsTblCapExRefurbishTblOnlineStoreFormatTblAllContentdatadbreturnc                 x    |j                         } | di |}|j                  |       |j                          |S )Nr    )
model_dumpaddflush)clsr   r   	data_dictnew_datas        r"   createzTblGroup.createw   s5    OO%	##
x

r!   zTblGroup | Nonec                 x    |j                  |       j                  | j                  |k(        j                         S N)queryfilterr   first)r   r   r   s      r"   	get_groupzTblGroup.get_group   s-    xx}##CLLH$<=CCEEr!   c                 4   |j                  |       j                  | j                  |k(        j                         }|sy |j	                         }|j                         D ]  \  }}|	t        |||        |j                          |j                  |       |S r   )	r   r   r   r   r   itemssetattrcommitrefresh)r   r   r   r   get_datar   keyvalues           r"   updatezTblGroup.update   s    88C=''(@AGGIOO%	#//+JC #u- , 			


8r!   c                     |j                  t        j                  t        j                        j	                  t        j
                  | k(        j                         S r   )r   r$   r   r   r   r   r   r   r   s     r"   get_group_categoryzTblGroup.get_group_category   sB    xx&&
 &""h.
/	8r!   c                     |j                  t              j                  t        j                  | k(        j	                         S )gdhsas)r   r   r   r   allr   s     r"   get_students_by_group_idz!TblGroup.get_students_by_group_id   s2     xx
#**:+@+@H+LMQQSSr!   N)ur   r   r   __tablename__r   r   r   r
   r   r   r   r	   r   r   r   r+   r   r   r   r   r   r-   r.   r/   r0   r1   r2   r3   r   
simulationstudentsbrandssegmentstoreformatecustomerlocationcatchmentPotential
categoriesnetwork_planningcivilsdisplay_racking_unitscommercial_equipmentsplumbingtrading_monthpre_operating_expensecompetitor_analysisdisplay_boardcompetitor_bench_marking	carpentry	info_techvisual_merchandising_elementsdepreciationcompetitor_category_analysesgross_margin_contributionvendor_metrics_priority_listpre_selected_categoryvendor_scorecardprivate_labllingcategory_captinship_planningadditional_installationsales_estimaterent_expensescompetitor_pricing_analysis store_formate_pricing_strategiescompetitor_analysis_comparisoncorporate_concept_officeutilityoperating_expensesstore_level_staff_needscentralised_directcategory_wish_inventoryshrinkage_areas_reasonssalesrecurring_operatingdigital_assetmarketing_competitorcompetitor_intensityprojected_market_sharelocation_spillage_factorlocation_detailselectrical_cablingcategory_pricing_strategisdefine_your_promotionspromotion_competitor_analysisrecovery_of_promotionalcustomer_engagementcompetitor_loyaltybrand_attribute_assessmentbrand_attributesintegrated_marketing	annexuresoptimising_assetsshort_negotiation_final&margin_and_sales_contribution_analysisonline_pre_selected_serviceadapting_supply_chaincritical_for_businessexpanded_performance_metricscategories_under_promotionscomparative_analysismeasuring_sales_profitabilityconcept_officesummarycash_conversionvisual_merchandising_strategyphysical_store_formatscap_ex_refurbishonline_store_formatall_contentclassmethodr   r   r   r   r   staticmethodr   r   r    r!   r"   r$   r$      s7   M)*g4_cdHfSkd#0zJj?kv{#|OVC[|+L'#,QVWJsW,]GCLSXYKY/<=PRYZ]R^im/nvhsm,n%23FZ_ij%kvc{k&3JW[&\HfXc]#\+L'#,QV_cdJsd.;<NPWX[P\gk.lfXc]+l.;<NPWX[P\gk.lfXc]+lER  TF  HO  PS  HT  _c  Fd4vc{  d5BCegnorgs  C  6D$vc{  D.;<WY`adYept.usu0=>[]deh]itx0y&+y*78OQXY\Q]hl*mF3KmohGJLAH*W=F<@G/HL#$9'R%&=gVmGDJ#$8Q*G<F()@PWX()ARYZM'BH !27KM()ARYZ&'>wW !27KM+,GX_`^GDI]7CI$01IZa$b! 1'JL#/0O`g#h  ,-IZa b#/0N_f#g ()ARYZ#$8Q#$8Q#/0O`g#h *+FW^_!"4WMN !27KM"./M^e"f'34Vgn'o$%12Sdk%l"+,GX_`<@G%&<WU*+DU\]%&?PWX*+EV]^*+EV]^G<E&'>wW !27KM'(@QXY'(@QXY)*CT[\+,GX_`#$8Q%&<WU!-.K\c!d)*CT[\$01Qbi$j!*+EV]^&'>wW%&<WU!-.K\c!d#$;GT'(@QXY^GDI$%:7S*+EV]^-9:ary-z*"./J[b"c()ARYZ()>wW#/0HY`#a "./M^e"f'(@QXY$01Qbi$j!!"4WMN<@G"#;GTO$01IZa$b!)*CT[\#$7P&'=gVwGK)  Z   F F' F6G F F 
c 
 
 
DU 
 
 8S 8g 8 8 T3 TG T Tr!   r$   N)typingr   pydanticr   r   r   
sqlalchemyr   r   r	   sqlalchemy.ormr
   r   r   r   app.models.mainr   app.models.main.studentr   r   r$   r    r!   r"   <module>r      s<     / / 3 3 G G   .	4	 	4HTt HTr!   