User

User profile with role-based access, optional address, and create/update variants.

Report an issue
auth

Install

$ npx shadcn@latest add @open-types/user

Dependencies

Source

import type { Address } from "./address";

export type UserRole = "admin" | "user" | "moderator" | "viewer";

export interface User {
  id: string;
  email: string;
  name: string;
  role?: UserRole;
  avatar?: string;
  address?: Address;
  bio?: string;
  isActive: boolean;
  createdAt: string;
  updatedAt: string;
}

export type UserCreate = Omit<User, "id" | "createdAt" | "updatedAt">;

export type UserUpdate = Partial<UserCreate>;
import type { Address } from "./address";

export type UserRole = "admin" | "user" | "moderator" | "viewer";

export interface User {
  id: string;
  email: string;
  name: string;
  role?: UserRole;
  avatar?: string;
  address?: Address;
  bio?: string;
  isActive: boolean;
  createdAt: string;
  updatedAt: string;
}

export type UserCreate = Omit<User, "id" | "createdAt" | "updatedAt">;

export type UserUpdate = Partial<UserCreate>;