Surveys DATA API (no UI rendering). Wraps the bdsurvey-* edge functions.
Lifecycle: list → fetch → start → record_partial* → submit
(or abandon). The same :idempotency_key SHOULD be carried across start
and submit so retries are safe.
Answer shape: %{question_id: ..., choice_id?: ..., answer_text?: ..., answer_number?: ..., answer_json?: ...} (string or atom keys accepted).
Mirrors the Node SDK surveys.ts. Each function takes a %BilldogEng{}
client and returns {:ok, result} or {:error, %BilldogEng.Error{}}.
Summary
Functions
Mark an in-progress response as abandoned.
Fetch the full configuration for a single survey.
List active surveys eligible for the (optionally identified) user.
Progressively persist a partial set of answers under an in-progress respondent.
Begin a survey response. Returns {:ok, %{"respondent_id" => ...}}.
Submit the final answers, completing the response.
Types
@type client() :: BilldogEng.t()
@type result() :: {:ok, term()} | {:error, BilldogEng.Error.t()}
Functions
Mark an in-progress response as abandoned.
Fetch the full configuration for a single survey.
@spec list( client(), keyword() ) :: {:ok, [map()]} | {:error, BilldogEng.Error.t()}
List active surveys eligible for the (optionally identified) user.
Progressively persist a partial set of answers under an in-progress respondent.
Begin a survey response. Returns {:ok, %{"respondent_id" => ...}}.
Submit the final answers, completing the response.