use super::inputs::SelectedCompanyInputs;
use super::model::SelectedCompanySummaryFields;

pub(super) fn fill_selected_company_equity_action_fields(
    fields: &mut SelectedCompanySummaryFields,
    inputs: &SelectedCompanyInputs<'_>,
) {
    fields.selected_company_stock_repurchase_city_connection_latch = inputs
        .stock_repurchase_state
        .as_ref()
        .map(|repurchase_state| repurchase_state.city_connection_latch);
    fields.selected_company_stock_repurchase_building_density_growth_setting = inputs
        .stock_repurchase_state
        .as_ref()
        .and_then(|repurchase_state| repurchase_state.building_density_growth_setting);
    fields.selected_company_stock_repurchase_linked_chairman_profile_id = inputs
        .stock_repurchase_state
        .as_ref()
        .and_then(|repurchase_state| repurchase_state.linked_chairman_profile_id);
    fields.selected_company_stock_repurchase_linked_chairman_personality_raw_u8 = inputs
        .stock_repurchase_state
        .as_ref()
        .and_then(|repurchase_state| repurchase_state.linked_chairman_personality_raw_u8);
    fields.selected_company_stock_repurchase_batch_size = inputs
        .stock_repurchase_state
        .as_ref()
        .and_then(|repurchase_state| repurchase_state.repurchase_batch_size);
    fields.selected_company_stock_repurchase_factor_basis_points = inputs
        .stock_repurchase_state
        .as_ref()
        .and_then(|repurchase_state| repurchase_state.repurchase_factor_basis_points);
    fields.selected_company_stock_repurchase_current_cash = inputs
        .stock_repurchase_state
        .as_ref()
        .and_then(|repurchase_state| repurchase_state.current_cash);
    fields.selected_company_stock_repurchase_stock_value_gate_cash_floor = inputs
        .stock_repurchase_state
        .as_ref()
        .and_then(|repurchase_state| repurchase_state.stock_value_gate_cash_floor);
    fields.selected_company_stock_repurchase_support_adjusted_share_price_scalar = inputs
        .stock_repurchase_state
        .as_ref()
        .and_then(|repurchase_state| repurchase_state.support_adjusted_share_price_scalar);
    fields.selected_company_stock_repurchase_affordability_cash_floor = inputs
        .stock_repurchase_state
        .as_ref()
        .and_then(|repurchase_state| repurchase_state.affordability_cash_floor);
    fields.selected_company_stock_repurchase_unassigned_share_pool = inputs
        .stock_repurchase_state
        .as_ref()
        .and_then(|repurchase_state| repurchase_state.unassigned_share_pool);
    fields.selected_company_stock_repurchase_eligible_for_single_batch = inputs
        .stock_repurchase_state
        .as_ref()
        .map(|repurchase_state| repurchase_state.eligible_for_single_batch_repurchase);
    fields.selected_company_stock_issue_live_bond_count = inputs
        .stock_issue_state
        .as_ref()
        .and_then(|issue_state| issue_state.live_bond_count);
    fields.selected_company_stock_issue_initial_batch_size = inputs
        .stock_issue_state
        .as_ref()
        .and_then(|issue_state| issue_state.initial_issue_batch_size);
    fields.selected_company_stock_issue_trimmed_batch_size = inputs
        .stock_issue_state
        .as_ref()
        .and_then(|issue_state| issue_state.trimmed_issue_batch_size);
    fields.selected_company_stock_issue_share_pressure_basis_points = inputs
        .stock_issue_state
        .as_ref()
        .and_then(|issue_state| issue_state.share_pressure_basis_points);
    fields.selected_company_stock_issue_pressured_share_price_scalar = inputs
        .stock_issue_state
        .as_ref()
        .and_then(|issue_state| issue_state.pressured_support_adjusted_share_price_scalar);
    fields.selected_company_stock_issue_pressured_proceeds = inputs
        .stock_issue_state
        .as_ref()
        .and_then(|issue_state| issue_state.pressured_proceeds);
    fields.selected_company_stock_issue_book_value_per_share_floor_applied = inputs
        .stock_issue_state
        .as_ref()
        .and_then(|issue_state| issue_state.book_value_per_share_floor_applied);
    fields.selected_company_stock_issue_price_to_book_ratio_basis_points = inputs
        .stock_issue_state
        .as_ref()
        .and_then(|issue_state| issue_state.price_to_book_ratio_basis_points);
    fields.selected_company_stock_issue_current_cash = inputs
        .stock_issue_state
        .as_ref()
        .and_then(|issue_state| issue_state.current_cash);
    fields.selected_company_stock_issue_highest_coupon_live_bond_principal = inputs
        .stock_issue_state
        .as_ref()
        .and_then(|issue_state| issue_state.highest_coupon_live_bond_principal);
    fields.selected_company_stock_issue_highest_coupon_live_bond_rate_basis_points = inputs
        .stock_issue_state
        .as_ref()
        .and_then(|issue_state| issue_state.highest_coupon_live_bond_rate_basis_points);
    fields.selected_company_stock_issue_current_issue_age_absolute_counter_delta = inputs
        .stock_issue_state
        .as_ref()
        .and_then(|issue_state| issue_state.current_issue_age_absolute_counter_delta);
    fields.selected_company_stock_issue_current_issue_cooldown_floor = inputs
        .stock_issue_state
        .as_ref()
        .and_then(|issue_state| issue_state.current_issue_cooldown_floor);
    fields.selected_company_stock_issue_minimum_price_to_book_ratio_basis_points = inputs
        .stock_issue_state
        .as_ref()
        .and_then(|issue_state| issue_state.minimum_price_to_book_ratio_basis_points);
    fields.selected_company_stock_issue_passes_share_price_floor = inputs
        .stock_issue_state
        .as_ref()
        .and_then(|issue_state| issue_state.passes_share_price_floor);
    fields.selected_company_stock_issue_passes_proceeds_floor = inputs
        .stock_issue_state
        .as_ref()
        .and_then(|issue_state| issue_state.passes_proceeds_floor);
    fields.selected_company_stock_issue_passes_cash_gate = inputs
        .stock_issue_state
        .as_ref()
        .and_then(|issue_state| issue_state.passes_cash_gate);
    fields.selected_company_stock_issue_passes_issue_cooldown_gate = inputs
        .stock_issue_state
        .as_ref()
        .and_then(|issue_state| issue_state.passes_issue_cooldown_gate);
    fields.selected_company_stock_issue_passes_coupon_price_to_book_gate = inputs
        .stock_issue_state
        .as_ref()
        .and_then(|issue_state| issue_state.passes_coupon_price_to_book_gate);
    fields.selected_company_stock_issue_eligible_for_double_tranche = inputs
        .stock_issue_state
        .as_ref()
        .map(|issue_state| issue_state.eligible_for_double_tranche_issue);
}
