Skip to content

fix: allow assigning a bed to a member who already holds a lease#31

Merged
fordprefect480 merged 1 commit into
mainfrom
claude/sweet-mayer-6abdd0
Jun 25, 2026
Merged

fix: allow assigning a bed to a member who already holds a lease#31
fordprefect480 merged 1 commit into
mainfrom
claude/sweet-mayer-6abdd0

Conversation

@fordprefect480

Copy link
Copy Markdown
Owner

What

Removed the per-member guard in AssignBedEndpoint that rejected assigning a bed to any member already holding a non-released lease ("That member already holds a leased bed.").

Why

Members are allowed to hold more than one leased bed at a time, but the admin "assign bed" flow (e.g. from the pending applications card) blocked it. The guard was the only thing enforcing a one-bed-per-member rule; there is no DB constraint behind it.

Notes for reviewers

  • Bed-level double-booking is still prevented by IsBedOccupiedAsync (checks the bed, not the member), which is untouched.
  • The member-facing status (GetMyStatusAsync) and profile card already return/render a list of leases, so no downstream code assumed a single lease.
  • ApplyForBedEndpoint still blocks a new self-application while an AwaitingPayment lease exists — that's a separate rule (no stacking unpaid applications) and was intentionally left in place.

Members are permitted to hold more than one leased bed, but the admin
assign endpoint rejected anyone with an existing non-released lease
("That member already holds a leased bed."). Removed the per-member
guard. Bed-level double-booking is still prevented by IsBedOccupiedAsync,
and the member status/card path already renders a list of leases.
@fordprefect480 fordprefect480 merged commit d5a420f into main Jun 25, 2026
2 checks passed
@fordprefect480 fordprefect480 deleted the claude/sweet-mayer-6abdd0 branch June 25, 2026 23:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant