from app.main.util.json_objects.json_serializable import JsonSerializable
from app.main.util.service_helpers.games.leadedge import leadedge_helper


class LECompanyScenarioDTO(JsonSerializable):

    def __init__(self):
        JsonSerializable.__init__(self)
        self.id = None
        self.company_id = None
        self.round_scenario_id = None
        self.opex_product1_sales_quantity = None
        self.opex_product1_sales_quantity_variation = None
        self.opex_product1_prod_quantity = None
        self.opex_product1_price = None
        self.opex_product1_price_variation = None
        self.opex_product1_unit_cost = None
        self.opex_product1_supply_cost = None
        self.opex_product1_marketing = None
        self.opex_product1_marketing_variation = None
        self.opex_product2_sales_quantity = None
        self.opex_product2_sales_quantity_variation = None
        self.opex_product2_prod_quantity = None
        self.opex_product2_price = None
        self.opex_product2_price_variation = None
        self.opex_product2_unit_cost = None
        self.opex_product2_supply_cost = None
        self.opex_product2_marketing = None
        self.opex_product2_marketing_variation = None
        self.opex_product3_sales_quantity = None
        self.opex_product3_sales_quantity_variation = None
        self.opex_product3_prod_quantity = None
        self.opex_product3_price = None
        self.opex_product3_price_variation = None
        self.opex_product3_unit_cost = None
        self.opex_product3_supply_cost = None
        self.opex_product3_marketing = None
        self.opex_product3_marketing_variation = None
        self.opex_training_budget = None
        self.opex_training_budget_variation = None
        self.opex_salary_increase = None
        self.opex_salary = None
        self.opex_bonus_budget = None
        self.opex_bonus_budget_variation = None
        self.capex_rd_budget = None
        self.capex_total_rd_budget = None
        self.capex_rd_budget_threshold = leadedge_helper.RD_ELECTRIC_THRESHOLD
        self.capex_equipment_value_per_unit = leadedge_helper.EQUIPMENT_VALUE_PER_UNIT
        self.capex_cadres_per_unit = leadedge_helper.CADRES_PER_UNIT
        self.capex_techniciens_per_unit = leadedge_helper.TECHNICIANS_PER_UNIT
        self.capex_ouvriers_per_unit = leadedge_helper.OUVRIERS_PER_UNIT
        self.capex_rd_budget_variation = None
        self.capex_product1_quality = None
        self.capex_product2_quality = None
        self.capex_product3_quality = None
        self.capex_product1_new_units = None
        self.capex_product2_new_units = None
        self.capex_product3_new_units = None
        self.finance_payout_ratio = None
        self.finance_short_term_debt = None
        self.finance_long_term_debt = None
        self.current_cash = None

    def init(self, company_scenario, capex_total_rd_budget, current_cash):
        self.id = company_scenario.id
        self.company_id = company_scenario.company_id
        self.round_scenario_id = company_scenario.round_scenario_id
        self.opex_product1_sales_quantity = company_scenario.opex_product1_sales_quantity
        self.opex_product1_sales_quantity_variation = company_scenario.opex_product1_sales_quantity_variation
        self.opex_product1_prod_quantity = company_scenario.opex_product1_prod_quantity
        self.opex_product1_price = company_scenario.opex_product1_price
        self.opex_product1_price_variation = company_scenario.opex_product1_price_variation
        self.opex_product1_unit_cost = company_scenario.opex_product1_unit_cost
        self.opex_product1_supply_cost = company_scenario.opex_product1_supply_cost
        self.opex_product1_marketing = company_scenario.opex_product1_marketing
        self.opex_product1_marketing_variation = company_scenario.opex_product1_marketing_variation
        self.opex_product2_sales_quantity = company_scenario.opex_product2_sales_quantity
        self.opex_product2_sales_quantity_variation = company_scenario.opex_product2_sales_quantity_variation
        self.opex_product2_prod_quantity = company_scenario.opex_product2_prod_quantity
        self.opex_product2_price = company_scenario.opex_product2_price
        self.opex_product2_price_variation = company_scenario.opex_product2_price_variation
        self.opex_product2_unit_cost = company_scenario.opex_product2_unit_cost
        self.opex_product2_supply_cost = company_scenario.opex_product2_supply_cost
        self.opex_product2_marketing = company_scenario.opex_product2_marketing
        self.opex_product2_marketing_variation = company_scenario.opex_product2_marketing_variation
        self.opex_product3_sales_quantity = company_scenario.opex_product3_sales_quantity
        self.opex_product3_sales_quantity_variation = company_scenario.opex_product3_sales_quantity_variation
        self.opex_product3_prod_quantity = company_scenario.opex_product3_prod_quantity
        self.opex_product3_price = company_scenario.opex_product3_price
        self.opex_product3_price_variation = company_scenario.opex_product3_price_variation
        self.opex_product3_unit_cost = company_scenario.opex_product3_unit_cost
        self.opex_product3_supply_cost = company_scenario.opex_product3_supply_cost
        self.opex_product3_marketing = company_scenario.opex_product3_marketing
        self.opex_product3_marketing_variation = company_scenario.opex_product3_marketing_variation
        self.opex_training_budget = company_scenario.opex_training_budget
        self.opex_training_budget_variation = company_scenario.opex_training_budget_variation
        self.opex_salary_increase = company_scenario.opex_salary_increase
        self.opex_salary = company_scenario.opex_salary
        self.opex_bonus_budget = company_scenario.opex_bonus_budget
        self.opex_bonus_budget_variation = company_scenario.opex_bonus_budget_variation
        self.capex_rd_budget = company_scenario.capex_rd_budget
        self.capex_rd_budget_variation = company_scenario.capex_rd_budget_variation
        self.capex_total_rd_budget = capex_total_rd_budget
        self.capex_product1_quality = company_scenario.capex_product1_quality
        self.capex_product2_quality = company_scenario.capex_product2_quality
        self.capex_product3_quality = company_scenario.capex_product3_quality
        self.capex_product1_new_units = company_scenario.capex_product1_new_units
        self.capex_product2_new_units = company_scenario.capex_product2_new_units
        self.capex_product3_new_units = company_scenario.capex_product3_new_units
        self.finance_payout_ratio = company_scenario.finance_payout_ratio
        self.finance_short_term_debt = company_scenario.finance_short_term_debt
        self.finance_long_term_debt = company_scenario.finance_long_term_debt
        self.current_cash = current_cash