feat(api): add MS21 user fields for admin, local auth, and invitations
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -227,6 +227,14 @@ model User {
|
|||||||
createdAt DateTime @default(now()) @map("created_at") @db.Timestamptz
|
createdAt DateTime @default(now()) @map("created_at") @db.Timestamptz
|
||||||
updatedAt DateTime @updatedAt @map("updated_at") @db.Timestamptz
|
updatedAt DateTime @updatedAt @map("updated_at") @db.Timestamptz
|
||||||
|
|
||||||
|
// MS21: Admin, local auth, and invitation fields
|
||||||
|
deactivatedAt DateTime? @map("deactivated_at") @db.Timestamptz
|
||||||
|
isLocalAuth Boolean @default(false) @map("is_local_auth")
|
||||||
|
passwordHash String? @map("password_hash")
|
||||||
|
invitedBy String? @map("invited_by") @db.Uuid
|
||||||
|
invitationToken String? @unique @map("invitation_token")
|
||||||
|
invitedAt DateTime? @map("invited_at") @db.Timestamptz
|
||||||
|
|
||||||
// Relations
|
// Relations
|
||||||
ownedWorkspaces Workspace[] @relation("WorkspaceOwner")
|
ownedWorkspaces Workspace[] @relation("WorkspaceOwner")
|
||||||
workspaceMemberships WorkspaceMember[]
|
workspaceMemberships WorkspaceMember[]
|
||||||
|
|||||||
@@ -39,6 +39,12 @@ const mockMembers: WorkspaceMemberWithUser[] = [
|
|||||||
image: null,
|
image: null,
|
||||||
authProviderId: null,
|
authProviderId: null,
|
||||||
preferences: {},
|
preferences: {},
|
||||||
|
deactivatedAt: null,
|
||||||
|
isLocalAuth: false,
|
||||||
|
passwordHash: null,
|
||||||
|
invitedBy: null,
|
||||||
|
invitationToken: null,
|
||||||
|
invitedAt: null,
|
||||||
createdAt: new Date("2024-01-15"),
|
createdAt: new Date("2024-01-15"),
|
||||||
updatedAt: new Date("2024-01-15"),
|
updatedAt: new Date("2024-01-15"),
|
||||||
},
|
},
|
||||||
@@ -56,6 +62,12 @@ const mockMembers: WorkspaceMemberWithUser[] = [
|
|||||||
image: null,
|
image: null,
|
||||||
authProviderId: null,
|
authProviderId: null,
|
||||||
preferences: {},
|
preferences: {},
|
||||||
|
deactivatedAt: null,
|
||||||
|
isLocalAuth: false,
|
||||||
|
passwordHash: null,
|
||||||
|
invitedBy: null,
|
||||||
|
invitationToken: null,
|
||||||
|
invitedAt: null,
|
||||||
createdAt: new Date("2024-01-16"),
|
createdAt: new Date("2024-01-16"),
|
||||||
updatedAt: new Date("2024-01-16"),
|
updatedAt: new Date("2024-01-16"),
|
||||||
},
|
},
|
||||||
@@ -73,6 +85,12 @@ const mockMembers: WorkspaceMemberWithUser[] = [
|
|||||||
image: null,
|
image: null,
|
||||||
authProviderId: null,
|
authProviderId: null,
|
||||||
preferences: {},
|
preferences: {},
|
||||||
|
deactivatedAt: null,
|
||||||
|
isLocalAuth: false,
|
||||||
|
passwordHash: null,
|
||||||
|
invitedBy: null,
|
||||||
|
invitationToken: null,
|
||||||
|
invitedAt: null,
|
||||||
createdAt: new Date("2024-01-17"),
|
createdAt: new Date("2024-01-17"),
|
||||||
updatedAt: new Date("2024-01-17"),
|
updatedAt: new Date("2024-01-17"),
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -21,6 +21,12 @@ const mockAvailableUsers: User[] = [
|
|||||||
image: null,
|
image: null,
|
||||||
authProviderId: null,
|
authProviderId: null,
|
||||||
preferences: {},
|
preferences: {},
|
||||||
|
deactivatedAt: null,
|
||||||
|
isLocalAuth: false,
|
||||||
|
passwordHash: null,
|
||||||
|
invitedBy: null,
|
||||||
|
invitationToken: null,
|
||||||
|
invitedAt: null,
|
||||||
createdAt: new Date("2026-01-17"),
|
createdAt: new Date("2026-01-17"),
|
||||||
updatedAt: new Date("2026-01-17"),
|
updatedAt: new Date("2026-01-17"),
|
||||||
},
|
},
|
||||||
@@ -32,6 +38,12 @@ const mockAvailableUsers: User[] = [
|
|||||||
image: null,
|
image: null,
|
||||||
authProviderId: null,
|
authProviderId: null,
|
||||||
preferences: {},
|
preferences: {},
|
||||||
|
deactivatedAt: null,
|
||||||
|
isLocalAuth: false,
|
||||||
|
passwordHash: null,
|
||||||
|
invitedBy: null,
|
||||||
|
invitationToken: null,
|
||||||
|
invitedAt: null,
|
||||||
createdAt: new Date("2026-01-18"),
|
createdAt: new Date("2026-01-18"),
|
||||||
updatedAt: new Date("2026-01-18"),
|
updatedAt: new Date("2026-01-18"),
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -20,6 +20,12 @@ const makeMember = (
|
|||||||
image: null,
|
image: null,
|
||||||
authProviderId: `auth-${overrides.userId}`,
|
authProviderId: `auth-${overrides.userId}`,
|
||||||
preferences: {},
|
preferences: {},
|
||||||
|
deactivatedAt: null,
|
||||||
|
isLocalAuth: false,
|
||||||
|
passwordHash: null,
|
||||||
|
invitedBy: null,
|
||||||
|
invitationToken: null,
|
||||||
|
invitedAt: null,
|
||||||
createdAt: new Date("2025-01-01"),
|
createdAt: new Date("2025-01-01"),
|
||||||
updatedAt: new Date("2025-01-01"),
|
updatedAt: new Date("2025-01-01"),
|
||||||
},
|
},
|
||||||
@@ -62,6 +68,12 @@ describe("MemberList", (): void => {
|
|||||||
image: null,
|
image: null,
|
||||||
authProviderId: "auth-2",
|
authProviderId: "auth-2",
|
||||||
preferences: {},
|
preferences: {},
|
||||||
|
deactivatedAt: null,
|
||||||
|
isLocalAuth: false,
|
||||||
|
passwordHash: null,
|
||||||
|
invitedBy: null,
|
||||||
|
invitationToken: null,
|
||||||
|
invitedAt: null,
|
||||||
createdAt: new Date("2025-01-01"),
|
createdAt: new Date("2025-01-01"),
|
||||||
updatedAt: new Date("2025-01-01"),
|
updatedAt: new Date("2025-01-01"),
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -178,6 +178,12 @@ export const mockTeamWithMembers: TeamWithMembers = {
|
|||||||
image: null,
|
image: null,
|
||||||
authProviderId: null,
|
authProviderId: null,
|
||||||
preferences: {},
|
preferences: {},
|
||||||
|
deactivatedAt: null,
|
||||||
|
isLocalAuth: false,
|
||||||
|
passwordHash: null,
|
||||||
|
invitedBy: null,
|
||||||
|
invitationToken: null,
|
||||||
|
invitedAt: null,
|
||||||
createdAt: new Date("2026-01-15"),
|
createdAt: new Date("2026-01-15"),
|
||||||
updatedAt: new Date("2026-01-15"),
|
updatedAt: new Date("2026-01-15"),
|
||||||
},
|
},
|
||||||
@@ -195,6 +201,12 @@ export const mockTeamWithMembers: TeamWithMembers = {
|
|||||||
image: null,
|
image: null,
|
||||||
authProviderId: null,
|
authProviderId: null,
|
||||||
preferences: {},
|
preferences: {},
|
||||||
|
deactivatedAt: null,
|
||||||
|
isLocalAuth: false,
|
||||||
|
passwordHash: null,
|
||||||
|
invitedBy: null,
|
||||||
|
invitationToken: null,
|
||||||
|
invitedAt: null,
|
||||||
createdAt: new Date("2026-01-16"),
|
createdAt: new Date("2026-01-16"),
|
||||||
updatedAt: new Date("2026-01-16"),
|
updatedAt: new Date("2026-01-16"),
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -27,6 +27,12 @@ export interface User extends BaseEntity {
|
|||||||
image: string | null;
|
image: string | null;
|
||||||
authProviderId: string | null;
|
authProviderId: string | null;
|
||||||
preferences: Record<string, unknown>;
|
preferences: Record<string, unknown>;
|
||||||
|
deactivatedAt: Date | null;
|
||||||
|
isLocalAuth: boolean;
|
||||||
|
passwordHash: string | null;
|
||||||
|
invitedBy: string | null;
|
||||||
|
invitationToken: string | null;
|
||||||
|
invitedAt: Date | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user