Breezex.People (breezex v0.1.0) View Source
Module implementing the Breeze people API.
Link to this section Summary
Functions
Add a person to Breeze.
Delete a person by ID
Returns all names and IDs in Breeze
Returns a list of people, paginated based on options, and filtered based on filter.
List all profile fields that have been configured in Breeze.
Show a person by ID
Update a person.
Link to this section Functions
Specs
add(map(), String.t(), String.t(), map() | nil) :: Breezex.Client.client_response()
Add a person to Breeze.
First and last names are required. Other fields can be included in a map where field IDs are keys.
Specs
Specs
delete(map(), String.t()) :: Breezex.Client.client_response()
Delete a person by ID
Specs
Specs
list(map()) :: Breezex.Client.client_response()
Returns all names and IDs in Breeze
Specs
list(map(), map(), map()) :: Breezex.Client.client_response()
Returns a list of people, paginated based on options, and filtered based on filter.
Options is a map of shape
%{
details: 1,
limit: 50,
offset: 0
}
When details is 1 (default), just get names. When 0, get all data (slower).
Limit and offset are for pagination. Both default to 0. With no limit or 0, all people are returned.
Filter is a map. The keys are profile field IDs. The values are the values to search for.
Specs
Specs
Specs
list_profile_fields(map()) :: Breezex.Client.client_response()
List all profile fields that have been configured in Breeze.
The most useful thing in the output is going to be the field_id (since it's used in querying and updating people) and name.
With those two, you can find a field and query on it.
Specs
Specs
Show a person by ID
Specs
Specs
Update a person.
The person's ID is required. For the params, pass in a list of structs. Most structs should have
the shape %{field_id: field_id, field_type: field_type, response: new_value}. All values are strings.
Field type options are:
- text
- radio -- used for both multiple choice and dropdown
- checkbox
- date -- formatted
MM/DD/YYYY - textarea
- birthdate -- format
MM/DD/YYYY*
Special structs: Email:
%{
field_id: "",
field_type: "email",
response: true,
details: %{address: ""}
}Phones:
%{
field_id: "",
field_type: "phone",
response: true,
details: %{phone_mobile: ""} # or `phone_home` or `phone_work`
}Address:
%{
field_id: "",
field_type: "address",
response: true,
details: %{
street_addres: "",
city: "",
state: "", # 2-letter abbreviation
zip: ""
}
}Family role:
%{
field_id: "",
field_type: "family_role",
response: undefined,
details: [
person_id: 123,
role_id: 1
]
}Note: role_id is numeric and can be 1 (Unassigned), 2 (Child), 3 (Adult), 4 (Head of Household), or 5 (Spouse)