def get_required_availability_type_modules(scenario_id, c):
    """
    :param scenario_id: user-specified scenario ID
    :param c: database cursor
    :return: List of the required capacity type submodules

    Get the required availability type submodules based on the database inputs
    for the specified scenario_id. Required modules are the unique set of
    generator availability types in the scenario's portfolio. Get the list
    based on the project_availability_scenario_id of the scenario_id.

    This list will be used to know for which availability type submodules we
    should validate inputs, get inputs from database , or save results to
    database.

    Note: once we have determined the dynamic components, this information
    will also be stored in the DynamicComponents class object.
    """

    project_portfolio_scenario_id = c.execute(
        """SELECT project_portfolio_scenario_id 
        FROM scenarios 
        WHERE scenario_id = {}""".format(
            scenario_id
        )
    ).fetchone()[0]

    project_availability_scenario_id = c.execute(
        """SELECT project_availability_scenario_id 
        FROM scenarios 
        WHERE scenario_id = {}""".format(
            scenario_id
        )
    ).fetchone()[0]

    required_availability_type_modules = [
        p[0]
        for p in c.execute(
            """SELECT DISTINCT availability_type 
            FROM 
            (SELECT project FROM inputs_project_portfolios
            WHERE project_portfolio_scenario_id = {}) as prj_tbl
            INNER JOIN 
            (SELECT project, availability_type
            FROM inputs_project_availability
            WHERE project_availability_scenario_id = {}) as av_type_tbl
            USING (project)""".format(
                project_portfolio_scenario_id, project_availability_scenario_id
            )
        ).fetchall()
    ]

    return required_availability_type_modules