partition by org_id and add auth
All checks were successful
Build and Publish / build-release (push) Successful in 3m7s

This commit is contained in:
2026-05-15 10:08:54 -05:00
parent a0b5e0c0b3
commit 4519f797fd
26 changed files with 687 additions and 112 deletions

View File

@@ -2,6 +2,18 @@ defmodule CustomerService.Lead.Queries do
alias CustomerService.Projections.QuickLead
alias CustomerService.Repo
def list_by_org(org_id, params \\ %{}) when is_binary(org_id) do
params = Map.put(params, :org_id, org_id)
Flop.validate_and_run(QuickLead, params, for: QuickLead)
end
def get_by_org(org_id, lead_id) when is_binary(org_id) and is_binary(lead_id) do
case Repo.get_by(QuickLead, org_id: org_id, lead_id: lead_id) do
nil -> {:error, :not_found}
lead -> {:ok, lead}
end
end
def list_leads(params \\ %{}) do
Flop.validate_and_run(QuickLead, params, for: QuickLead)
end