feat: 增加门窗行业模板声明与验收夹具

This commit is contained in:
que01 committed 2026-09-23 01:07:56 +08:00
1 parent 8b85cc0403
commit 041a6a7f02
7 files changed
+70 -9

No files matched your search

+3 -3
View File
@@ -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 {
+1 -1
View File
@@ -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 } });