implement registration-confirmation-email

- Add qrbill and pillow dependencies for Swiss QR-bill PNG generation
- Add _STRINGS_DE / _STRINGS_EN bilingual string tables to AdminNotifier
- Add _generate_qr_bill_png(): Swiss QR code with cross overlay (PNG bytes)
- Add _build_parent_html(): HTML confirmation with inline cid:qrbill image
- Add _build_parent_text(): plain-text fallback with IBAN in full
- Add notify_parent(): multipart/mixed MIME email to parent on completion
- Persist metadata.language in _build_record() in json_store.py
- Wire notify_parent() into src/agent/core.py and chat_app.py completion events
- Add 9 tests for notify_parent, _generate_qr_bill_png, language fallback
- Update tasks.md: tasks 1–5 complete; task 6 (smoke test) remains manual

112 tests passing.

https://claude.ai/code/session_01LjjK7RjKVnC8bETtccfgna
This commit is contained in:
Claude
2026-02-22 21:23:32 +00:00
parent 1632433b6a
commit b2e04fa07b
9 changed files with 756 additions and 19 deletions
+17
View File
@@ -157,3 +157,20 @@ class TestRegistrationVersioning:
store.save_registration(fresh_state)
registrations = store.list_registrations()
assert len(registrations) == 1
def test_save_registration_persists_language(self, store, fresh_state, complete_registration):
fresh_state.registration = complete_registration
fresh_state.completed = True
fresh_state.language = "en"
store.save_registration(fresh_state)
current = store.get_current_registration(fresh_state.parent_email)
assert current is not None
assert current["metadata"]["language"] == "en"
def test_save_registration_defaults_language_to_de(self, store, fresh_state, complete_registration):
fresh_state.registration = complete_registration
fresh_state.completed = True
# language defaults to "de" in ConversationState
store.save_registration(fresh_state)
current = store.get_current_registration(fresh_state.parent_email)
assert current["metadata"]["language"] == "de"