Skip to content

Commit 18a6acb

Browse files
committed
feat: custom matching criteria
1 parent c4c58bd commit 18a6acb

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

lib/algora/settings/settings.ex

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,21 @@ defmodule Algora.Settings do
103103
[
104104
tech_stack: job.tech_stack,
105105
limit: 50,
106-
users: apply_job_criteria(User, get_job_criteria(job.id))
106+
users:
107+
case get_job_criteria(job.id) do
108+
criteria when map_size(criteria) > 0 ->
109+
apply_job_criteria(User, criteria)
110+
111+
_ ->
112+
from(u in User,
113+
where:
114+
not is_nil(u.hourly_rate_min) or
115+
fragment(
116+
"exists (select 1 from transactions t where t.user_id = ? and t.status = 'succeeded' and t.type = 'credit' and t.linked_transaction_id is not null)",
117+
u.id
118+
)
119+
)
120+
end
107121
]
108122
|> Algora.Cloud.list_top_matches()
109123
|> load_matches_2()

0 commit comments

Comments
 (0)