from .parser import parse_region_id
from .db_utils import get_recipients_by_features
from app import Systems

async def get_recipients_from_data(data: dict, flask_app) -> list[int]:
    system_names = [sys.system_name for sys in Systems.query.all()]
    parsed = parse_message(data, system_names)
    return get_recipients_by_features(parsed, flask_app)
