Deleting a split event failed with a server error as soon as it had an
expense or a payment, from the event page and from the API alike
(DELETE /api/splits/events/{id}/). Deleting the event cascades to its
participants, and the expenses, shares and payments pointing at them
used on_delete=PROTECT, which refuses even when those rows are being
deleted with the same event. Only empty events could be removed, and an
admin couldn't delete a user who organized one.
- The participant foreign keys on expenses, shares and payments now use
RESTRICT. A participant with expenses or payments still can't be
deleted on their own (the people screen and the API already check
this first), but they now go along with their event. The migration
only changes Django's state; the database is untouched.
- Deleting an event also removes its attachments' files, as deleting an
expense or a payment already does, so receipts aren't left behind in
the private media folder.
Add /api/splits/ endpoints for events, participants, expenses and payments,
plus an event summary (balances and settle-up) and leave action. They share
the web UI's access rules and share calculation. MCP reaches them through
search_api/call_api, and its instructions now point to them.