feat(members): remove guests and transfer their expenses and payments #6

Merged
exler merged 2 commits from feat/guest-member-transfer into main 2026-10-29 08:40:53 +01:00
Collaborator

Summary

  • Add a guest-only Remove action and explicit confirmation page in Members, available to any authenticated group member under the existing permission model.
  • Remove unused guests directly; require a same-group recipient whenever the guest has financial history, even when their balance is zero.
  • Move paid expenses, exact split amounts and incoming/outgoing settlements to the recipient atomically, then remove the guest. Preserve all other members’ balances in every original currency, expense records, attachments and historical activity snapshots.
  • Merge overlapping shares and retain each split mode only when the real editor reproduces the exact cents; otherwise pin explicit amounts to protect rounding on later edits.
  • Block archived groups, foreign/self/invalid recipients and registered-user removal. Enforce CSRF and POST-only mutations; handle stale forms and repeated submissions.
  • Include Polish translations. No schema migrations or new admin roles.

Verification

  • CI on final SHA 343ec052ea6977d84bdfd26c99b4f6dfca9f44a8: test job passed; image publication is intentionally skipped for pull requests.
  • Independently rerun complete suite on final commit: 328 passed, including 33 real Chromium cases (new flow tested at 1280px and 390px).
  • 37 new ORM/test-client cases cover permissions, confirmation, financial-history protection, exact balances across four currencies, split modes and editor re-save, settlements, activity retention and transactional rollback.
  • Django system check, migration drift check, translation compilation, changed-file Ruff lint/format and git diff --check pass.
  • Frozen Tailwind build matches the committed stylesheet; unchanged CSS is not included.
  • Repository-wide Ruff and mypy have pre-existing failures; new guest-removal code adds no new mypy findings. Test suite emits existing missing-staticfiles-directory warnings.
  • First targeted RED recorded on original code. Further regression/mutation checks were run, but implementation did not follow a separate test-first cycle for every later slice; this is not claimed as full strict TDD.

Notes

  • Payments between the merged identities are retained as historical self-payments; they contribute zero net and no suggested repayment.
  • Screenshots use synthetic fixtures and the real Django + Chromium flow. No production data used.
  • Not merged or deployed.

Visual verification

Real Django + Chromium, synthetic fixture users; desktop 1280px and mobile 390px. No production accounts or data.

members-1280

members-1280

members-390

members-390

remove-guest-1280

remove-guest-1280

remove-guest-390

remove-guest-390

## Summary - Add a guest-only Remove action and explicit confirmation page in Members, available to any authenticated group member under the existing permission model. - Remove unused guests directly; require a same-group recipient whenever the guest has financial history, even when their balance is zero. - Move paid expenses, exact split amounts and incoming/outgoing settlements to the recipient atomically, then remove the guest. Preserve all other members’ balances in every original currency, expense records, attachments and historical activity snapshots. - Merge overlapping shares and retain each split mode only when the real editor reproduces the exact cents; otherwise pin explicit amounts to protect rounding on later edits. - Block archived groups, foreign/self/invalid recipients and registered-user removal. Enforce CSRF and POST-only mutations; handle stale forms and repeated submissions. - Include Polish translations. No schema migrations or new admin roles. ## Verification - CI on final SHA `343ec052ea6977d84bdfd26c99b4f6dfca9f44a8`: [test job passed](https://git.marut.network/exler/spendbee/actions/runs/49/jobs/0); image publication is intentionally skipped for pull requests. - Independently rerun complete suite on final commit: **328 passed**, including **33 real Chromium cases** (new flow tested at 1280px and 390px). - 37 new ORM/test-client cases cover permissions, confirmation, financial-history protection, exact balances across four currencies, split modes and editor re-save, settlements, activity retention and transactional rollback. - Django system check, migration drift check, translation compilation, changed-file Ruff lint/format and `git diff --check` pass. - Frozen Tailwind build matches the committed stylesheet; unchanged CSS is not included. - Repository-wide Ruff and mypy have pre-existing failures; new guest-removal code adds no new mypy findings. Test suite emits existing missing-staticfiles-directory warnings. - First targeted RED recorded on original code. Further regression/mutation checks were run, but implementation did not follow a separate test-first cycle for every later slice; this is not claimed as full strict TDD. ## Notes - Payments between the merged identities are retained as historical self-payments; they contribute zero net and no suggested repayment. - Screenshots use synthetic fixtures and the real Django + Chromium flow. No production data used. - Not merged or deployed. ## Visual verification Real Django + Chromium, synthetic fixture users; desktop 1280px and mobile 390px. No production accounts or data. ### members-1280 ![members-1280](https://git.marut.network/attachments/77b3fed8-a162-4f36-b9b6-45942ac8baa4) ### members-390 ![members-390](https://git.marut.network/attachments/37d628bc-916f-46b6-b08f-ffd4a6fc056f) ### remove-guest-1280 ![remove-guest-1280](https://git.marut.network/attachments/eeecc70f-039f-4d83-9200-0b7017cfbdaa) ### remove-guest-390 ![remove-guest-390](https://git.marut.network/attachments/fae0b150-a242-452e-a7db-e49d073e56a4)
Guest rows on the Members page get a Remove action leading to a confirmation
screen. A guest without any expenses, splits or settlements can simply be
removed; otherwise a destination member of the same group is required and
every payer reference, split and settlement moves to it, so per-currency
balances add up and nobody else's balance changes. Overlapping splits are
merged and the split definition is kept only when re-saving it in the
editor reproduces the exact amounts, otherwise the amounts are pinned.
Settlements between the two remain as historical self-payments.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
fix(members): type guest removal form and view without new mypy errors
All checks were successful
Test and push Docker image / test (pull_request) Successful in 2m52s
Test and push Docker image / push (pull_request) Has been skipped
343ec052ea
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
exler merged commit 67098f0df2 into main 2026-10-29 08:40:53 +01:00
exler deleted branch feat/guest-member-transfer 2026-10-29 08:40:53 +01:00
Sign in to join this conversation.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
exler/spendbee!6
No description provided.