feat: 增加门窗行业模板声明与验收夹具
This commit is contained in:
1 parent
8b85cc0403
commit
041a6a7f02
7 files changed
+70
-9
No files matched your search
@@ -13,7 +13,7 @@ import {
|
||||
|
||||
export class UpdateBrandDto {
|
||||
@IsOptional() @IsString() name?: string;
|
||||
@IsOptional() @IsIn(["food", "personal"]) templateKey?: "food" | "personal";
|
||||
@IsOptional() @IsIn(["food", "personal", "doors"]) templateKey?: "food" | "personal" | "doors";
|
||||
@IsOptional() @IsString() tagline?: string;
|
||||
@IsOptional() @IsString() description?: string;
|
||||
@IsOptional() @IsString() avatarUrl?: string;
|
||||
@@ -75,8 +75,8 @@ export class UpdateBookingTagsDto {
|
||||
}
|
||||
|
||||
export class InstallTemplateDto {
|
||||
@IsIn(["personal", "food"])
|
||||
templateKey!: "personal" | "food";
|
||||
@IsIn(["personal", "food", "doors"])
|
||||
templateKey!: "personal" | "food" | "doors";
|
||||
}
|
||||
|
||||
export class UpdateCapabilityInstallationDto {
|
||||
|
||||
@@ -6,7 +6,7 @@ import { PrismaService } from "./prisma.service.js";
|
||||
@Injectable()
|
||||
export class TemplateWorkspaceService {
|
||||
constructor(private readonly prisma: PrismaService) {}
|
||||
async install(brandId: string, templateKey: "personal" | "food") {
|
||||
async install(brandId: string, templateKey: "personal" | "food" | "doors") {
|
||||
const template = getBrandTemplate(templateKey);
|
||||
if (!template) throw new BadRequestException("行业模板不存在");
|
||||
const existing = await this.prisma.brandTemplateInstallation.findFirst({ where: { brandId } });
|
||||
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"templateKey": "doors",
|
||||
"version": "1.0.0",
|
||||
"pages": ["home", "offerings", "detail", "inquiry", "success", "records", "profile"],
|
||||
"layout": { "home": ["brand-hero", "founder-card", "trust-proof", "offering-list"] },
|
||||
"requiredModules": [
|
||||
"brand-hero",
|
||||
"founder-card",
|
||||
"trust-proof",
|
||||
"offering-list",
|
||||
"offering-detail",
|
||||
"inquiry-form",
|
||||
"records",
|
||||
"profile",
|
||||
"success-summary"
|
||||
],
|
||||
"requiredCapabilities": ["offerings", "inquiry"],
|
||||
"visualAnchors": { "home": ["brand-hero", "founder-card", "trust-proof", "offering-list"] }
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
const fs = require("node:fs");
|
||||
const path = require("node:path");
|
||||
const root = path.resolve(__dirname, "..");
|
||||
const fixtureFiles = ["linjing-door.json", "minimal-neutral.json"];
|
||||
const fixtureFiles = ["linjing-door.json", "minimal-neutral.json", "doors-industry.json"];
|
||||
const fixtures = fixtureFiles.map((file) => JSON.parse(fs.readFileSync(path.join(__dirname, "fixtures", file), "utf8")));
|
||||
for (const fixture of fixtures) {
|
||||
const modules = fixture.requiredModules.map((key) => path.join(root, "components/modules", key));
|
||||
|
||||
Reference in new issue
Block a user