Add the delete group endpoint, Owner only #51
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/delete-group-endpoint"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Implements task 77:
DELETE /api/groups/{groupId}, Owner only, 204 on success.fk_places_groups_group_id,fk_group_memberships_groups_group_id), including a multi-member group with a pending invitee.mainand every open PR immediately before push —feat/update-place-endpointtook 0048, no collision).docs/data-model.md's "may the personal group be deleted?" moved from open questions to answered, and invariant 1 updated to match.dotnet format --verify-no-changes, full test suite (Debug and Release build) and the group-scoped authorisation safety net all pass locally under the pinned SDK.Verdict: mergeable
Verified with real rows: cascade to places and memberships, atomicity (single
DELETEstatement carries the cascade, no partial state possible), the personal-group refusal happening before any deletion (removing theIsPersonalcheck reddens bothDeleteAsync_APersonalGroup_LeavesItInPlaceAndReturnsRefusedPersonalGroupandDeleteGroup_APersonalGroup_RespondsWith409AndLeavesItInPlace), Owner/Editor/Viewer/non-member/nonexistent-group authorisation, and that deleting one group leaves another's places and memberships untouched (not covered by a checked-in test, but I added one locally and it passes — see below). ADR-0047 number is genuinely free, index row is in numeric order,docs/data-model.mdinvariant 1 and the open-questions section are both updated accurately and match what the code does. Build and full test suite are clean under the pinned SDK.One gap worth closing before or shortly after merge: there's no test proving the cascade is bounded to the deleted group — every existing test deletes the only group in its scenario. Add a case with two groups (each with a place, and ideally a second member) where deleting one leaves the other's places, memberships and row completely intact. This is the one property that, if it silently regressed, destroys a different user's data.
Verdict: mergeable
Independently confirmed: widened
DeleteGroupByIdtoWHERE id = @Id OR personal_for_user_id IS NULLand the new boundary test reddened on the surviving group's row ((object)await SelectGroupAsync(survivingGroupId) should not be null but was); reverted, and the fullDeleteGroupEndpointTestsclass passes clean again. The test asserts the survivor row-by-row — group presence, place'sgroup_id/name/latitude/longitude, both memberships'roleandstatusindividually, not a count. Delta is scoped to the test file only, nothing else in the diff.