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
@@ -166,6 +166,23 @@ def test_owner_cannot_update_another_tenants_resource(client):
assert bdb.get_resource(CLIENT_B, resource_b["resource_id"])["max_advance_days"] != 1
def test_owner_can_delete_a_resource(client):
resource, service = _setup(CLIENT_A)
_login(client, CLIENT_A)
resp = client.post(f"/owner/settings/resources/{resource['resource_id']}/delete")
assert "error" not in resp.headers["Location"]
assert bdb.get_resource(CLIENT_A, resource["resource_id"]) is None
def test_owner_cannot_delete_another_tenants_resource(client):
resource_b, service_b = _setup(CLIENT_B)
_setup(CLIENT_A)
_login(client, CLIENT_A)
resp = client.post(f"/owner/settings/resources/{resource_b['resource_id']}/delete")
assert "error=not_found" in resp.headers["Location"]
assert bdb.get_resource(CLIENT_B, resource_b["resource_id"]) is not None
# ---- locations / resources self-service ----
def test_owner_can_create_location(client):