PR #309 · pramaan-io/pramaan-app · merged 2026-06-12
When the wrong role walks in, the firm breaks.
Team invitations
A generic toast hides whether the invite was a duplicate, a rate-limit, or a rejection — and a raw role string lets Clerk assign the wrong access.
The fix — Map roles both ways; turn Clerk's errors into words the invite sheet can show.
sequenceDiagram autonumber participant ui as Invite sheet participant server as Server (translator) participant clerk as Clerk org ui->>server: invite with PRAMAAN role server->>server: map to Clerk role (outbound) server->>clerk: createInvitation(org:firm_*) clerk-->>server: result or Clerk error server->>server: convert error to InviteApiError server->>ui: structured error + localized copy