Skip to content

Commit 9475171

Browse files
committed
add new settings
1 parent d56a52f commit 9475171

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

lib/algora/settings/settings.ex

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,24 @@ defmodule Algora.Settings do
355355
set("pipeline_candidates:#{org_handle}", %{"ids" => ids})
356356
end
357357

358+
@doc """
359+
Gets portfolio company IDs for a given host handle.
360+
Returns a list of organization IDs or an empty list if not set.
361+
"""
362+
def get_portfolio_companies(host_handle) when is_binary(host_handle) do
363+
case get("portfolio_companies:#{host_handle}") do
364+
%{"org_ids" => org_ids} when is_list(org_ids) -> org_ids
365+
_ -> []
366+
end
367+
end
368+
369+
@doc """
370+
Sets portfolio company IDs for a given host handle.
371+
"""
372+
def set_portfolio_companies(host_handle, org_ids) when is_binary(host_handle) and is_list(org_ids) do
373+
set("portfolio_companies:#{host_handle}", %{"org_ids" => org_ids})
374+
end
375+
358376
defp format_timestamp(datetime) do
359377
datetime
360378
|> DateTime.to_string()

0 commit comments

Comments
 (0)