From e984ce910c66b7022e3e7347177323fb863549f4 Mon Sep 17 00:00:00 2001 From: Jannis Braun <151788261+TheZwiss@users.noreply.github.com> Date: Tue, 28 Apr 2026 19:50:05 +0200 Subject: [PATCH] =?UTF-8?q?refactor(shared):=20rename=20PatchInviteRequest?= =?UTF-8?q?=20=E2=86=92=20UpdateInviteRequest=20+=20JSDoc?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Matches existing codebase convention (UpdateChannelRequest, UpdateSpaceRequest, etc.). Adds JSDoc on InviteStatus and InviteLinkSummary.url / createdByUsername fields with server-side semantics. Plan updated for downstream task naming consistency. --- packages/shared/src/types.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/shared/src/types.ts b/packages/shared/src/types.ts index 5be15488..e392a576 100644 --- a/packages/shared/src/types.ts +++ b/packages/shared/src/types.ts @@ -1135,6 +1135,7 @@ export interface ApprovalRequest { // ─── Invite Links ────────────────────────────────────────────────────────── +/** Derived status of an invite link. Active = usable; expired/exhausted/revoked = archived. */ export type InviteStatus = 'active' | 'expired' | 'exhausted' | 'revoked'; export interface InviteLinkSummary { @@ -1147,8 +1148,10 @@ export interface InviteLinkSummary { expiresAt: number | null; revokedAt: number | null; createdBy: string; + /** Joined from users.username at read time. `'Deleted User'` when the creator's account is tombstoned. `null` only if the FK is somehow unresolvable (defensive). */ createdByUsername: string | null; createdAt: number; + /** Server-constructed full URL, e.g. `https://host.example/register?invite=`. Clients must NOT assemble this themselves. */ url: string; } @@ -1167,7 +1170,7 @@ export interface CreateInviteRequest { expiresAt: number | null; } -export interface PatchInviteRequest { +export interface UpdateInviteRequest { name?: string; maxUses?: number | null; expiresAt?: number | null;