mirror of
https://github.com/kjanat/livedash-node.git
synced 2026-02-13 16:35:44 +01:00
fix: resolve Prettier markdown code block parsing errors
- Fix syntax errors in skills markdown files (.github/skills, .opencode/skills) - Change typescript to tsx for code blocks with JSX - Replace ellipsis (...) in array examples with valid syntax - Separate CSS from TypeScript into distinct code blocks - Convert JavaScript object examples to valid JSON in docs - Fix enum definitions with proper comma separation
This commit is contained in:
@@ -9,26 +9,6 @@ datasource db {
|
||||
directUrl = env("DATABASE_URL_DIRECT")
|
||||
}
|
||||
|
||||
/// *
|
||||
/// * PLATFORM USER (super-admin for Notso AI)
|
||||
/// * Platform-level users who can manage companies and platform-wide settings
|
||||
/// * Separate from Company users for platform management isolation
|
||||
model PlatformUser {
|
||||
id String @id @default(uuid())
|
||||
/// Platform user email address
|
||||
email String @unique @db.VarChar(255)
|
||||
/// Hashed password for platform authentication
|
||||
password String @db.VarChar(255)
|
||||
/// Platform permission level
|
||||
role PlatformUserRole @default(ADMIN)
|
||||
/// Display name for platform user
|
||||
name String @db.VarChar(255)
|
||||
createdAt DateTime @default(now()) @db.Timestamptz(6)
|
||||
updatedAt DateTime @updatedAt @db.Timestamptz(6)
|
||||
|
||||
@@index([email])
|
||||
}
|
||||
|
||||
/// *
|
||||
/// * COMPANY (multi-tenant root)
|
||||
/// * Root entity for multi-tenant architecture
|
||||
@@ -61,35 +41,30 @@ model Company {
|
||||
}
|
||||
|
||||
/// *
|
||||
/// * USER (authentication accounts)
|
||||
/// * Application users with role-based access control
|
||||
/// * Each user belongs to exactly one company for data isolation
|
||||
/// * USER (unified authentication accounts)
|
||||
/// * All users: platform admins (companyId=null) and company users (companyId set)
|
||||
/// * Authentication handled by Neon Auth, this table stores authorization data
|
||||
model User {
|
||||
id String @id @default(uuid())
|
||||
/// User email address, must be unique across all companies
|
||||
email String @unique @db.VarChar(255)
|
||||
/// Hashed password for authentication
|
||||
password String @db.VarChar(255)
|
||||
/// User permission level within their company
|
||||
role UserRole @default(USER)
|
||||
/// Foreign key to Company - enforces data isolation
|
||||
companyId String
|
||||
/// Temporary token for password reset functionality
|
||||
resetToken String? @db.VarChar(255)
|
||||
/// Expiration time for reset token
|
||||
resetTokenExpiry DateTime? @db.Timestamptz(6)
|
||||
createdAt DateTime @default(now()) @db.Timestamptz(6)
|
||||
updatedAt DateTime @updatedAt @db.Timestamptz(6)
|
||||
id String @id @default(uuid())
|
||||
/// User email address, must be unique (synced from Neon Auth)
|
||||
email String @unique @db.VarChar(255)
|
||||
/// User permission level (includes both platform and company roles)
|
||||
role UserRole @default(USER)
|
||||
/// Foreign key to Company - null for platform users, set for company users
|
||||
companyId String?
|
||||
createdAt DateTime @default(now()) @db.Timestamptz(6)
|
||||
updatedAt DateTime @updatedAt @db.Timestamptz(6)
|
||||
/// Display name for the user
|
||||
name String? @db.VarChar(255)
|
||||
name String? @db.VarChar(255)
|
||||
/// When this user was invited
|
||||
invitedAt DateTime? @db.Timestamptz(6)
|
||||
invitedAt DateTime? @db.Timestamptz(6)
|
||||
/// Email of the user who invited this user (for audit trail)
|
||||
invitedBy String? @db.VarChar(255)
|
||||
company Company @relation("CompanyUsers", fields: [companyId], references: [id], onDelete: Cascade)
|
||||
invitedBy String? @db.VarChar(255)
|
||||
company Company? @relation("CompanyUsers", fields: [companyId], references: [id], onDelete: Cascade)
|
||||
|
||||
@@index([companyId])
|
||||
@@index([email])
|
||||
@@index([role])
|
||||
}
|
||||
|
||||
/// *
|
||||
@@ -328,24 +303,18 @@ model CompanyAIModel {
|
||||
@@index([companyId, isDefault])
|
||||
}
|
||||
|
||||
/// Platform-level user roles for Notso AI team
|
||||
enum PlatformUserRole {
|
||||
/// Full platform access, can create/suspend companies
|
||||
SUPER_ADMIN
|
||||
/// Platform administration, company management
|
||||
ADMIN
|
||||
/// Customer support access, read-only company access
|
||||
SUPPORT
|
||||
}
|
||||
|
||||
/// User permission levels within a company
|
||||
/// Unified user roles for both platform and company users
|
||||
enum UserRole {
|
||||
/// Full access to company data and settings
|
||||
/// Platform: Full platform access, can create/suspend companies
|
||||
PLATFORM_SUPER_ADMIN
|
||||
/// Platform: Platform administration, company management
|
||||
PLATFORM_ADMIN
|
||||
/// Platform: Customer support access, read-only company access
|
||||
PLATFORM_SUPPORT
|
||||
/// Company: Full access to company data and settings
|
||||
ADMIN
|
||||
/// Standard access to view and interact with data
|
||||
/// Company: Standard access to view and interact with data
|
||||
USER
|
||||
/// Read-only access for compliance and auditing
|
||||
AUDITOR
|
||||
}
|
||||
|
||||
/// Company operational status
|
||||
|
||||
Reference in New Issue
Block a user