Skip to content

S13: Remove a berth tenant #37

Description

@xishell

Persona

Harbor master + departing or removed berth tenant

User outcome

As a harbor master, I remove a tenant from a berth so the berth becomes available again — for example when a tenant leaves the harbor, is suspended, or is reassigned after a dispute. The removed tenant gets a notification so they know the change happened.

The backend already supports the removal (DELETE /api/berths/{berth_id}/assignment), but no UI exposes it, the removed user isn't notified, and role state isn't reconciled. This story closes those gaps.

Out of scope: tenant self-departure (S10 covers booking + self-service availability windows; tenant-initiated departure could be a future story).

Acceptance Criteria

  • Harbor master sees a "Remove tenant" action on assigned berths in the berth detail panel
  • Confirm gate on the action ("Remove $email from berth X?") prevents accidental removal
  • On confirm, the assignment row is deleted and the berth status returns to free
  • Removed tenant receives a transactional email ("Your berth assignment at $harbor has ended")
  • If the removed user has no remaining berth assignments, their role downgrades from spot-owner to visitor
  • Removal emits an audit event (assignment_removed) visible in the activity log
  • Tests cover: happy path, role downgrade, role retention when user has another berth, audit event written

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    backendServer, API, databasefrontendWeb dashboard / UIpersona:berth-tenantBoat owner with long-term berth assignmentpersona:harbor-masterStaff member responsible for harbor operationstheme:user-facingDashboard, mobile UX, auth flows

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions