Vereinfacht API: filter-based contact lookup, no extra required fields, country sync, and docs #459

Merged
moritz merged 5 commits from feat/vereinfacht_api into main 2026-03-04 21:15:07 +01:00
Owner

Description of the implemented changes

The changes were:

  • Bugfixing
  • New Feature
  • Breaking Change
  • Refactoring

Vereinfacht API: filter-based contact lookup, no extra required fields, country sync, and docs


What has been changed?

1. Vereinfacht API: use filter for contact lookup, drop extra required fields (96ca857e)

  • Client (lib/mv/vereinfacht/client.ex): find_contact_by_email/1 now uses a single GET with filter[isExternal]=true and filter[email]=... instead of paginating; removed pagination helpers.
  • Constants (lib/mv/constants.ex): @vereinfacht_required_member_fields set to [] (API only needs contactType when creating external contacts).
  • Tests (test/mv/vereinfacht/client_test.exs): Added test for find_contact_by_email/1 when Vereinfacht is not configured.

2. Remove Vereinfacht-required logic from settings and member validation (0ac39c64)

  • Member resource (lib/membership/member.ex): Required-fields validation uses only email + settings; no Vereinfacht-based required fields.
  • Member field settings (lib/mv_web/live/member_field_live/form_component.ex, index_component.ex): Required flag comes only from email + settings; removed vereinfacht_required_field? assign and “Required for Vereinfacht integration” UI.
  • Member form (lib/mv_web/live/member_live/form.ex): Required map built from email + settings only.
  • Gettext (de/en/default): Removed the obsolete “Required for Vereinfacht integration and cannot be disabled” string.

3. Docs: Vereinfacht API integration and guidelines (fbc3fc2a)

  • CODE_GUIDELINES.md: Documented lib/mv/vereinfacht/ in project structure; noted that Vereinfacht does not add extra required member fields; added “Related documents” link to docs/vereinfacht-api.md.
  • docs/vereinfacht-api.md (new): Describes filter API, minimal create payload, and that no extra required fields are enforced.
  • docs/feature-roadmap.md: Marked member–finance-contact sync as done and linked to docs/vereinfacht-api.md.

4. Vereinfacht: sync country with finance contact API (9f169b98)

  • Client (lib/mv/vereinfacht/client.ex): member_to_attributes now includes country for create/update.
  • SyncContact (lib/mv/vereinfacht/changes/sync_contact.ex): :country added to @synced_attributes so country changes trigger sync.
  • docs/vereinfacht-api.md: Optional attributes list updated to include country.

Definition of Done

Code Quality

  • No new technical depths
  • Linting passed
  • Documentation is added where needed (vereinfacht-api.md, CODE_GUIDELINES, comments)

Accessibility

  • New elements are properly defined with html-tags (no new UI elements; only logic/docs/sync changes)
  • Colour contrast follows WCAG criteria
  • Aria labels are added when needed
  • Everything is accessible by keyboard
  • Tab-Order is comprehensible
  • All interactive elements have a visible focus

Testing

  • Tests for new code are written (find_contact_by_email when not configured)
  • All tests pass
  • axe-core dev tools show no critical or major issues (N/A for backend/API changes)

Additional Notes

  • Aligns with the Vereinfacht API behaviour: filter for existing contacts and minimal create payload (contactType + isExternal + club). No app-side required fields are enforced for Vereinfacht.
## Description of the implemented changes The changes were: - [ ] Bugfixing - [x] New Feature - [ ] Breaking Change - [x] Refactoring **Vereinfacht API: filter-based contact lookup, no extra required fields, country sync, and docs** --- ## What has been changed? **1. Vereinfacht API: use filter for contact lookup, drop extra required fields** (`96ca857e`) - **Client** (`lib/mv/vereinfacht/client.ex`): `find_contact_by_email/1` now uses a single GET with `filter[isExternal]=true` and `filter[email]=...` instead of paginating; removed pagination helpers. - **Constants** (`lib/mv/constants.ex`): `@vereinfacht_required_member_fields` set to `[]` (API only needs `contactType` when creating external contacts). - **Tests** (`test/mv/vereinfacht/client_test.exs`): Added test for `find_contact_by_email/1` when Vereinfacht is not configured. **2. Remove Vereinfacht-required logic from settings and member validation** (`0ac39c64`) - **Member resource** (`lib/membership/member.ex`): Required-fields validation uses only email + settings; no Vereinfacht-based required fields. - **Member field settings** (`lib/mv_web/live/member_field_live/form_component.ex`, `index_component.ex`): Required flag comes only from email + settings; removed `vereinfacht_required_field?` assign and “Required for Vereinfacht integration” UI. - **Member form** (`lib/mv_web/live/member_live/form.ex`): Required map built from email + settings only. - **Gettext** (de/en/default): Removed the obsolete “Required for Vereinfacht integration and cannot be disabled” string. **3. Docs: Vereinfacht API integration and guidelines** (`fbc3fc2a`) - **CODE_GUIDELINES.md**: Documented `lib/mv/vereinfacht/` in project structure; noted that Vereinfacht does not add extra required member fields; added “Related documents” link to `docs/vereinfacht-api.md`. - **docs/vereinfacht-api.md** (new): Describes filter API, minimal create payload, and that no extra required fields are enforced. - **docs/feature-roadmap.md**: Marked member–finance-contact sync as done and linked to `docs/vereinfacht-api.md`. **4. Vereinfacht: sync country with finance contact API** (`9f169b98`) - **Client** (`lib/mv/vereinfacht/client.ex`): `member_to_attributes` now includes `country` for create/update. - **SyncContact** (`lib/mv/vereinfacht/changes/sync_contact.ex`): `:country` added to `@synced_attributes` so country changes trigger sync. - **docs/vereinfacht-api.md**: Optional attributes list updated to include `country`. --- ## Definition of Done ### Code Quality - [x] No new technical depths - [x] Linting passed - [x] Documentation is added where needed (vereinfacht-api.md, CODE_GUIDELINES, comments) ### Accessibility - [x] New elements are properly defined with html-tags *(no new UI elements; only logic/docs/sync changes)* - [x] Colour contrast follows WCAG criteria - [x] Aria labels are added when needed - [x] Everything is accessible by keyboard - [x] Tab-Order is comprehensible - [x] All interactive elements have a visible focus ### Testing - [x] Tests for new code are written (find_contact_by_email when not configured) - [x] All tests pass - [x] axe-core dev tools show no critical or major issues *(N/A for backend/API changes)* --- ## Additional Notes - Aligns with the Vereinfacht API behaviour: filter for existing contacts and minimal create payload (`contactType` + `isExternal` + club). No app-side required fields are enforced for Vereinfacht.
moritz added 4 commits 2026-03-04 20:25:23 +01:00
- find_contact_by_email uses GET with filter[isExternal]=true and filter[email]
- vereinfacht_required_member_fields is now empty (API accepts minimal payload)
- Member field settings: required only from email + settings (no API override)
- Member resource validation: required fields from settings only
- Gettext: remove obsolete 'Required for Vereinfacht integration' string
- CODE_GUIDELINES: add vereinfacht/ to project structure, required-fields note, link to vereinfacht-api
- docs/vereinfacht-api.md: filter API, minimal create payload, no extra required fields
- feature-roadmap: member-contact sync implemented, link to doc
Vereinfacht: sync country with finance contact API
All checks were successful
continuous-integration/drone/push Build is passing
e879958e53
moritz force-pushed feat/vereinfacht_api from e879958e53 to 9f169b9835 2026-03-04 20:26:19 +01:00 Compare
moritz self-assigned this 2026-03-04 20:29:37 +01:00
moritz added this to the Sprint 13: 19.02-26.02 project 2026-03-04 20:29:39 +01:00
moritz added 1 commit 2026-03-04 20:56:17 +01:00
Vereinfacht client: email normalization, multi-match warning, Bypass tests, doc note
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/promote/production Build is passing
01b9ebd74b
- Normalize email (trim + downcase) before filter lookup
- Log warning when API returns multiple contacts for same email
- Add Bypass tests for find_contact_by_email (query params, empty/single response parsing)
- Document vereinfacht_required_field? as legacy/unused in vereinfacht-api.md
- Add bypass dependency (dev+test) for HTTP stubbing
moritz changed title from WIP: Vereinfacht API: filter-based contact lookup, no extra required fields, country sync, and docs to Vereinfacht API: filter-based contact lookup, no extra required fields, country sync, and docs 2026-03-04 21:01:23 +01:00
moritz merged commit d914f5aa22 into main 2026-03-04 21:15:07 +01:00
moritz deleted branch feat/vereinfacht_api 2026-03-04 21:15:08 +01:00
Sign in to join this conversation.
No description provided.