feat: 完成模板管理阶段4闭环

This commit is contained in:
que01 committed 2026-10-17 13:56:19 +08:00
1 parent b1e8012ded
commit d1958a7d7f
26 files changed
+1179 -310

No files matched your search

+38 -9
View File
@@ -65,6 +65,7 @@ model BrandProfile {
adminMemberships BrandMembership[]
releases BrandRelease[]
miniAppReleases MiniAppReleaseTask[]
bootstrapImports TemplateBootstrapImport[]
}
model BrandRelease {
@@ -167,18 +168,23 @@ model CapabilityAuditLog {
}
model BrandTemplateInstallation {
id String @id @default(uuid())
brandId String
brand BrandProfile @relation(fields: [brandId], references: [id], onDelete: Cascade)
templateKey String
templateVersion String @default("1.0.0")
configSnapshot Json
previousSnapshots Json @default("[]")
installedAt DateTime @default(now())
updatedAt DateTime @updatedAt
id String @id @default(uuid())
brandId String
brand BrandProfile @relation(fields: [brandId], references: [id], onDelete: Cascade)
templateKey String
templateVersion String @default("1.0.0")
visualTemplateKey String?
templatePackageVersionId String?
templatePackageVersion TemplatePackageVersion? @relation("BrandTemplateInstallationPackageVersion", fields: [templatePackageVersionId], references: [id], onDelete: SetNull)
contentChecksum String?
configSnapshot Json
previousSnapshots Json @default("[]")
installedAt DateTime @default(now())
updatedAt DateTime @updatedAt
@@unique([brandId, templateKey])
@@index([brandId])
@@index([templatePackageVersionId])
}
model BrandFieldDefinition {
@@ -433,6 +439,8 @@ model TemplatePackageVersion {
importedById String
importedBy AdminUser @relation("TemplatePackageImportedBy", fields: [importedById], references: [id], onDelete: Restrict)
auditLogs TemplatePackageAuditLog[]
installations BrandTemplateInstallation[] @relation("BrandTemplateInstallationPackageVersion")
bootstrapImports TemplateBootstrapImport[]
importedAt DateTime @default(now())
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
@@ -442,6 +450,27 @@ model TemplatePackageVersion {
@@index([importedById, importedAt])
}
model TemplateBootstrapImport {
id String @id @default(uuid())
brandId String
brand BrandProfile @relation(fields: [brandId], references: [id], onDelete: Cascade)
templatePackageVersionId String
templatePackageVersion TemplatePackageVersion @relation(fields: [templatePackageVersionId], references: [id], onDelete: Restrict)
packageKey String
packageVersion String
contentChecksum String
actorId String
strategy String @default("missing_only")
status String
result Json?
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
@@index([brandId, createdAt])
@@index([templatePackageVersionId, createdAt])
@@index([actorId, createdAt])
}
model TemplatePackageAuditLog {
id String @id @default(uuid())
templatePackageVersionId String