feat(03-01): add Module SDK package and Prisma module registry schema
- Create @tessera/module-sdk with TesseraModule, ModuleRoute, ModuleManifest, ModuleCategory types - Add Module and TenantModuleActivation Prisma models with tenant-scoped unique constraint - Apply migration add-module-registry to PostgreSQL - Framework-agnostic ComponentType for lazy-loaded module UIs
This commit is contained in:
@@ -84,3 +84,29 @@ model LdapFieldMapping {
|
||||
|
||||
@@unique([ldapConfigId, ldapField])
|
||||
}
|
||||
|
||||
model Module {
|
||||
id String @id @default(uuid())
|
||||
slug String @unique
|
||||
name String
|
||||
version String
|
||||
category String
|
||||
description Json
|
||||
icon String?
|
||||
isSystem Boolean @default(false)
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
activations TenantModuleActivation[]
|
||||
}
|
||||
|
||||
model TenantModuleActivation {
|
||||
id String @id @default(uuid())
|
||||
tenantId String
|
||||
moduleId String
|
||||
isActive Boolean @default(true)
|
||||
activatedAt DateTime @default(now())
|
||||
module Module @relation(fields: [moduleId], references: [id], onDelete: Cascade)
|
||||
|
||||
@@unique([tenantId, moduleId])
|
||||
@@index([tenantId])
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user