Vereinfacht: sync country with finance contact API
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
face48531f
commit
e879958e53
3 changed files with 5 additions and 3 deletions
|
|
@ -25,7 +25,7 @@ When creating an external finance contact, the API only requires:
|
|||
- **Attributes:** `contactType` (e.g. `"person"`), `isExternal: true`
|
||||
- **Relationship:** `club` (club ID from config)
|
||||
|
||||
Additional attributes (firstName, lastName, email, address, zipCode, city) are optional and are sent when present on the member so the contact is filled in. The app does **not** enforce extra required member fields for Vereinfacht; only Settings-based required fields and email apply.
|
||||
Additional attributes (firstName, lastName, email, address, zipCode, city, country) are optional and are sent when present on the member so the contact is filled in. The app does **not** enforce extra required member fields for Vereinfacht; only Settings-based required fields and email apply.
|
||||
|
||||
- **Client:** `Mv.Vereinfacht.Client.create_contact/1` builds the JSON:API body from the member; `Mv.Constants.vereinfacht_required_member_fields/0` is an empty list.
|
||||
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ defmodule Mv.Vereinfacht.Changes.SyncContact do
|
|||
(Mv.Config.vereinfacht_configured?/0).
|
||||
|
||||
Only runs when relevant data changed: on create always; on update only when
|
||||
first_name, last_name, email, street, house_number, postal_code, or city changed,
|
||||
first_name, last_name, email, street, house_number, postal_code, city, or country changed,
|
||||
or when the member has no vereinfacht_contact_id yet (to avoid unnecessary API calls).
|
||||
"""
|
||||
use Ash.Resource.Change
|
||||
|
|
@ -26,7 +26,8 @@ defmodule Mv.Vereinfacht.Changes.SyncContact do
|
|||
:street,
|
||||
:house_number,
|
||||
:postal_code,
|
||||
:city
|
||||
:city,
|
||||
:country
|
||||
]
|
||||
|
||||
@impl true
|
||||
|
|
|
|||
|
|
@ -345,6 +345,7 @@ defmodule Mv.Vereinfacht.Client do
|
|||
|> put_attr("address", address)
|
||||
|> put_attr("zipCode", member |> Map.get(:postal_code))
|
||||
|> put_attr("city", member |> Map.get(:city))
|
||||
|> put_attr("country", member |> Map.get(:country))
|
||||
|> Map.put("contactType", "person")
|
||||
|> Map.put("isExternal", true)
|
||||
|> Enum.reject(fn {_k, v} -> is_nil(v) end)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue