Owner settings: add a real delete for Mitarbeiter (barbers)
Test backoffice (smb-crm) / test (push) Successful in 1m40s

Rename + active-toggle already existed (this session, earlier commit)
-- this adds a genuine, permanent delete alongside them, guarded by a
confirm() prompt that points to the "Aktiv" checkbox as the reversible
alternative for someone just temporarily off. Existing bookings against
a deleted resource are left as-is (no FK in this schema, matching its
existing convention) -- the owner agenda already falls back to the raw
resource_id for a booking whose resource no longer resolves, same as
it does today for a deactivated one.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
2026-09-12 03:13:14 +02:00
parent d66511156a
commit 68430a5c0c
5 changed files with 84 additions and 1 deletions
+15
View File
@@ -168,6 +168,21 @@ def update_resource(resource_id):
return _redirect()
@bp.post("/resources/<resource_id>/delete")
@login_required
def delete_resource(resource_id):
"""Permanently removes a barber (#21 follow-up). Past bookings against
them are untouched -- see booking_db.delete_resource's docstring -- so
this is a real delete, not just deactivation; the "Aktiv" checkbox on the
resource's own edit form is the softer, reversible alternative for
someone temporarily off (on leave, etc.)."""
client_id = session["client_id"]
deleted = bdb.delete_resource(client_id, resource_id)
if deleted is None:
return _redirect(error="not_found")
return _redirect()
@bp.post("/resources/<resource_id>/hours")
@login_required
def update_resource_hours(resource_id):