CREATE OR REPLACE FUNCTION get_ropidgtfs_stops_by_asw(aswnodeid INT, platformcode varchar)
RETURNS TEXT AS $$
DECLARE
    stop_ids TEXT;
BEGIN
    SELECT STRING_AGG(stop_id::TEXT, ',') INTO stop_ids
    FROM ropidgtfs_stops
    WHERE asw_node_id = aswnodeid
      AND platform_code = platformcode;
    
    RETURN stop_ids;
END;
$$ LANGUAGE plpgsql;